How eloaranha/dashboardfinanceiro works
Project Type and Purpose
• This is a full-stack ASP.NET Core MVC web application (“DashboardFinanceiro”) for managing and visualizing financial invoices (notas fiscais).
• It serves HTML/Razor views enriched with JavaScript on the front end, exposing controller endpoints on the back end, persisting data in a SQL Server database, and is containerized via Docker.
File Structure Analysis
• Top-level entry point and configuration:
• Program.cs (application bootstrap, middleware pipeline)
• appsettings.json / appsettings.Development.json (configuration)
• Dockerfile, docker-compose.yml (container definitions)
• MVC layers:
• Controllers/ (HomeController, NotasFiscaisController)
• Models/ (NotaFiscal, ErrorViewModel, and possibly DashboardData)
• Views/ (Razor pages under Views/Home and shared layout/views under Views/Shared)
• Static assets in wwwroot/ (css, js, images, lib with Bootstrap and jQuery)
• Data and service abstractions (as referenced in README):
• Data/FinanceiroDbContext.cs (EF Core DbContext)
• Services/INotasFiscaisService.cs, NotasFiscaisService.cs
Extracted Architecture Patterns
• MVC pattern separating View (Razor + static assets), Controller (HTTP endpoints), Model (domain entities).
• Layered architecture:
• Presentation layer (Views + client-side JS)
• Application/API layer (Controllers)
• Business logic layer (Services via dependency injection)
• Data access layer (EF Core DbContext communicating with SQL Server)
• Dependency Injection throughout (built into ASP.NET Core).
• Containerized deployment (Docker, Compose).
Main Components
a. Client Browser (HTML, CSS, JavaScript, Razor-rendered pages)
b. ASP.NET Core Web Application
– Program.cs hosting Kestrel
– Controllers (HomeController, NotasFiscaisController)
– Services (INotasFiscaisService, NotasFiscaisService)
– Data Access (FinanceiroDbContext using EF Core)
c. Database Server (SQL Server)
d. Infrastructure / Deployment
– Docker container image running the .NET app
– Docker-Compose orchestrating multi-container (app + database)
Relationships and Data Flows
• Browser → HTTP(S) → Kestrel server (Program.cs)
• Kestrel → Controller action → (via DI) Service → DbContext → SQL Server
• Controller returns ViewResult (HTML) or JSON (for API endpoints)
• Static files (wwwroot) served directly by Kestrel
• Docker Compose links the app container with the database container
Capturing Essential Elements
• Cross-cutting concerns injected via Program.cs (logging, configuration).
• Static asset pipeline (wwwroot → delivered by Kestrel).
• Docker Compose networks between “DashboardFinanceiro” container and “SQL Server” container.