How ixgnoy/travelnow works
Project type and purpose
• This is a full‐stack e-commerce travel web application (“Travel.Now”) built with Spring Boot (MVC), Thymeleaf templates, static front-end assets (HTML/CSS/JS/Bootstrap), and an H2/MySQL database.
• It provides user/auth flows, admin CRUD for packages/bookings/users, user CRUD for bookings/payments, and persists data via Spring Data JPA.
High-level architectural components
a. Client Layer
• Browser (or HTTP client e.g. Postman) requesting HTML pages, REST endpoints, static assets.
• Static front-end: HTML/CSS/JS/Bootstrap in src/main/resources/static.
• Thymeleaf templates in src/main/resources/templates render dynamic pages.
b. Web/API Layer
• Controllers (package com.csc3402.lab.staff.controller):
– UserController, LoginController, HomeController, PackageController, BookingController, PaymentController.
• Spring Security intercepts requests for authentication/authorization.
c. Service Layer
• Business logic in services (com.csc3402.lab.staff.service):
– UserService/UserServiceImpl, PackageServiceImpl, BookingServiceImpl, PaymentServiceImpl.
d. Data Access Layer
• Repositories (Spring Data JPA) in com.csc3402.lab.staff.repository:
– UserRepository, PackageRepository, BookingRepository, PaymentRepository.
• JPA Entities/DTOs in com.csc3402.lab.staff.model: User, Package, Booking, Payment, UserDto.
e. Persistence
• Embedded H2 (and optional MySQL) configured in application.properties.
• travelnowdb.mv.db file under /data for H2.
• ERD: User 1-to-M Booking, Booking 1-to-1 Payment, Booking 1-to-1 Package.
f. Build & Deployment
• Maven (pom.xml), packaging into a Spring Boot fat jar.
• .vscode/.idea and target/ for IDE and build artifacts.
Relationships & interactions
• Browser → (HTTP GET/POST) → Spring Security filter → DispatcherServlet → Controller → Service → Repository → Database
• Data flows back up: DB → JPA → Service → Controller → Thymeleaf → Browser-rendered HTML.
Architectural patterns & principles
• Layered (Presentation → Controller → Service → Repository → Database).
• MVC: Thymeleaf views + Controller actions.
• Dependency Injection (Spring).
• RESTful endpoints are implied (controllers return views or JSON).
• Separation of concerns between user/admin modules by URL namespaces.
Diagramming main components
a. Frontend/UI
– Static assets (CSS/JS) served from /static.
– Thymeleaf templates under /templates.
b. Backend
– Service layer.
– Repository layer.
c. Database
– H2/MySQL.
d. Security
– Spring Security module intercepting at web layer.
e. External/Test
– Postman or any HTTP client for API testing.
• /static (CSS/JS), Thymeleaf templates (/templates).
• Security Filter Chain → DispatcherServlet → Controller components.
7. Optionally, show the file data/travelnowdb.mv.db as the physical database file.