A simple microservices books management system developed using FastAPI, postgres and Docker
-
To acommplish a fully managed microservices architecture setup, the books service (with it's own database) is created seperately as opposed to using a shared books database between the client and the admin.
-
The services are routed to the same ports using Nginx which in this case serves as both a reverse-proxy and api gateway
-
the services communicate to each other via http using the requests library (you might want to consider using a more robust approach (events/message-brokers) like Redis, RabbitMQ, Kafka e.t.c)
In the root of your project, run the command
docker-compose up -d
To start the container of each service, use the following command:
docker-compose up
- This project uses pytest for running tests
- You can test out each services (e.g client) by running the commands
cd <service_name>
then run the test
pytest
NB: It is assumed that the seeded data is actually in the database server of each service