How project-for-huflit/traveloki works
• FE_Traveloki – the client-facing front end (built with React/Vite, Tailwind CSS, etc.) that handles customer interactions, booking flows, ratings, and profiles.
• ADMIN_Traveloki – the admin panel (also React/Vite based) that gives administrators an interface for managing details like vehicles, schedules, and transactions.
• BE_Traveloki – the server-side business logic built in Node (likely Express-based) with an organized structure that includes controllers, services, routes, models, middlewares, and even integrations with Kafka (message-queue system), MongoDB (as seen in the configuration files), Cloudinary, and Google Drive providers.
Main Component Breakdown
a. Client Applications:
– Frontend (FE_Traveloki): Represents customer UI components for searching, booking (bus, car, train), cancellations, and ratings. Mark deployment with Netlify (as shown by the README badges).
– Admin Panel (ADMIN_Traveloki): Represents the administrative user interface that manages operations such as vehicle details, scheduling (LichChay), user accounts, and dashboard charts. Also deployed via Netlify.
b. Backend Service (BE_Traveloki):
– API endpoints grouped by functionalities (authentication, booking, details, feedback, history, etc.) managed via routes and controllers.
– Business logic layers handled in services and factories (e.g., booking service, carFactory service, etc.).
– Data persistence via MongoDB (indicated by config.mongodb.js and related init scripts).
– Middleware and security layers for authentication, API key checks (using x-api-key in headers), rate limiting, and error handling.
– Integration Components: Message queue (Kafka-based producers/consumers), Cloudinary and Google Drive providers for media handling.
c. External Services and Tools:
– Deployment & CI/CD: GitHub Workflows (for FE, GitHub packages, etc.) and Netlify dashboard integration.
– Third-party libraries for WebP image support (as explained in the README) along with Docker containerization (Dockerfiles and docker-compose files exist).
Relationship and Data Flow
– Both client applications (FE_Traveloki and ADMIN_Traveloki) send HTTP/HTTPS requests to the BE_Traveloki service using a secured API key in headers.
– The back end interacts with the database (MongoDB) to perform CRUD operations, store transaction records, booking details, and vehicle data.
– The BE_Traveloki also communicates with external services:
• Kafka for asynchronous messaging (e.g., notifications or updating booking statuses).
• Cloudinary (and perhaps Google Drive) for handling image uploads or document storage.
– GitHub workflows are integrated for continuous integration and deployment, affecting source code in FE, ADMIN, and BE respectively.
Architectural Patterns and Design Principles
– Layered Architecture: Clear separation of front end presentation, back end business logic (controllers, services, models), and data persistence.
– Modular Structure: Both FE and BE are split into modular components that can be independently tested and scaled.
– API-centric communication: Emphasis on RESTful endpoints with proper routing and middleware for validation and error handling.
– Use of a message queue (Kafka) indicates an event-driven or asynchronous processing aspect within the backend.
– Security best practices, as seen in the dedicated middleware and the use of an x-api-key header.
Final Recommendations
– Include clear, legible labels for each service or component.