How udarakavishka/ceylonroots works
Project Type & Purpose
• CeylonRoots is a full-stack travel agency platform with:
• A Next.js 14 frontend (app router, server+client components, API routes)
• A Spring Boot backend exposing REST endpoints
• Persistent storage (MySQL) and object storage (AWS S3)
• Third-party integrations (Stripe/PayPal, Google Maps, JWT auth)
High-Level Components
A. Client Browser
• Renders React pages served by Next.js
• Interacts via HTTP/HTTPS (SSR + CSR + API calls)
B. Next.js Frontend
• UI Layer (pages under app/, reusable components)
• App Router + SSR/SSG
• API Routes (app/api) acting as BFF or proxy to backend
• Tailwind CSS, context providers, hooks
C. Spring Boot Backend
• MVC Layers:
• Controllers (AccommodationController, BlogPostController, etc.)
• Services (AccommodationService, AwsS3Service, etc.)
• Repositories (JPA interfaces to MySQL)
• Global exception handling, DTO converters
• Security: JWT authentication filter
• Configuration: CorsConfig, application.properties
D. Data Stores
• MySQL relational database (schemas for Users, Packages, BlogPosts, etc.)
• AWS S3 buckets (for Gallery images)
E. External Services
• Payment gateways (Stripe, PayPal)
• Google Maps API (maps, geocoding)
• Optional Chat/Live chat provider
Interactions & Data Flow
1. User → Browser: requests UI routes or performs client-side navigation.
2. Browser ↔ Next.js:
• SSR/SSG pages served by Next.js server
• CSR API calls to /api/* endpoints for dynamic data
3. Next.js API Routes → Spring Boot Backend:
• Translates front-end requests into REST calls (e.g., GET /api/destinations → GET /backend/destinations)
• Handles JWT tokens (passes Authorization header)
4. Spring Boot → MySQL & AWS S3:
• CRUD via JPA repositories to MySQL
• File uploads/downloads via AwsS3Service to S3
5. Spring Boot → External APIs:
• Payment processing POSTs to Stripe/PayPal
• Data from Google Maps
6. Response chains back to user
Architectural Patterns & Principles
• Next.js as BFF (Backend-for-Frontend) for consolidated API
• MVC (Controller → Service → Repository) in Spring Boot
• Layered security with JWT and CORS configuration
• Separation of concerns: UI vs application logic vs data access
• Reusable UI components and contexts in frontend