How atulmy/fullstack-event-driven-architecture works
Main Components
• API Microservices:
• API Core (projects/api/core): Handles central backend logic, routing, and core functionalities.
• API STT (projects/api/stt): Dedicated to speech-to-text functionalities.
• API TTS (projects/api/tts): Dedicated to text-to-speech functionalities.
• Front-end Applications:
• App Web (projects/app/web): Web version for end-users.
• App Console (projects/app/console): Console application for internal dashboards/administration.
• Site Web (projects/site/web): Likely a public-facing website.
• Shared Libraries/Packages:
• Common (packages/common): Contains shared configurations, utilities, and parameters that service different parts of the system.
• Model (packages/model): Contains domain models for blog, job, and user, ensuring consistency in data structures across services.
• UI (packages/ui): Provides shared UI components (React components, CSS/SCSS styling) that are used across front-end applications.
• Infrastructure and Integration:
• Database: Although not explicitly seen in the file tree, the README lists MongoDB as a prerequisite.
• Message Broker: Redis is used (primarily in development) for event handling between services, while the README notes that for production a more robust solution (e.g., RabbitMQ, Kafka) is suggested.
• Deployment/CI-CD: Dockerfiles for each service and workflows in the .github/workflows directory indicate containerization and automated deployment (e.g., GCP Cloud Run integration).
Relationships and Data Flow
• The API Services (Core, STT, and TTS) process and respond to business logic requests. They communicate with each other via event-driven mechanisms (through Redis in development) and may interface with the database.
• The front-end applications (App Web, App Console, and Site Web) interact with the API services via REST or GraphQL endpoints. They also use shared configurations from the common package.
• The shared packages (common, model, ui) serve as the foundational libraries that promote code reuse and consistency across both backend and frontend components.
• Deployment artifacts (Dockerfiles) encapsulate each service, and CI/CD pipelines (GitHub workflows) automate the build, test, and deployment processes.
Architectural Patterns and Design Principles
• Microservices Architecture: The system decomposes backend functionality into multiple services (core, stt, tts). Each microservice is independently managed, containerized, and deployed.
• Event-Driven Communication: As indicated by the usage of Redis for inter-service communication, events or messages are likely used to coordinate interactions between services.
• Layered/Modular Approach: The project separates concerns clearly—common logic in packages, domain models in the model package, UI components in the ui package, and dedicated front-end projects (app and site).
• Containerization and CI/CD: Dockerfiles for each service and integrated GitHub workflows support continuous deployment and scalability.