How sasha-pober/emergency-ms works
Project type and purpose
• emergency-ms is a full-stack, event-tracking application.
• Frontend: Angular web client for users to log in, view maps, and create/view emergencies.
• Backend: .NET Core Web API exposing REST endpoints to manage Emergency, Image, Type, Location, Source, Street entities.
• Persistence: Entity Framework Core with a relational database (via AppDbContext).
File structure and architectural patterns
• Top-level “backend” folder contains a single .NET solution (EmengencyMS.API.sln) subdivided into:
• Domain: business entities and repository interfaces
• Infrastructure: EF Core DbContext, database migrations, repository implementations
• Services (Abstractions & Implementations): business logic layer
• Presentation: Web API controllers, DTOs/mappings, Startup/Program
• “frontend/emergencyMS-web” is an Angular CLI project:
• Components, models, services, guards
• Uses HTTP requests to the backend API
• Architectural patterns:
• Layered (Presentation → Services → Infrastructure → Domain)
• Repository pattern (IEmergencyRepository etc.)
• Dependency Injection (via Startup.cs extension methods)
• DTO mapping between layers
Main components and their relationships
• User’s Browser/Angular App
• Components (Login, Main, Map, CreateEmergency, Dashboard)
• Angular Services (AuthService, EmergencyService, MapService, TypeService)
→ call
• Backend Web API
• Presentation Layer (Controllers)
→ inject →
• Service Layer (IEmergencyService, IImageService, ITypeService)
→ use →
• Infrastructure Layer
– Repositories (EmergencyRepository, ImageRepository, TypeRepository)
– AppDbContext (EF Core)
→ persists →
• Relational Database
• Static Assets (GeoJSON under wwwroot or in Angular assets)
Important architectural/design principles
• Separation of concerns (layers each with single responsibility)
• DI and inversion of control for loose coupling
• Repository + Unit of Work (EF Core) for data access
• DTOs and AutoMapper-style mapping to isolate domain from transport models
• Angular feature modules and route guards for UI segmentation & security