A reusable NestJS authentication service that handles registration, login, and user management for multiple applications — with standard email/password, Google OAuth, and OTP verification, plus a dynamic multi-database design so one deployment can serve several apps.
- 📝 Email/password registration & login
- 🔵 Google OAuth sign-in
- 📲 OTP (one-time password) verification
- 🪙 JWT-based session management
- 🗂️ Dynamic database support — switch DB per application via
APP_NAME(e.g.ECOMMERCE_APP_MONGO_URI,SOCIAL_MEDIA_APP_MONGO_URI) - 👤 User profile management & updates
- 📜 Swagger API documentation
| Area | Tech |
|---|---|
| Framework | NestJS |
| Language | TypeScript |
| Database | MongoDB (per-app, env-driven) |
| Auth | JWT, Google OAuth, OTP |
| Docs | Swagger |
| Testing | Jest (unit + e2e + coverage) |
| Deploy | Docker |
npm install
cp .env.example .env # set APP_NAME, *_MONGO_URI, JWT & Google OAuth keys
npm run start:devAPI docs available at /api (Swagger UI) once running.
docker build -t authbridge .
docker run -p 3000:3000 --env-file .env authbridgenpm test
npm run test:e2e
npm run test:covMIT
If this project helped you, consider giving it a ⭐