How lkodex/app-coifa works
Main Components
• API Gateway – The entry point that routes incoming requests to the appropriate microservice.
• Auth/Users Service – Responsible for managing authentication and user details (using Keycloak or similar).
• Financial Microservice – The only fully implemented microservice at this time; it handles credit (and potentially debit) operations, and interacts with the database via Prisma.
• Subscription Microservice – Planned service, handling subscription functionalities.
• Message Broker – A central component for event-driven communication between microservices.
• Notifications Service – Handles the delivery of messages/alerts based on event updates from the message broker.
• Shared configurations – For instance, the “eslint-config-typescript” package which standardizes linting across all packages.
Project Structure to Determine Component Boundaries
• The “packages” directory contains all microservices and shared packages. Each microservice (and configuration package) has its own directory with configuration files (e.g., .env, tsconfig.json, Jest configuration) and source code (src folder) which helps define its internal architecture.
• Within the “financial-service” package, note the clear separation of concerns: files for the application entry (app.ts, index.ts), business logic (controller.ts, service.ts), routing (route.ts), and context management (context.ts). This illustrates an MVC or layered pattern internally.
Relationships and Interactions
• From the API Gateway, show routes (with labeled endpoints like “/auth”, “/financial”, “/subscription”) to each respective microservice.
• Specifically connect the Financial service to the Message Broker to denote event publishing, and then from the Message Broker to the Notifications service.
Architectural Patterns
• Service Oriented Architecture (SOA) – Microservices communicate via well-defined APIs and messaging channels.
• Separation of Concerns – The monorepo approach separates cross-cutting concerns (like ESLint configurations) from business logic.
• Layered Design within Microservices – For example, the Financial service exhibits distinct layers (controllers, services, routing) that interface with the underlying data model managed by Prisma.
• Use of TypeScript throughout the codebase facilitates strong typing and consistent code quality across services.
Incorporate Relevant Technologies
• Express & Prisma for the Financial service.
• TypeScript is the common language across the entire monorepo.
• Mention of Keycloak for authentication, though not implemented yet.
• Potential UI frameworks (React or Vue) for the front end.
• Tools for linting (the shared eslint-config-typescript package) applied across all packages.
• Testing frameworks (Jest, as seen in the financial-service package).