How kelvinn44/electrigo works
Project Type & Purpose
• This is a full-stack microservices application built around domain-driven design. Its purpose is to manage car rentals, with distinct services for user/account management (accountService), car bookings and vehicle management (carRentalService), and payment processing (paymentService). A separate frontend (in the public directory) provides the user interface.
Main Components
• Account Service:
• Contains business logic related to user accounts, authentication, and account management.
• Files in accountService/account and the main file “main.go”.
• Car Rental Service:
• Responsible for handling vehicle details and booking/reservation logic.
• Separated into subdirectories (booking and car).
• Payment Service:
• Manages payment processing.
• Contains its own main and sub-directory for payment functionality.
• Frontend:
• Static HTML pages, JavaScript, and CSS files under the “public” directory.
• Database:
• The application uses MySQL (as indicated by seed.sql and instructions in the README) to manage persistent data across microservices.
• External Dependencies:
• RESTful API interactions between these services following an API-first approach.
• Environment variables (configured via .env files in accountService and paymentService).
Relationships & Interactions
• Each microservice is independently deployable and interacts with others via RESTful APIs.
• The microservices themselves are loosely coupled: for example, the car rental service uses a separate API call to contact the payment service when processing bookings.
Architectural Patterns & Design Principles
• Domain-Driven Design: Each service encapsulates its respective domain logic (accounts, vehicles/bookings, payments).
• Loosely Coupled Microservices: Clearly show that each service is autonomous with its own processes and deployment lifecycle.
• API-First Communication: Represent communication between services over RESTful APIs and include versioning details (e.g., /v1) if necessary.
• Independent Deployability: Indicate that services can be updated or rolled back without affecting others.
• Security Best Practices: Optionally, note elements like environment variables for credentials and secure password handling (bcrypt).