How arjunkumar1877/holiday_home_server works
This is an Express user-authentication API. Clients register with an email and password, receive an OTP, verify their account, and can then log in to receive a JWT in an auth cookie; they can also request a replacement OTP. The entry point mounts user routes and initiates MongoDB connection. The controller coordinates user records, OTP generation, email delivery, and token signing. The shown source supports these calls, but the README is empty, so capabilities beyond the sampled authentication flow are not documented.
Main entry points: userController.ts User Controller · index.ts Express Server · userRoute.ts User Routes · userModel.ts User Model
Components 11
HTTP API
- Express Server
src/index.ts - User Routes
src/routes/userRoute.ts
Authentication
- User Controller
src/controllers/userController.ts - OTP Generator
src/services/otpGenerate.ts - JWT Signer
src/services/jwtServives.ts
Data And Services
- User Model
src/models/userModel.ts - DB Connection
src/utils/database.ts - OTP Email
src/services/nodemailer.ts
Other components
- API Client
- MongoDB
- SMTP Server
Connections 12
- API Client → Express Server: sends requests
src/index.ts - Express Server → User Routes: mounts routes
src/index.ts - User Routes → User Controller: dispatches requests
src/routes/userRoute.ts - User Controller → API Client: sends responses
src/controllers/userController.ts - User Controller → User Model: reads and writes
src/controllers/userController.ts - User Controller → OTP Generator: generates codes
src/controllers/userController.ts - User Controller → OTP Email: sends OTP
src/controllers/userController.ts - User Controller → JWT Signer: signs token
src/controllers/userController.ts - Express Server → DB Connection: connects database
src/index.ts - DB Connection → MongoDB: opens connection
src/utils/database.ts - User Model → MongoDB: persists users
src/models/userModel.ts - OTP Email → SMTP Server: sends mail
src/services/nodemailer.ts