How mreckah/digitalbanking-front works
Project type and purpose
• This is a frontend application (DigitalBank-front) built with Angular 17, enhanced with Angular Universal for server-side rendering (SSR).
• Its purpose is to provide a responsive web UI for customer and account management, and to interact with a Spring Boot REST API (E-Bank backend) over HTTP, using JWT for authentication.
File structure
• Top-level files:
• angular.json, tsconfig*.json – Angular CLI configuration
• server.ts, main.server.ts – Node/Express SSR entry points
• main.ts – client bundle entry point
• src/app:
• app.module.ts, app.routes.ts / app.routes.server.ts – root NgModule and routing definitions (client/server)
• app.config.ts / app.config.server.ts – environment/config abstractions (client vs. SSR)
• feature folders: accounts/, customers/, customer-account/, navbar/, etc. – component sets for each screen/feature
• services/ – injectable wrappers around HttpClient: accounts.service.ts, customer.service.ts
• model/ – TypeScript interfaces/classes: customer.model.ts, account.model.ts
• public or assets/images – static assets served at runtime
README for additional insights
• Confirms Angular 17, Bootstrap 5, RxJS, HttpClient, Reactive Forms.
• Explains features: customer and account CRUD, transactions, JWT-based login.
• Specifies that the backend is a separate Spring Boot service at http://localhost:8080.
Main components & their interactions
a. Browser Client (SPA + Hydration)
• Loads index.html → Angular bootstraps (main.ts) → client-side router/app module.
• After first load (SSR), Angular hydrates the DOM for interactivity.
b. Node/Express SSR Server
• server.ts runs an Express server.
• Uses main.server bundle to render Angular templates on the server (Universal).
• Serves pre-rendered HTML to the browser for first-paint performance and SEO.
c. Angular Application Layers
• Angular Modules: AppModule (root), feature modules implicitly grouped by folder.
• Components: accounts.component, customers.component, navbar.component, etc.
• Services: AccountsService, CustomerService call external API.
• Routing: app.routes.ts (defines /customers, /accounts, /login, etc.).
• Configuration: app.config.ts picks API URL and other flags depending on environment.
d. External Systems
• E-Bank Backend (Spring Boot REST API)
• Exposes endpoints for /customers, /accounts, /transactions, /auth.
• Authentication Flow
• LoginComponent posts credentials → backend returns JWT → stored in browser (localStorage).
• Services attach JWT in HTTP Authorization header for subsequent calls.
Architectural patterns & design principles
• Component-Based UI: each feature (customers, accounts) encapsulated in its own folder with view, styles, tests.
• Service Layer: single-responsibility HttpClient wrappers for domain operations.
• Model Layer: strictly typed DTOs for data consistency.
• Separation of Concerns: UI vs. data vs. config vs. routing vs. SSR.
• Universal Rendering: server-side pre-rendering for performance/SEO.