How adityakumar1223/acadzone_frontend works
Project type and purpose
• This is a full-stack web application’s frontend built with Angular CLI (v20.1.0).
• It implements a single-page application (SPA) for an educational portal (“Acadzone”) with distinct user roles: Admin, Teacher, Student, plus authentication and shared UI.
File structure
• Top-level Angular configuration:
– angular.json, tsconfig*.json, package.json, README.md
– src/index.html, src/main.ts bootstraps the AppModule
• src/app: feature-module layout
– auth/ (login, registration components + auth.service, auth.routes.ts)
– admin/ (dashboard, manage-students, manage-teachers + admin.service, admin.routes.ts)
– teacher/ (dashboard, manage-attendance, books, exams + teacher.service, teacher.routes.ts)
– student/ (dashboard, view-attendance, books, exams + student.service, student.routes.ts)
– shared/ (header, footer, 404 component, models, api.service)
– app.ts (root component), app.routes.ts (root routing), app.config.ts (constants)
• Build/test tooling:
– Karma specs (.spec.ts), ng serve, ng build, ng test, ng e2e
README for additional insights
• Confirms use of Angular CLI, local dev on http://localhost:4200
• No backend code here; services call external REST APIs
a. Browser / User Interface
– Angular SPA running in user’s browser
– Root module (AppComponent) loads Feature Modules via Router
b. Feature Modules (inside SPA)
– AuthModule (login/register)
– AdminModule (admin dashboard, student & teacher management)
– TeacherModule (attendance, books, exam management)
– StudentModule (view attendance, books, exams)
– SharedModule (common header/footer, models, ApiService)
c. Services & Data Layer
– Each feature module injects its own Service (e.g., AdminService)
– Shared ApiService wraps HttpClient for REST calls
– auth.service handles JWT tokens and authorization headers
d. External Systems
– Backend REST API (CRUD endpoints for users, attendance, exams, books)
– Authentication server (issue/verify JWT tokens)
– Database (persist users, attendance, exam, book records)
Relationships and interactions
• SPA → ApiService: all HTTP requests pass through ApiService to backend
• FeatureService → ApiService: role-specific services enrich endpoints (e.g., /api/admin/)
• AuthService intercepts requests to attach JWT, redirects to login on 401
• Router navigates between feature modules based on user role guards
Architectural patterns and principles
• Modular design – each user role isolated in its Angular module
• Separation of concerns – UI components vs data services vs shared utilities
• Dependency injection – Angular’s DI for services & interceptors
• Observable-based data flow – RxJS streams for async HTTP calls
• Lazy loading – feature modules loaded on demand via routes (improves performance)