| Service | Pulls | Size | Version |
|---|---|---|---|
| API | |||
| User API | |||
| Web (Portal) |
A centralized error logging and monitoring API built with .NET 9, Entity Framework Core, and SQL Server. This project is designed to serve as a foundation for collecting, storing, and managing error logs from multiple applications. Phase 5,7&8 have also been complated and the pending Phase 6 will be developed in a new repository.
Each phase of development is preserved in its own branch, culminating in the final Integration Portal, which, together with the API projects, forms a Microservices-inspired architechture that demonstrates the Single Service Database Pattern.
A .NET 9 MVC Web App that unifies multiple APIs (User Management and Logging) into a single Integration Portal with role-based navigation.
-
Login & Validation
-
Custom login (no ASP.NET Core Identity).
-
Client-side validation with jQuery Validation + Bootstrap feedback.
-
Server-side validation ensures username/password check against database seeded users.
-
Bearer handler implemented that fetches token from Memory cache on every request
-
Areas implemented
-
-
Users & Roles (Alice / Bob)
-
User credentials (
alice/alice,bob/bob) seeded in DB/EF Core migration for demo. -
Alice (Admin) β sees Logs link enabled.
-
Bob (Operations) β restricted, no access to logs.
-
Role checks handled through claims in JWT.
-
JWT is stored in-memory cache
-
-
Serilog Logging (Web App)
-
Web App configured with Serilog file sinks (
/logs/dev-app-.log). -
Request Audibility and Exception handling middleware added in APIs
-
Structured logs include timestamp, environment, service name, correlation ID.
-
-
Error Logging API Integration
-
On invalid login β error posted to Error Logging API via secured HTTP client.
-
Uses Polly retry policy for resilience.
-
API persists errors to DB + local log file (from Phase 3).
-
-
Dynamic Sidebar Category Tree
-
After login β Web App queries User Management API for role/category/module/functions.
-
Sidebar navigation auto-adjust per user role.
-
-
Logs Link (Working Feature)
-
Clicking Logs fetches data from the Centralized Logging API (Phase 1).
-
Admin users can view structured logs with pagination (DataTables).
-
Non-admins only see authorized links.
-
-
Logout & Session Handling
-
Logout clears JWT/session cache.
-
User redirected back to login page.
-
Ensures secure re-authentication before accessing APIs again.
-
-
Testing & CI
-
xUnit unit test covers server-side validation.
-
a WebApplicationFactory-based integration test verifies the login happy path returns 200 OK.
-
-
Pipeline & Coverage
-
GitHub Actions runs unit tests on push/PR.
-
Collects LCOV via Coverlet.
-
CI/CD (GitHub Actions β Integration & Delivery), Latest Tag, Codecov, and GHCR/Docker Hub (Pulls & Version) are displayed above.
-
User Management API
Centralized Error Logging API
The next repository will focus on:
-
Centralized Authorization Layer/Handler
-
Area/Controller/Action logic stored in DB.
-
Raised to in-memory cache for performance.
-
Shared distributed cache layer (Dragonfly/Redis).
-
-
Cross-API Authorization Consistency
-
One source of truth for both Web App + APIs.
-
Cache synchronization across services.
-
IntegrationPortal/
βββ Areas/
β βββ User/ # User-related features
β β βββ Controllers/ # Controllers for User area
β β βββ Models/ # EF Core models
β β βββ Views/ # Razor views
β βββ Admin/ # Admin-related features
β β βββ Controllers/
β β βββ Models/
β β βββ Views/
β βββ ... # Other areas (modules, roles, etc.)
βββ Services/ # Shared services & API clients
βββ wwwroot/ # Static assets (CSS, JS, icons)
βββ appsettings.json # Config (logging, connection, JWT)
βββ docs/
β βββ integration_portal_architecture.png
β βββ integration_portal_architecture.mmd
βββ README.md # DocumentationThe project supports multiple environments:
-
Development
- Connection string uses local SQL Server (LocalDB).
- Loaded from
appsettings.Development.json.
-
Production
-
Connection string points to Docker SQL Server.
-
Loaded from
appsettings.Production.json. -
Environment set via:
ASPNETCORE_ENVIRONMENT=Production
-
Open CentralizedLoggingMonitoring.sln in Visual Studio.
Press F5 or run the project.
By default, it uses Development environment with appsettings.Development.json.
-
Build and start the containers
- docker-compose up --build
-
Stop the containers
- docker-compose down
The services will be available at:
[web app] HTTP β http://localhost:7000
[user management api] HTTP β http://localhost:6000/api
[error log api] HTTP β http://localhost:5000/api
(HTTPS optional, future phase)
- Add SQL and SQL count in database of a report ABC
- Add Parameter JSON in database of a report ABC
- Add Datatable Header JSON in database of a report ABC
- Update Seed Data
- Create a form ABC to search and download without writing code
This will be developed as a new repository.
Create Application
http POST /api/Applications
Content-Type: application/json
{
"name": "Payment Service",
"environment": "Production"
}Create Error Log
http POST /api/ErrorLogs
Content-Type: application/json
{
"applicationId": 1,
"severity": "Error",
"message": "Null reference exception in payment processing",
"stackTrace": "at PaymentService.Process()...",
"source": "PaymentService",
"userId": "user123",
"requestId": "req-456"
}Future phases will be added in branches (phase-2, phase-3, β¦). Main branch will always contain the latest stable version.
Contributions are welcome β whether bug fixes, feature enhancements, or discussions about authorization best practices.
phase-1-core-api β Completed Phase 1.
phase-2-logging β Planned logging integration.
phase-3-um-api β Planned API documentation.
main β Always up to date with the latest stable phase.This project is licensed under the MIT License.





