How felipecal/ride-hailing works
Project Overview
• The project is a modular ride-hailing application built following Clean Architecture principles. It is divided into three main modules:
• Account: Manages user accounts and authentication.
• Payment: Handles transactions and payment processing.
• Ride: Manages ride requests, ride statuses, and integration with other modules.
• External dependencies include a PostgreSQL database and RabbitMQ for messaging, as indicated in the README.
Main Components and Layers
a. Domain Layer – Entities, Value Objects, domain logic, and events (for example, Account, Transaction, Ride, RideCompleted event, etc.).
b. Application Layer – Use cases (e.g., Signup, GetAccount, ProcessPayment, RequestRide, AcceptRide etc.) that orchestrate business logic.
c. Infrastructure Layer – Adapters for database connections, HTTP controllers, gateways (MailerGateway, PaymentGateways, AccountGateway), repository implementations, ORM, and queues.
Relationships and Interactions
• That the Ride module communicates with the Account and Payment modules through adapter/gateway implementations (e.g., AccountGatewayHttp and PaymentGatewayHttp) to perform validations, payments, and share status updates.
• How repository components interact with the external PostgreSQL database.
• Message Queue (RabbitMQ) flows for event-driven actions, such as queuing ride events or payment notifications.
• Integration points with external dependencies (PostgreSQL, RabbitMQ).
Architectural Patterns and Technologies
• Use of Clean Architecture with a clear separation between layers.
• Use of specific technologies:
• Node.js/TypeScript for the modules (inferred from file extensions and configuration files such as tsconfig.json and package.json).
• PostgreSQL for persistent storage (indicated by create.sql and docker command).
• RabbitMQ for asynchronous processing and event handling.
• Testing frameworks (jest) as seen in the test folders.