- Descripción
- Objetivo del sistema
- Problema que resuelve
- Tecnologías
- Funcionalidades
- Arquitectura
- Estructura de carpetas
- Capturas
- Requisitos previos
- Configuración del entorno
- Ejecución desde Visual Studio 2022
- Usuario de prueba
- Base de datos
- Decisiones técnicas
- Checklist de pruebas
- Errores comunes
- Mejoras futuras
- Autor
- Licencia
ClientReport Manager es una aplicación web administrativa desarrollada con ASP.NET Core MVC, C#, Entity Framework Core y SQL Server.
Centraliza la información de clientes, permite administrar registros, consultar datos con filtros, ver métricas en un dashboard y generar reportes exportables a CSV.
Nació como práctica integral de desarrollo web con .NET y aplica: arquitectura MVC, programación orientada a objetos, Entity Framework Core, servicios e interfaces, inyección de dependencias, ViewModels, validaciones, autenticación básica y exportación de datos.
Ofrecer un sistema web que permita gestionar clientes y generar reportes administrativos de forma centralizada, reduciendo la dependencia de hojas de cálculo y documentos sueltos. El usuario administrativo puede registrar clientes, consultar información, filtrar, ver métricas, generar reportes y exportar resultados desde una interfaz clara.
En muchas pymes la información de clientes vive en Excel, correos y documentos compartidos, lo que provoca duplicidad, pérdida de datos, búsquedas lentas, falta de reportes y poca trazabilidad. ClientReport Manager propone una base de datos relacional con una interfaz web para consultar y reportar.
| Área | Tecnología |
|---|---|
| Backend | ASP.NET Core MVC |
| Lenguaje | C# |
| Base de datos | SQL Server |
| ORM | Entity Framework Core |
| Frontend | HTML, CSS, JavaScript |
| Framework UI | Bootstrap |
| Autenticación | Cookies de ASP.NET Core |
| Contraseñas | PasswordHasher |
| IDE recomendado | Visual Studio 2022 |
| Exportación | CSV compatible con Excel |
Autenticación
- Inicio y cierre de sesión.
- Cookies de autenticación y controladores protegidos con
[Authorize]. - Redirección automática al login si no hay sesión.
- Contraseñas gestionadas con
PasswordHasher.
Gestión de clientes
- Registrar, editar y consultar el detalle de un cliente.
- Buscar por texto y filtrar por estado y por tipo.
- Validar identificación duplicada.
- Desactivación lógica: el registro se conserva para reportes y trazabilidad.
Dashboard
- Total de clientes, activos, inactivos y potenciales.
- Clientes registrados en el mes actual.
- Últimos clientes registrados.
- Resumen por estado y por tipo.
Reportes administrativos
- Filtros combinados: fecha de inicio, fecha final, estado, tipo y búsqueda por texto.
- Total de clientes encontrados, resúmenes y tabla detallada.
- Exportación CSV.
Exportación CSV
- Respeta los filtros aplicados.
- Separador
;para mejor compatibilidad con Excel en español. - Escapa comillas, puntos y coma y saltos de línea.
- Se genera al vuelo, sin guardar el archivo en el servidor.
Experiencia de usuario
Sidebar, topbar con el usuario autenticado, tarjetas de métricas, tablas limpias, formularios ordenados, badges de estado, mensajes de éxito, confirmaciones y diseño responsive básico.
Controller → Service → DbContext → Database
View ← ViewModel ← Service
| Capa | Responsabilidad |
|---|---|
| Controllers | Reciben solicitudes y devuelven vistas |
| Services | Lógica de negocio y consultas |
| Models | Entidades del sistema |
| ViewModels | Datos específicos para las vistas |
| Data | DbContext y configuración de base de datos |
| Views | Interfaz de usuario |
| wwwroot | CSS, JavaScript e imágenes |
ClientReportManager/
├── Controllers/
│ ├── AccountController.cs
│ ├── ClientesController.cs
│ ├── DashboardController.cs
│ └── ReportesController.cs
├── Data/
│ └── ApplicationDbContext.cs
├── Models/
│ ├── Cliente.cs
│ ├── EstadoCliente.cs
│ ├── TipoCliente.cs
│ └── Usuario.cs
├── Services/
│ ├── IClienteService.cs / ClienteService.cs
│ ├── IDashboardService.cs / DashboardService.cs
│ ├── IReporteService.cs / ReporteService.cs
│ └── IUsuarioService.cs / UsuarioService.cs
├── ViewModels/
│ ├── ClienteFiltroViewModel.cs
│ ├── DashboardViewModel.cs
│ ├── LoginViewModel.cs
│ └── ReporteClientesViewModel.cs
├── Views/
│ ├── Account/ Clientes/ Dashboard/ Reportes/ Shared/
├── wwwroot/
│ ├── css/ js/ lib/
├── docs/screenshots/
├── appsettings.json
├── Program.cs
├── ClientReportManager.csproj
├── .gitignore
└── README.md
Las capturas viven en docs/screenshots/:
01-login.png 05-editar-cliente.png
02-dashboard.png 06-reportes.png
03-clientes.png 07-exportacion-csv.png
04-nuevo-cliente.png
- Visual Studio 2022.
- .NET 8 SDK.
- SQL Server (y opcionalmente SQL Server Management Studio).
- Git.
- Herramientas de Entity Framework Core.
1. Clonar y entrar
git clone https://github.com/alberto2005-coder/ClientReportManager.git
cd ClientReportManager2. Restaurar paquetes
dotnet restore3. Revisar la cadena de conexión en appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Database=ClientReportManagerDb;Trusted_Connection=True;TrustServerCertificate=True;"
}
}Con SQL Server Express:
"DefaultConnection": "Server=localhost\\SQLEXPRESS;Database=ClientReportManagerDb;Trusted_Connection=True;TrustServerCertificate=True;"Con usuario SQL:
"DefaultConnection": "Server=localhost;Database=ClientReportManagerDb;User Id=sa;Password=TuClave;TrustServerCertificate=True;"No subas credenciales reales al repositorio.
4. Instalar las herramientas de EF Core
dotnet tool install --global dotnet-ef
# o, si ya están instaladas
dotnet tool update --global dotnet-ef
dotnet ef5. Aplicar migraciones
dotnet ef database updateEsto crea ClientReportManagerDb y sus tablas.
6. Compilar
dotnet build7. Ejecutar
dotnet runAbre la URL que muestre la consola (https://localhost:5001 o http://localhost:5000).
- Open a project or solution →
ClientReportManager.sln. - Verifica la cadena de conexión en
appsettings.json. - Tools → NuGet Package Manager → Package Manager Console.
- Ejecuta
Update-Database. - Arranca con
Ctrl + F5.
Usuario: admin
Contraseña: 123456
Tras el primer inicio de sesión, la contraseña se guarda en formato hash con PasswordHasher.
Cambia estas credenciales antes de desplegar en cualquier entorno real.
SQL Server con Entity Framework Core en enfoque Code First. Tablas principales: Clientes, EstadosCliente, TiposCliente y Usuarios.
Clientes: IdCliente, NombreCompleto, Identificacion, Correo, Telefono, Empresa, IdTipoCliente, IdEstadoCliente, FechaRegistro, Observaciones.
EstadosCliente: Activo, Inactivo, Potencial.
TiposCliente: Individual, Empresa, Proveedor, Corporativo.
Usuarios: usuario inicial admin / 123456.
-
MVC para separar modelo, vista y controlador.
-
Servicios (
ClienteService,DashboardService,ReporteService,UsuarioService) para que los controladores no acumulen lógica. -
Interfaces para desacoplar controladores de implementaciones:
public interface IClienteService { Task<ClienteFiltroViewModel> ObtenerClientesAsync( string? buscar, int? idEstadoCliente, int? idTipoCliente); }
-
Inyección de dependencias registrada en
Program.cs:builder.Services.AddScoped<IClienteService, ClienteService>(); builder.Services.AddScoped<IDashboardService, DashboardService>(); builder.Services.AddScoped<IReporteService, ReporteService>(); builder.Services.AddScoped<IUsuarioService, UsuarioService>();
-
Desactivación lógica en lugar de borrado físico.
-
Fecha final exclusiva en los reportes:
var finExclusivo = fechaFin.Value.Date.AddDays(1); query = query.Where(c => c.FechaRegistro < finExclusivo);
-
CSV con
;y escape de comillas, separadores y saltos de línea. -
Cookies +
[Authorize]yPasswordHasherpara no guardar contraseñas en claro.
| Área | Prueba | Resultado esperado |
|---|---|---|
| Auth | Login correcto | Acceso al dashboard |
| Auth | Contraseña incorrecta | Mensaje genérico de error |
| Auth | /Clientes sin sesión |
Redirección al login |
| Auth | Cerrar sesión | Redirección al login |
| Clientes | Registro válido | Cliente guardado |
| Clientes | Sin nombre / sin identificación | Validación visible |
| Clientes | Identificación duplicada | Error |
| Clientes | Editar / desactivar | Datos actualizados / estado inactivo |
| Clientes | Buscar y filtrar | Coincidencias correctas |
| Dashboard | Contadores | Coinciden con la base de datos |
| Dashboard | Últimos clientes | Muestra los recientes |
| Reportes | Sin filtros | Todos los clientes |
| Reportes | Filtros de fecha, estado y tipo | Respeta la selección |
| Reportes | Fecha inicial > fecha final | Error |
| Reportes | Exportar CSV (con y sin filtros) | Descarga correcta |
- No conecta a SQL Server: comprueba que el servicio esté iniciado y la cadena de conexión sea correcta.
- Fallo al migrar: instala
dotnet-efy verifica quedotnet buildpase. - Aviso de certificado HTTPS:
dotnet dev-certs https --trust. - No aparece la base de datos: vuelve a ejecutar
dotnet ef database update. adminno entra: confirma que la migración insertó el usuario y revisa la tablaUsuarios.
Roles y permisos, auditoría de acciones, paginación y ordenamiento en tablas, exportación a Excel y PDF, gráficos con Chart.js, pruebas unitarias, logs de errores, despliegue en Azure App Service, API REST, separación frontend/backend, recuperación de contraseña, migración a ASP.NET Core Identity, modo oscuro e historial de cambios por cliente.
Práctica profesional de desarrollo web con .NET centrada en sistemas administrativos, reportes, seguridad básica, arquitectura MVC y experiencia de usuario. Proyecto funcional en versión inicial: login, dashboard, gestión de clientes, reportes, exportación CSV, validaciones e interfaz administrativa.
MIT License © 2026 Alberto Ortiz Sánchez (@alberto2005-coder). Puedes usar, copiar, modificar y redistribuir el código conservando la atribución original. Consulta LICENSE y los avisos de dependencias de terceros en NOTICE.md.
- Overview
- Goal
- Problem it solves
- Tech stack
- Features
- Architecture
- Folder structure
- Screenshots
- Prerequisites
- Local setup
- Running from Visual Studio 2022
- Test user
- Database
- Technical decisions
- Test checklist
- Common errors
- Future improvements
- Author
- License
ClientReport Manager is an administrative web app built with ASP.NET Core MVC, C#, Entity Framework Core and SQL Server.
It centralizes client information, lets you manage records, query data with filters, view metrics on a dashboard and generate reports exportable to CSV.
It started as an end-to-end .NET web development exercise and applies: MVC architecture, object-oriented programming, Entity Framework Core, services and interfaces, dependency injection, ViewModels, validation, basic authentication and data export.
Provide a web system to manage clients and produce administrative reports in a central place, reducing reliance on spreadsheets and scattered documents. An administrative user can register clients, look up information, filter, read metrics, generate reports and export results from a clear interface.
In many small and mid-sized companies, client data lives in Excel, email and shared documents, causing duplicates, lost records, slow searches, missing reports and poor traceability. ClientReport Manager proposes a relational database behind a web interface for querying and reporting.
| Area | Technology |
|---|---|
| Backend | ASP.NET Core MVC |
| Language | C# |
| Database | SQL Server |
| ORM | Entity Framework Core |
| Frontend | HTML, CSS, JavaScript |
| UI framework | Bootstrap |
| Authentication | ASP.NET Core cookies |
| Passwords | PasswordHasher |
| Recommended IDE | Visual Studio 2022 |
| Export | Excel-friendly CSV |
Authentication
- Sign in and sign out.
- Cookie authentication and
[Authorize]-protected controllers. - Automatic redirect to login when there is no session.
- Passwords handled with
PasswordHasher.
Client management
- Create, edit and inspect a client's details.
- Text search plus filters by status and type.
- Duplicate identification validation.
- Soft delete: records are kept for reporting and traceability.
Dashboard
- Total, active, inactive and prospective clients.
- Clients registered in the current month.
- Most recent clients.
- Breakdown by status and by type.
Administrative reports
- Combined filters: start date, end date, status, type and text search.
- Total matches, summaries and a detailed table.
- CSV export.
CSV export
- Honors the filters the user applied.
- Uses
;as separator for better Spanish-locale Excel compatibility. - Escapes quotes, semicolons and line breaks.
- Streamed directly, never written to the server disk.
User experience
Sidebar, topbar with the signed-in user, metric cards, clean tables, tidy forms, status badges, success messages, confirmations and a basic responsive layout.
Controller → Service → DbContext → Database
View ← ViewModel ← Service
| Layer | Responsibility |
|---|---|
| Controllers | Take requests and return views |
| Services | Business logic and main queries |
| Models | System entities |
| ViewModels | View-specific data |
| Data | DbContext and database configuration |
| Views | User interface |
| wwwroot | CSS, JavaScript and images |
ClientReportManager/
├── Controllers/
│ ├── AccountController.cs
│ ├── ClientesController.cs
│ ├── DashboardController.cs
│ └── ReportesController.cs
├── Data/
│ └── ApplicationDbContext.cs
├── Models/
│ ├── Cliente.cs
│ ├── EstadoCliente.cs
│ ├── TipoCliente.cs
│ └── Usuario.cs
├── Services/
│ ├── IClienteService.cs / ClienteService.cs
│ ├── IDashboardService.cs / DashboardService.cs
│ ├── IReporteService.cs / ReporteService.cs
│ └── IUsuarioService.cs / UsuarioService.cs
├── ViewModels/
│ ├── ClienteFiltroViewModel.cs
│ ├── DashboardViewModel.cs
│ ├── LoginViewModel.cs
│ └── ReporteClientesViewModel.cs
├── Views/
│ ├── Account/ Clientes/ Dashboard/ Reportes/ Shared/
├── wwwroot/
│ ├── css/ js/ lib/
├── docs/screenshots/
├── appsettings.json
├── Program.cs
├── ClientReportManager.csproj
├── .gitignore
└── README.md
Screenshots live in docs/screenshots/:
01-login.png 05-editar-cliente.png
02-dashboard.png 06-reportes.png
03-clientes.png 07-exportacion-csv.png
04-nuevo-cliente.png
- Visual Studio 2022.
- .NET 8 SDK.
- SQL Server (and optionally SQL Server Management Studio).
- Git.
- Entity Framework Core tools.
1. Clone and enter
git clone https://github.com/alberto2005-coder/ClientReportManager.git
cd ClientReportManager2. Restore packages
dotnet restore3. Check the connection string in appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Database=ClientReportManagerDb;Trusted_Connection=True;TrustServerCertificate=True;"
}
}With SQL Server Express:
"DefaultConnection": "Server=localhost\\SQLEXPRESS;Database=ClientReportManagerDb;Trusted_Connection=True;TrustServerCertificate=True;"With a SQL user:
"DefaultConnection": "Server=localhost;Database=ClientReportManagerDb;User Id=sa;Password=YourPassword;TrustServerCertificate=True;"Never commit real credentials.
4. Install the EF Core tools
dotnet tool install --global dotnet-ef
# or, if already installed
dotnet tool update --global dotnet-ef
dotnet ef5. Apply migrations
dotnet ef database updateThis creates ClientReportManagerDb and its tables.
6. Build
dotnet build7. Run
dotnet runOpen the URL printed by the console (https://localhost:5001 or http://localhost:5000).
- Open a project or solution →
ClientReportManager.sln. - Verify the connection string in
appsettings.json. - Tools → NuGet Package Manager → Package Manager Console.
- Run
Update-Database. - Start with
Ctrl + F5.
Username: admin
Password: 123456
After the first sign-in, the password is stored as a hash via PasswordHasher.
Change these credentials before deploying to any real environment.
SQL Server with Entity Framework Core using a Code First approach. Main tables: Clientes, EstadosCliente, TiposCliente and Usuarios.
Clientes: IdCliente, NombreCompleto, Identificacion, Correo, Telefono, Empresa, IdTipoCliente, IdEstadoCliente, FechaRegistro, Observaciones.
EstadosCliente: Activo, Inactivo, Potencial.
TiposCliente: Individual, Empresa, Proveedor, Corporativo.
Usuarios: seed user admin / 123456.
-
MVC to separate model, view and controller.
-
Services (
ClienteService,DashboardService,ReporteService,UsuarioService) so controllers stay thin. -
Interfaces to decouple controllers from implementations:
public interface IClienteService { Task<ClienteFiltroViewModel> ObtenerClientesAsync( string? buscar, int? idEstadoCliente, int? idTipoCliente); }
-
Dependency injection registered in
Program.cs:builder.Services.AddScoped<IClienteService, ClienteService>(); builder.Services.AddScoped<IDashboardService, DashboardService>(); builder.Services.AddScoped<IReporteService, ReporteService>(); builder.Services.AddScoped<IUsuarioService, UsuarioService>();
-
Soft delete instead of physical deletion.
-
Exclusive end date in reports:
var endExclusive = endDate.Value.Date.AddDays(1); query = query.Where(c => c.FechaRegistro < endExclusive);
-
CSV with
;and escaping of quotes, separators and line breaks. -
Cookies +
[Authorize]andPasswordHasherso no plaintext passwords are stored.
| Area | Test | Expected result |
|---|---|---|
| Auth | Correct login | Dashboard access |
| Auth | Wrong password | Generic error message |
| Auth | /Clientes without a session |
Redirect to login |
| Auth | Sign out | Redirect to login |
| Clients | Valid registration | Client saved |
| Clients | Missing name / identification | Validation shown |
| Clients | Duplicate identification | Error |
| Clients | Edit / deactivate | Data updated / status inactive |
| Clients | Search and filter | Correct matches |
| Dashboard | Counters | Match the database |
| Dashboard | Latest clients | Shows recent ones |
| Reports | No filters | All clients |
| Reports | Date, status and type filters | Selection honored |
| Reports | Start date > end date | Error |
| Reports | Export CSV (with and without filters) | Correct download |
- Cannot connect to SQL Server: check the service is running and the connection string is correct.
- Migration failure: install
dotnet-efand make suredotnet buildsucceeds. - HTTPS certificate warning:
dotnet dev-certs https --trust. - Database not created: re-run
dotnet ef database update. admincannot sign in: confirm the migration seeded the user and inspect theUsuariostable.
Roles and permissions, action auditing, pagination and dynamic sorting, real Excel and PDF export, Chart.js charts, unit tests, error logging, Azure App Service deployment, a REST API, frontend/backend split, password recovery, migration to ASP.NET Core Identity, dark mode and per-client change history.
A professional .NET web development exercise focused on administrative systems, reporting, basic security, MVC architecture and user experience. Functional initial version: login, dashboard, client management, reports, CSV export, validations and an administrative UI.
MIT License © 2026 Alberto Ortiz Sánchez (@alberto2005-coder). You may use, copy, modify and redistribute the code as long as the original attribution is preserved. See LICENSE and the third-party dependency notices in NOTICE.md.






