How rashidaltayeb/queue-system works
Project Type and Purpose
• This is a single‐page web application (SPA) built with Angular (CLI v13) that manages a patient queue for doctor visits.
• It uses Angular Material and Flex-Layout for UI, and json-server as a fake REST API layer backed by db.json.
Main Components
a. Frontend (Browser / Angular App)
• Angular Modules
• AppModule (root)
• MaterialComponentModule (imports Angular Material components)
• Angular Router
• Routes defined in app-routing.module.ts for Home, Patient, Ticket, Waiting
• UI Components
• HomeComponent
• PatientComponent (with NewPatientComponent and ViewPatientComponent)
• TicketComponent
• WaitingComponent
• SideNavComponent
• Services
• PatientService (handles CRUD via HTTP)
• Assets & Configuration
• src/assets/ (CSS, images, screenshots)
• Environment files (environment.ts, environment.prod.ts)
• Angular CLI config (angular.json, tsconfig.json)
b. Backend (Fake API)
• json-server
• Serves REST endpoints (e.g. GET/POST/PUT /patients)
• Data store: db.json
Relationships & Data Flow
1. User interacts with Angular UI in the browser.
2. Components invoke PatientService.
3. PatientService issues HTTP requests (GET/POST/PUT/DELETE) to json-server endpoints configured in environment.ts.
4. json-server reads/writes to db.json and returns JSON payloads.
5. Service returns observables to components, which update the view.
Architectural Patterns / Principles
• Client‐Server (clean separation of UI and API)
• SPA with Router controlling views
• Service layer abstracts HTTP and data operations
• Modular design (feature components, material module)
• Configurable environments for API URL