A simple job scheduler app using microservices architecture. Users can # (as admin or normal role).
- Admins can query the list of all users.
- Admins can schedule email jobs to be run in the future.
- Admins can query the reports.
Just run docker-compose up
from the root directory(This downloads half of the internet onto your computer! A considerable amount of disk space is needed!). Then go to http://localhost:3000/
- Plan: Read
- Authentication service: Rust Read
- Scheduler service: Go Read
- Email service: Python Read
- Report service: Python Read
- API gateway service: Go Read
- Client service: Typescript Read
- Integration via docker-compose: Read
- Security: Read
-
Auth service
-
Scheduler service
- Golang : programming language
- gRPC-GO: gRPC framework for golang
- Mongo driver: Query builder for our database communication.
- Kafka go for our message broker communications from go.
- Quartz for scheduling purposes.
-
Email job executor service
- Python : programming language
- Kafka-python: For our message broker communications from go.
-
Reports service
- Python : programming language
- grpc: gRPC framework for python
- Pymongo: Query builder for our database communication.
- Kafka-Python for our message broker communications from python.
- grpcio-tools For compiling .proto files to python.
-
API gateway service
- Golang : programming language
- gRPC-GO: gRPC framework for golang
- Gin: Is a web framework written in Golang
- gin-swagger for our rest api documentation.
-
Client service
- Typescript : Programming language
- Next.js: Web framework that can be used for developing backend and front-end applications.
- Tailwind css: A utility-first CSS framework
- react-hook-form
- TanStack Query: An asynchronous state management.
- Backend GRPC service
- Create and develop your gRPC service independently. For authentication, consider accepting an environment variable called
AUTH_PUBLIC_KEY_FILE
to read authentication public key for verifying authorization header which is a simple jwt withrole
(admin or user ) for authorization. - Do the follwing to the api-gateway service (For more info see Here).
- Put your .proto file inside proto folder. Run
source build_grpc.sh
to compile your .proto file. - In api-gateway, inside
internal/models
folder create a file named<yourmodelname>
and create the necessary rest layer models and the conversion to/from proto models. - Add
<YOURSERVICE>_URL
to the config/config.go - Create a folder named
<yourmodelname>
insideinternal/models
- Inside
<yourmodelname>
folder create a folder named grpc and then a file named client_service.go. Put your grpc service communication logic here (Read<YOURSERVICE>_URL
from config). - Inside
<yourmodelname>
folder create a folder named handler and then a file named handler.go. Put your rest api for your grpc model here. - Add your rest-api end points to internal/api/router.go
- Put your .proto file inside proto folder. Run
- Create and develop your gRPC service independently. For authentication, consider accepting an environment variable called
- Front-end service
- Check the api-gateway rest api from here.
- Develop your client application to communicate with the rest api.
Finally add your service to the docker-compose.yml of the play-microservices. Add <YOURSERVICE>_URL
to the api gateway environment variables. Also add AUTH_PUBLIC_KEY_FILE=/run/secrets/auth-access-public-key
environemt variable to your service.
Services have been developed independently from each other. To debug each of the services, just run docker-compose up -d --build
from the folder of the service. Then using VSCode extension Dev Containers attach to the running container (Each service has several other dependent services in developement. Select the main service). Then open usr/src/app
folder inside the container and finally run the appropriate commands based on the project (For more information on how to debug the services, see articles above).
Example: Auth service
- cd to
auth
folder - Run
docker-compose up -d --build
- While running, click on the bottom left button to open a remote window via Dev Containers
- Select attach to running container then select
authentication-service
. Wait until the vscode new window starts. - Open folder
usr/src/app
inside container. This folder is mounted toauth-service
folder inside the host. - Open a new terminal and run
cargo run
- Start debugging. For more info see Here
- Add tests
- Add tracing
- Deploy to CI/CD environment via Jenkins
MIT License