How lucsarruda/finance-challenge works
Project type and purpose
• This is a single‐page application (SPA) built with Angular (v14), FuseTheme, TailwindCSS and Material Design.
• It’s a front-end client that displays finance data (transactions) and is hosted on Firebase. During development it uses an in‐browser mock API (Fuse Mock API), while in production it talks to the external “Moki-Api” service.
File structure
• Top‐level config: angular.json, tsconfig.json, firebase.json, transloco.config.js, tailwind.config.js.
• Core Angular app under /src/app:
• core module (auth, config, user, navigation, transloco)
• layout module (common UI widgets and layout variants)
• feature modules (e.g., transactions)
• mock‐api module under /src/app/mock-api for local data simulation
• shared module for re‐usable components/pipes/services
• Fuse library under /src/@fuse: reusable UI components, directives, services, styles and the mock‐api infrastructure.
• Environments: /src/environments for prod/dev configuration.
Readme insights
• Confirms front-end focus, dev instructions (ng serve), build (ng build → dist), unit tests (Karma), and e2e tests.
• Live link on Firebase (finance-challenge.web.app).
a. Main components
1. Browser SPA (Angular app)
2. FuseTheme UI library (packaged within the Angular build)
3. Feature modules (e.g., Transactions)
4. Core services (Auth, Config, User, Navigation, i18n loader)
5. Shared utilities (pipes, validators)
6. Mock API interceptor & handler (dev only)
7. External Moki-Api backend (production)
8. Hosting environment: Firebase Hosting
b. Relationships & interactions
• User interacts with the Browser SPA UI → UI components dispatch calls to Angular services
• AuthInterceptor attaches tokens to outbound HTTP calls
• LoadingInterceptor displays a global spinner during HTTP operations
• MockApiInterceptor intercepts HTTP calls in dev → routes them to local mock-api request handlers
• In production HTTP calls go to the external Moki-Api endpoints
• Transloco loader pulls i18n JSON from /assets/i18n
• Firebase Hosting serves the compiled JS/CSS bundles plus static assets
c. Architectural patterns & design principles
• Modular architecture: “Core”, “Shared”, “Layout”, “Feature” modules
• Layered separation: UI components → services → data layer (API)
• Dependency injection via Angular DI
• Feature modules are lazy‐loaded via app.routing.ts (if applicable)
• Environment‐based configuration (environment.ts vs environment.prod.ts)
• Mock API as a test‐double pattern for dev
d. Key technologies/frameworks/libraries
• Angular 14, Angular Material, TailwindCSS, FuseTheme
• Transloco for i18n
• Fuse Mock API module
• Firebase Hosting and configuration (firebase.json, .firebaserc)
• Karma + Jasmine for unit tests