How masoudbimar/communere-challenge works
Project type and purpose
• This is a single-page, full-stack front-end application built with Angular (v19).
• Purpose: a Medication Tracker Website that lets users list, view, and manage medications, relying on browser storage.
File structure
• Top-level:
• angular.json, tsconfig*.json, package.json → Angular CLI config & build.
• public/ → static assets.
• src/ → application source.
• src/app/ sub-folders:
• app.component, app.routes, app.config → root module, routing, global configs.
• pages/ → “medication-list” and “medication” page components.
• modal/ → reusable ModalComponent.
• services/ → MedicationService (business logic + data CRUD), ModalService (modal control), StorageService (wraps browser localStorage).
• model/ → data model (Medification model).
• pipe/ → FrequencyPipe for display formatting.
• validators/ → DuplicateTimeValidator for form validation.
• Configuration for testing: *.spec.ts, tsconfig.spec.json, eslint.config.js.
Insights from the README
• Standard Angular CLI project: ng serve, ng build, ng test, ng e2e.
• No backend server—uses browser APIs for persistence.
• Heavy reliance on Angular’s component-service pattern.
a. Main components
• Browser (Host)
• Angular Shell (index.html → main.ts → AppModule)
• UI Layer (AppComponent → RouterOutlet → Page Components + ModalComponent)
• Service Layer (MedicationService, ModalService, StorageService)
• Data Layer (LocalStorage API via StorageService)
• Utilities (FrequencyPipe, DuplicateTimeValidator)
b. Relationships & interactions
1. Browser loads index.html → boots main.ts → instantiates AppModule.
2. AppComponent contains <router-outlet>. Routes (app.routes.ts) map to MedicationListComponent or MedicationComponent.
3. Page Components inject MedicationService to perform CRUD operations.
4. MedicationService delegates persistence to StorageService (reads/writes LocalStorage).
5. ModalService controls display of ModalComponent (via a shared service/event bus).
6. UI templates use FrequencyPipe to format repeat frequencies; Reactive Forms use DuplicateTimeValidator to enforce unique times.
c. Architectural patterns/design principles
• Component-Based UI
• Dependency Injection for services
• Single Source of Truth in services
• Separation of Concerns: UI vs business logic vs data access vs utilities
d. Key technologies/frameworks/libraries
• Angular Framework (Modules, Components, Directives, Pipes, Validators)
• RxJS (Observables for async flows inside services, if used)
• Browser LocalStorage API (wrapped by StorageService)