How ernanesa/denguewatch works
DengueWatch is a .NET REST API for reporting and managing geolocated dengue cases, with JWT-protected mutations and MongoDB persistence. The main workflow is a client submitting HTTP requests: case requests are validated and handled by the cases controller and service, which stores GeoJSON-backed documents and returns case responses; login looks up a user and issues a JWT for subsequent authorized mutations. The API also provides development demo-user seeding, health checks, and Scalar/OpenAPI documentation. The README documents several capabilities beyond the sampled excerpts; edges for those are limited to documented relationships.
Main entry points: Program.cs ASP.NET API host · AuthController.cs Login route · CasesService.cs Case service · TokenService.cs JWT issuance
Components 22
API runtime
- ASP.NET API host
api/Program.cs - Case routes
api/Controllers/CasesController.cs - Login route
api/Controllers/AuthController.cs
Case reporting
- Case request DTOs
api/DTOs/Cases - Case service
api/Services/CasesService.cs - Case document
api/Data/Documents/CaseDocument.cs - Case response
api/DTOs/Cases/CaseResponse.cs - MongoDB
Authentication
- Login request
api/DTOs/Auth/LoginRequest.cs - User lookup
api/Services/UsersService.cs - User document
api/Data/Documents/UserDocument.cs - Password hashing
api/Program.cs - JWT issuance
api/Services/TokenService.cs - Login response
api/DTOs/Auth/LoginResponse.cs - JWT validation
api/Program.cs - Demo user seeder
api/Services/DevUserSeeder.cs
Configuration and docs
- Mongo settings
api/Configuration/MongoSettings.cs - JWT settings
api/Configuration/JwtSettings.cs - Demo-user settings
api/Configuration/DemoUserSettings.cs - Scalar and OpenAPI
api/Program.cs - Health endpoint
api/Program.cs
Other components
- Client
Connections 26
- Client → ASP.NET API host: sends HTTP
README.md - ASP.NET API host → Case routes: maps routes
api/Program.cs - ASP.NET API host → Login route: maps routes
api/Program.cs - Case routes → Case service: calls service
README.md - Case routes → Case request DTOs: binds requests
api/Controllers/CasesController.cs - Case service → Case document: maps documents
api/Services/CasesService.cs - Case service → MongoDB: reads and writes
api/Services/CasesService.cs - Case service → Case response: returns responses
api/Services/CasesService.cs - Login route → Login request: accepts credentials
api/Controllers/AuthController.cs - Login route → User lookup: looks up user
api/Controllers/AuthController.cs - Login route → JWT issuance: requests token
api/Controllers/AuthController.cs - User lookup → User document: returns user
api/Services/UsersService.cs - JWT issuance → User document: uses claims
api/Services/TokenService.cs - JWT issuance → JWT settings: reads settings
api/Services/TokenService.cs - JWT issuance → Login response: returns token
api/Services/TokenService.cs - ASP.NET API host → JWT validation: configures middleware
api/Program.cs - ASP.NET API host → Password hashing: registers hasher
api/Program.cs - ASP.NET API host → Demo user seeder: runs when enabled
api/Program.cs - Demo user seeder → User document: seeds user
api/Services/DevUserSeeder.cs - ASP.NET API host → Mongo settings: binds options
api/Program.cs - ASP.NET API host → JWT settings: binds options
api/Program.cs - ASP.NET API host → Demo-user settings: binds options
api/Program.cs - ASP.NET API host → MongoDB: connects database
api/Program.cs - ASP.NET API host → Scalar and OpenAPI: maps in development
api/Program.cs - Client → Scalar and OpenAPI: browses docs
README.md - ASP.NET API host → Health endpoint: maps endpoint
api/Program.cs