A scalable, microservices-based flight booking platform built with Spring Boot.
- Microservices Architecture: Separate services for core operations, database, and notifications
- Airline Management: Register and manage airlines with admin approval workflow
- Flight Search & Booking: Search for flights and book tickets
- Email Notifications: Real-time email notifications for various events
- RESTful APIs: Well-documented endpoints for all operations
- JWT Authentication: Secure API access with JSON Web Tokens
The system is divided into three main microservices:
-
Central API (
central-api)- Main business logic and orchestration
- Handles user requests and coordinates between services
- Implements security and authentication
-
Database API (
db-api)- Manages all database operations
- Handles data persistence and retrieval
- Implements data access layer
-
Notification API (
notification-api)- Manages all email notifications
- Handles async notification delivery
- Supports various notification templates
- Backend: Java 17, Spring Boot 3.x
- Database: PostgreSQL/MySQL (configurable)
- Authentication: JWT (JSON Web Tokens)
- Email: JavaMail with SMTP
- Build Tool: Maven
- API Documentation: SpringDoc OpenAPI
- Java 17 or higher
- Maven 3.8+
- PostgreSQL/MySQL
- SMTP server (or use a testing service like Mailtrap)
git clone <repository-url>
cd flight-booking-system- Create a new database for each service
- Update the
application.propertiesfiles with your database credentials
# Build all services
mvn clean installRun each service in separate terminals:
# Terminal 1 - Central API
cd central-api
mvn spring-boot:run
# Terminal 2 - DB API
cd db-api
mvn spring-boot:run
# Terminal 3 - Notification API
cd notification-api
mvn spring-boot:runThe system uses JWT for authentication. Include the token in the Authorization header:
Authorization: Bearer <your-jwt-token>
Once the services are running, access the API documentation:
- Central API: http://localhost:8080/swagger-ui.html
- DB API: http://localhost:8081/swagger-ui.html
- Notification API: http://localhost:8082/swagger-ui.html
For development, you can use Mailtrap or a similar service. Update the email configuration in notification-api/src/main/resources/application.properties.
-
Email Sending Issues:
- Check SMTP configuration
- Verify recipient addresses in DTOs match between services
- Ensure proper field names in DTOs (e.g.,
adminvsappAdmin)
-
404 Errors:
- Verify endpoint mappings in controllers
- Ensure path variables use
@PathVariablecorrectly - Check service-to-service communication URLs
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or feedback, please reach out to the project maintainers.