How sisovin/pern-stack-banking-system works
Main Components
• Frontend: The React application (using Vite, Material-UI, Tailwind CSS, Redux for state management, and internationalization support). This side handles all the UI concerns and client-side logic.
• Backend: The Express API (written in TypeScript) that contains:
• Configuration files (database, JWT, logging, environment variables).
• Controllers (for authentication, accounts, customers, transactions, reporting, etc.).
• Routes which define the REST API endpoints.
• Middleware for authentication, session management, RBAC, error handling, and audit logging.
• Models representing business entities (such as User, Account, Transaction, etc.).
• Services that implement business logic like auth, account, transaction, etc.
• Utility modules and TypeScript types.
• Database: PostgreSQL along with Drizzle ORM which is used in migrations, schema definitions, and seeding data.
• Shared Types: A separate directory for shared interfaces and enums that are used across both backend and frontend. This promotes consistency in data handling.
Relationships and Flows
• Backend Internal Interactions: Within the backend, illustrate layers such as:
• Routes leading to Controllers,
• Controllers invoking Services,
• Services interacting with Models and the Database.
• Database Interactions: Clearly show that the backend connects to a PostgreSQL database, mediated by ORM components.
• External Services/Integrations (if applicable): If any external payment gateways or external APIs are used (although not explicitly mentioned, a banking system might extend in that direction), include them as separate components interacting with the backend.
Architectural Patterns and Design Principles
• Layered Architecture: Emphasize separation of concerns between the presentation/UI (frontend), business logic (backend controllers and services), and data persistence (database).
• Modular/Domain-Driven Organization: The backend uses domain-driven separation (e.g., separate directories for authentication, user management, accounts, transactions, and reporting) which should be captured by grouping related components.
• Security & Authentication: Include dedicated elements for JWT-based authentication and role-based access control (RBAC) to illustrate secure communication.
• Utilize Code Quality Tools: Tools like ESLint, Prettier, and the testing layers (unit, integration, e2e tests) could be noted as supporting components for development and CI/CD (shown at the periphery rather than being central in the runtime architecture).