This repository contains the backend code for the Agado flight booking platform. The backend is responsible for handling user authentication, flight data management, booking transactions, and administrative functions. This project is part of the CPE241 - Database System course at King Mongkut's University of Technology Thonburi (KMUTT).
- User Authentication: Stateless authentication using JWT and password encryption with bcrypt
- Data Management: CRUD operations for most of the data.
- Booking Management: Secure booking processing.
The frontend for Agado is maintained in a seperate repository. You can find it here.
git clone https://github.com/Encall/agado-backend.git cd agado-backend pnpm installCreate a .env file in the root directory and add your environment variables:
DB_HOST=your_database_host
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
DB_NAME=your_database_name
JWT_ACCESS_SECRET_KEY=your_jwt_secret
JWT_ACCESS_EXPIRATION=your_jwt_expiration ex. 1h, 1d, 1w, 1m, 1y
JWT_REFRESH_SECRET_KEY=your_jwt_refresh_secret
JWT_REFRESH_EXPIRATION=your_jwt_expiration ex. 1h, 1d, 1w, 1m, 1y pnpm run devTo run the backend in a Docker container
docker build -t encalls/adago-backend docker run --name adago-backend -p 3000:3000 encalls/adago-backendThe backend is deployed on Amazon Elastic Container Service using a load balancer for scalability and Amazon Relational Database Service with read-replica support. Kubenetes is supported but not operational.

- /src: Contains the main source code for the application.
- /configs: Contains configuration files for the application.
- /controllers: Handles the request and response logic.
- /drizzle: Defines the database schema.
- /middlewares: Contains middleware functions for authentication and request processing.
- /routes: Defines the API routes and their associated handlers.
- /schemas: Defines validation schemas and rules for request data.