How wizard-aka-aman/society_management_frontend works
Project Type and Purpose
• Project Type: Single-Page Application (SPA) built with Angular CLI (v19).
• Purpose: A society/ apartment management front-end interface that allows admins and users to register, log in, manage societies, flats, visitors, bookings, bills, complaints, notices, recurring payments, etc.
File Structure
Top-level:
├─ src/
├─ app/
├─ Components (one folder per feature: add-society, bills, bookings, cancel, complaints, flats, home, layout, login, manage-users, notices, pagenotfound, recurring, register, register-admin, society-setting, spinner, success, visitors)
├─ app.config.ts (global configuration e.g. API base-URL)
├─ app.routes.ts (route definitions)
├─ auth.guard.ts (route guard for protected routes)
├─ spinner.interceptor.ts (HTTP interceptor for showing spinner)
├─ services/ (service.service.ts: HTTP client wrapper)
├─ styles.css & index.html & main.ts (bootstrap)
Configuration files: angular.json, tsconfig*.json, ngsw-config.json (service worker), package.json.
README for Additional Insights
• Generated via Angular CLI—no backend included in repo (expects external API).
• Uses default Angular dev and build commands.
• PWA support (ngsw-config.json + manifest.webmanifest).
Main Components & Interactions
a. Presentation Layer (UI Components)
• Login & Registration flows (login.component, register.component, register-admin.component)
• Dashboard layout (layout.component) with child routes: home, add-society, manage-users, society-setting, flats, visitors, bookings, bills, recurring, complaints, notices, cancel, success.
• Shared spinner component (spinner.component) displayed via spinner.interceptor on each HTTP call.
b. Services Layer
• ServiceService (singleton): encapsulates all HTTP calls to external REST API (CRUD for societies, users, flats, etc.)
• AuthGuard: protects routes based on login status.
• SpinnerInterceptor: intercepts HTTP requests to toggle spinner visibility.
c. Configuration & Bootstrap
• AppConfig: holds constants (e.g., API URLs).
• AppRoutes: defines route hierarchy and lazy-load (if applied).
• main.ts & index.html: Angular bootstrapping.
d. External Dependencies
• External REST API (not in repo)
• Browser (running Angular PWA)
• Service Worker (ngsw-config.json) for offline caching
• Third-party libraries from package.json (e.g., Angular Material, if present).
Architectural Patterns & Design Principles
• Layered Architecture: Presentation → Services → External API.
• Component-Based Design: each feature as an Angular component.
• Dependency Injection: Angular’s DI for services and interceptors.
• Route-Based Module Organization: feature folders map to routes.
• PWA Pattern: service worker + manifest for offline support.
– Middle layer: Components grouped by domain (Authentication, Dashboard features, Shared spinner)
– Lower layer: Services (ServiceService), Guards, Interceptors, Config.