This service acts as the central entry point for the entire flight booking system. It handles user authentication, Role-Based Access Control (RBAC), and serves as an API Gateway, proxying traffic to downstream microservices while enforcing rate limits.
The code follows a strict 3-layer architecture (Controller-Service-Repository) alongside an API Gateway routing mechanism
When a user signs up, the system must securely store their credentials and assign a default role.
B. Authentication (JWT Generation) When a user signs in, the system verifies their identity and issues a stateless token.
bcrypt.compare.id and email.JWT_SECRET and return it to the client.The application utilizes Sequelize ORM to model a Many-to-Many relationship between Users and Roles.
id, email, and password. Includes a beforeCreate hook to automatically salt and hash passwords before they touch the database.