How driveflow-crm/driveflow-crm-api works
Project type and purpose
• DriveFlow-CRM-API is a .NET 8.0 web application exposing a REST-style API (via Controllers) and a minimal UI (via Razor Identity pages). It serves as the backend for a Customer Relationship Management system, handling user authentication/authorization, CRUD operations on domain entities (AutoSchool, Instructor, Student, Vehicle, etc.), and integrates with external services (e.g., InvoiceService).
File structure
• Top-level folders:
• Areas/Identity + Pages/Shared + wwwroot → built-in ASP.NET Identity UI and static assets
• Controllers/ → REST controllers
• Models/ → EF Core entity definitions & DbContext
• Migrations/ → EF Core migrations
• Json/ → JSON serialization contexts
• Auth/, ITokenGenerator, JwtAccessTokenGenerator, RefreshTokenService, TokenGeneratorFactory → authentication & JWT workflow
• DriveFlow.Tests/ → integration/unit tests for models and token generators
• Dockerfile, heroku.yml → containerization and Heroku deployment
• Build & configuration: DriveFlow-CRM-API.csproj, appsettings.json, launchSettings.json
Key insights from README
• Clean, maintainable layering with EF Core for data access
• Swagger/OpenAPI for documentation
• JawsDB MySQL (cloud) as persistent store
• Environment variables for secrets, invoice service endpoint
Diagramming recommendations
• From Clients to API Host (HTTP request)
• From API Host to Identity/Authentication subsystem
• From Controllers to Services to DbContext to Database
• From Controllers to External InvoiceService
• In-host components (API + Identity + Services)
• External components (MySQL, InvoiceService)
• Protocols (HTTP, HTTPS, JWT tokens) and data formats (JSON)
Detail and component count
• Don’t skip low-level building blocks: include JSON serialization contexts, TokenGeneratorFactory, RefreshTokenService, DbContextFactory
• EF Core migrations as part of the data-persistence lifecycle
• Test suite as a separate artifact verifying model and token logic (optional)