Skip to content

nayefserag/AuthBridge

Repository files navigation

🔐 AuthBridge

NestJS TypeScript MongoDB Swagger License CI

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.

✨ Features

  • 📝 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

🧰 Tech Stack

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

🚀 Getting Started

npm install
cp .env.example .env        # set APP_NAME, *_MONGO_URI, JWT & Google OAuth keys
npm run start:dev

API docs available at /api (Swagger UI) once running.

🐳 Docker

docker build -t authbridge .
docker run -p 3000:3000 --env-file .env authbridge

🧪 Testing

npm test
npm run test:e2e
npm run test:cov

📄 License

MIT


If this project helped you, consider giving it a ⭐

About

Multi-tenant NestJS auth service: email/OTP, Google OAuth, JWT

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors