How federicomoron/expense-tracker-app works
Project Type & Purpose
• Spendly is a single-page, front-end web application (Angular 20) for tracking group and personal expenses.
• It integrates with external services (REST API backend, Google Authentication) and includes PWA capabilities (service worker, manifest).
High-Level Architectural Layers
a. Presentation Layer (Angular UI)
• Layouts: AppLayout, FullscreenLayout
• Feature Modules: Auth, Groups, Expenses, Account, Footer
• Shared UI Components: buttons, dialogs, selectors, pipes, theme toggles
b. Core Layer (Cross-Cutting Concerns)
• Services: HTTP, Auth, Group, Expense, User, SnackBar, Theme, I18n, PWA Install
• Interceptors: Auth-Token, Unauthorized
• Guards: AuthGuard, LoginGuard, GroupGuard
• Models & Constants
c. Infrastructure / External Integrations
• REST API endpoints (configured in api-endpoints.ts)
• Google Sign-In (OAuth provider)
• Browser storage (local/session via storage-keys.ts)
• PWA (ngsw-config.json, manifest.webmanifest)
d. Build & Deployment
• Angular CLI (angular.json, tsconfig.json)
• CI/CD (GitHub Actions ci.yml)
• Lint/format (ESLint, Prettier, Husky)
Main Components & Their Relationships
• User’s Browser (Chrome/Safari/Edge)
→ loads index.html → boots main.ts → instantiates root AppComponent
→ routing directs to AppLayout or FullscreenLayout
→ feature components render under layouts
• Feature Components
→ invoke Core Services via Angular DI
→ call HttpService → HTTP interceptors attach tokens → outbound requests to REST API
• Core Services
→ AuthService manages login/register via Google OAuth + backend token exchange
→ GroupService, ExpenseService wrap REST API calls
→ I18nService + Transloco load translations from assets/i18n
→ ThemeService toggles SCSS variables at runtime
• External Services
→ Backend REST API (CRUD for users, groups, expenses)
→ Google OAuth for authentication
• PWA Support
→ Service worker caches assets & API responses
→ PWAInstallService displays “install” prompt
Architectural Patterns & Design Principles
• Feature-Based Modularization: each domain (auth, groups, expenses) is its own folder with routes, components, services
• Clean Architecture: separation of concerns (core vs. shared vs. features)
• Dependency Injection: Angular DI for services, interceptors, guards
• Standalone Components & Angular Signals: modern Angular patterns for reusability & reactive state
• Cross-Cutting via Core Module: centralized handling of auth, HTTP, state management
Essential Details to Capture
• Module boundaries (core vs. shared vs. features)
• Cross-cutting interceptors & guards applied to HTTP & routes
• Data flow from user actions → components → services → API → back
• i18n asset loading (assets/i18n/*.json)
• Theme toggling via SCSS variables
• CI/CD badge & build scripts can be shown as side note (optional)
Final Checklist
• Clear labels for each layer and component
• Callouts for important configurations (e.g., ngsw-config.json, api-endpoints.ts)