This repository provides authentication microservices for the Bodega platform. It includes two implementations:
- Python (FastAPI):
auth-service
- TypeScript (Node.js/Express/Prisma):
auth-service-ts
Both services handle user registration, login, token issuance, and validation, and are designed for integration with Bodega's backend, frontend, and Discord bot.
bodega-auth-service/
├── auth-service/ # Python FastAPI implementation
├── auth-service-ts/ # TypeScript/Node.js implementation
└── README.md
cd auth-service
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
Copy .env.example
to .env
and fill in required values.
uvicorn app.main:app --reload
docker build -t bodega-auth-service:py .
docker run --env-file .env -p 8000:8000 bodega-auth-service:py
cd auth-service-ts
npm install
Copy .env.example
to .env
and fill in required values.
npm run dev
docker build -t bodega-auth-service:ts .
docker run --env-file .env -p 8000:8000 bodega-auth-service:ts
Both services require environment variables for secrets and configuration. See the respective .env.example
files for details. Common variables include:
JWT_SECRET
— Secret key for signing JWTsDATABASE_URL
— Database connection stringPORT
— Port to run the service on
- POST /register — Register a new user
- POST /login — Authenticate user and return JWT
- GET /me — Get current user info (requires auth)
- POST /token/validate — Validate a JWT token
(Endpoints may vary slightly between implementations. See code for details.)
- Used by Bodega backend, frontend, and Discord bot for authentication and token management.
- Designed to be run as a microservice in your deployment.
MIT