Implementation of Microservices GenUI Architecture. The Current Microservices are:
- auth-server: Auth Server to manage Authentication & Authorization
- todo-server: Simple ToDo Server to authenticate using auth-server & perform TODOs Crud.
- nextjs-client: Conversational UI & TODOs Manager platform for you.
You can setup & run the project locally on your machine or on docker. Firstly let'e setup the env vars.
-
In auth-server
Rename .env.example to .env and add DB_URL, TEST_DB_URL, SECRET_KEY
-
In todo-server add DB_URL & TEST_DB_URL. They can be same as above or different
-
For nextjs-client run pnpm install - no need to update them
Open root dir i.e: cax in terminal and run
- Terminal 1:
make auth
& visithttp://localhost:8080/api/docs
- Terminal 2:
make todo
& visithttp://localhost:8000/api/docs
- Terminal 3:
make next
& visithttp://localhost:3000
Rename root .env.example to .env and add the missing env vars (DB_URL=, TEST_DB_URL=, SECRET_KEY=)
Run: docker compose -d up
We will be deploying FastAPI Microservices to Google Cloud Run and NextJS CUI to Vercel.
-
Ensure your have gcloud and vercel cli installed & authenticated
-
auth-server
cd auth-server
gcloud run deploy auth-server --source . --port 8080 --env-vars-file .env.gcp.yaml --allow-unauthenticated --region us-central1 --min-instances 1
- todo-server
cd todo-server
gcloud run deploy todo-micro-server --source . --port 8000 --env-vars-file .env.gcp.yaml --allow-unauthenticated --region us-central1 --min-instances 1
- nextjs-client
cd nextjs-client
vercel link
Then visit vercel and add all env vars to your project and in terminal run:
vercel --prod