How nejlasahin/airline-reservation-system works
Project Type & Purpose
• This is a monolithic, full-stack Java web application implementing an Airline Reservation System.
• It follows the classic MVC pattern, uses JSP for views, Servlets for controllers, DAOs/POJOs for the model, MySQL for persistence, and integrates file storage (for logos) and SMTP (for email).
File‐Structure & Architectural Patterns
• src/java/model: POJO classes representing DB tables (User, Flight, Reservation, Message, etc.).
• src/java/dao: DAO classes encapsulating JDBC calls (mysql-connector) for CRUD operations on each entity.
• src/java/servlet: Controller layer. One Servlet per module (e.g. KullaniciServlet for users, RezervasyonServlet for bookings). They handle HTTP requests, invoke DAOs, manage sessions, choose JSP views.
• web/\*:
• JSP pages for user UI and admin panel under web/ and web/admin/
• Static assets: CSS/SCSS, JS, images under web/assets/ and web/admin/css/js/vendor/
• WEB-INF/web.xml & context.xml configure servlets, data source
• sql/hawkeye.sql holds the DB schema.
• Uses Apache Commons FileUpload for multipart form handling and JavaMail API for outgoing email.
a. Main Components
• Browser (Web Client): interacts via HTTP/HTTPS, displays JSP-generated HTML.
• Web Server (Servlet Container): houses the application WAR.
• View Layer: JSP pages + static assets
• Controller Layer: Servlet classes grouped by functional area
• Model/DAO Layer: POJOs + DAO classes, business logic confined to controllers/DAOs
• Database: MySQL instance (tables: users, flights, reservations, messages, airports, etc.)
• File System Storage: directory under web/assets/data/ for uploaded logos
• SMTP Server: external email service (smtp.gmail.com) for messaging
b. Relationships & Data Flows
1. Browser → HTTP Request → Servlet (Controller)
2. Servlet → calls DAO → executes SQL → returns POJOs
3. Servlet → places data in request/session → forwards to JSP
4. JSP → renders HTML/CSS/JS → Browser
5. For uploads: Servlet writes files to FS → DAO records filename in DB
6. For email: Servlet uses JavaMail to send via SMTP
c. Architectural Patterns & Principles
• MVC separation: keeps UI, control logic, and data access decoupled
• DAO Pattern: isolating JDBC code
• Layered three-tier architecture: Presentation / Application / Data
• Session management and role-based access (admin vs. user)
d. Key Technologies & Frameworks
• Java Servlet API & JSP + JSTL 1.2.2
• JDBC with mysql-connector-java 5.1.23
• Apache Commons FileUpload 1.4
• JavaMail API (javax.mail.jar)
• Ant build (build.xml and NetBeans project files)
• SCSS & sb-admin-2 Bootstrap theme for admin UI