docker and docker-compose needs to be setup first
cd user_service && docker-compose up -d && cd ..
cd user_interaction_service && docker-compose up -d && cd ..
cd content_service && docker-compose up -d && cd ..NOTE: This will take a fair bit of time since rust is a compiled language it needs a few minutes to compile
The scripts folder has a populate.sh script that can populate the databases with dummy data as long as nothing is modified beforehand
cd scripts
./populate.shNote: The content service can ingest csv file with Content-Type: text/csv but the dates need to be a unix timestamp
Since there is no service discovery I have hardcoded the values into each microservices .env file
- user_service ->
localhost:8001 - content_service ->
localhost:8002 - user_interaction_service ->
localhost:8003
Every route is documented with openapi/swagger specification and can be found after running the api and visiting 'address/swagger' The documentation is automatically generated during compilation and doesn't need to be manually generated.
- user_service ->
localhost:8001/swagger - content_service ->
localhost:8002/swagger - user_interaction_service ->
localhost:8003/swagger
Including the databases (postgresql)
Each service has a builder (rust:latest) which compiles the code and then runs it via a runner (debian:stable-slim) and a postgresql (postgresql:latest) container for the database. So thats 2 containers for each service
- user-service-api
- user_service
- user_postgres_service
- content-service-api
- content_service
- content_postgres_service
- user-interaction-service-api
- user_interaction_service
- user_interaction_postgres_service
Everything is a microservice with 3 separate instances of postgresql running and obviously 3 separate databases.
This is build using rust language and rocket framework, using diesel ORM and postgresql database.