server/
|. │
|. ├── config/
|. │ ├── [Link] # Redis client config
|. │ ├── [Link] # Nodemailer config
|. │ └── [Link] # Twilio or SMS gateway config
|. │
|. ├── controllers/
|. │ ├── [Link] # Auth endpoints: login, register
|. │ └── auth/
|. │ └── [Link] # OTP send/verify logic
|. │
|. ├── middlewares/
|. │ ├── [Link] # JWT validation, user attach
|. │ ├── [Link] # Request throttling
|. │ └── [Link] # Central error handler (optional)
|. │
|. ├── models/
|. │ ├── [Link]
|. |. |------ [Link] # perfect
|. |. |------ [Link] # perfect
|. |. |------- [Link] # perfect
|. |. |------- [Link] # perfect
|. |. |------- [Link] # perfect
|. │
|. ├── routes/
|. │ ├── [Link] # Auth routes (login, register)
|. │ ├── auth/
|. │ ├── [Link] # Email OTP routes
|. │ ├── [Link] # Mobile OTP routes
|. │ └── [Link] # (optional) unified OTP router if needed
|. │
|. ├── services/
|. │ ├── [Link] # Auth business logic
|. │ ├── [Link] # Email sending logic (optional)
|. │ └── [Link] # SMS sending logic (optional)
|. │
|. ├── utils/
|. │ ├── [Link] # Mobile number helper
|. │ ├── [Link] # OTP generation helper
|. │ ├── [Link] # JWT token utilities
|. │ ├── [Link] # Redis wrapper/helper (optional)
|. │ ├── [Link] # Email helpers
|. │ └── [Link] # SMS helpers
|. │
|. ├── [Link] # Database access layer (CRUD)
|. ├── [Link] # Database connection setup
|. ├── [Link] # Environment variable loader
|. ├── [Link] # App entry point
|. ├── [Link] # Swagger/OpenAPI setup
|. ├── [Link] # Vite server setup (if used)
|. |----- [Link] # Main route composition & mounting
└── ... (other files like types, shared schemas, etc.)
|
|
|------ .env (already have upstash redis, twilio, jwt, database_url, vite api url & gmail SMTP Configuration. )