elpapi42 / wordbox-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run the application

  1. Create .env
cp .env.example .env
  1. Spin up the containers
docker-compose up -d --build
  1. Run database migrations
docker exec users-service poetry run alembic upgrade head
  1. Check the API docs on http://localhost:8001/docs

Run the test

  1. Install dependencies with poetry
poetry install
  1. Run the basic test
poetry run make test
  1. If you want to run integration tests, you will need a postgres database up and running, follow the "How to run the application" section
  2. Run the full test suit
poetry run make test-integration

Live deployment

  • Docs
http://wordbox-test-93fm5.ondigitalocean.app/docs
  • Create user
curl --request POST \
  --url https://wordbox-test-93fm5.ondigitalocean.app/users \
  --header 'Content-Type: application/json' \
  --data '{
        "email": "whitman@email.com",
        "name": "whitman",
        "last_name": "bohorquez",
        "phones": ["9876556432"]
}'
  • Retrieve user
curl --request GET --url https://wordbox-test-93fm5.ondigitalocean.app/users/4c46288e-d09b-4e6f-95cf-baec94b5a9ae

References

I recycled code from an old project i created few months ago: https://github.com/elpapi42/reactive-microservices-with-kafka-python

About


Languages

Language:Python 92.6%Language:Mako 3.2%Language:Dockerfile 2.1%Language:Makefile 1.7%Language:Shell 0.4%