Skip to content

Commit eda8cf4

Browse files
Readme updated for Integration Portal
1 parent 7f45660 commit eda8cf4

File tree

1 file changed

+153
-60
lines changed

1 file changed

+153
-60
lines changed

README.md

Lines changed: 153 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,186 @@
11
# Centralized Logging & Monitoring API
22

3-
A centralized error logging and monitoring API built with **.NET 9**, Entity Framework Core, and SQL Server.
4-
This project is designed to serve as a foundation for collecting, storing, and managing error logs from multiple applications.
3+
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.
54

6-
This project implements **Phase 1–4** (completed) and outlines future **Phase 5–6** enhancements.
5+
Each phase is preserved in its own branch, but this repository now focuses on the above highlighted phases i.e. the final **Integration Portal, a Microservices influenced architechture (Single Service Database Pattern)**.
6+
7+
---##
8+
9+
## # 🖥️ Integration Portal
10+
11+
## 🌟 What It Is
12+
13+
A **.NET 9 MVC Web App** that unifies multiple APIs (**User Management and Logging**) into a single **Integration Portal** with **role-based navigation**.
714

815
---
916

10-
## 📌 Project Phases Completed
17+
## 🔑 Key Features
18+
19+
- ✅ A login page with client and server side validations
20+
21+
- ✅ There are two users for login.
22+
23+
- ✅ User name and passwords of the two are alice/alice and bob/bob.
24+
25+
- ✅ Alice is admin and bob is an operations user.
26+
27+
- ✅ Serilog + file sinks implemented for the web app.
28+
29+
- ✅ Invalid user error is posted to the Error logging API
30+
31+
- ✅ When user logins successfully a cotegort tree is generated on the sidebar
1132

12-
### ✅ Phase 1: Core API
13-
- Create centralized logging API
14-
- Store logs in SQL Server
15-
- Basic Serilog integration
16-
- Swagger/OpenAPI setup
33+
- ✅ Only logs link from the side bar work with the logout feature.
1734

18-
### ✅ Phase 2: Containerization
19-
- Add `Dockerfile`
20-
- Add `docker-compose.yml` for API + SQL Server
21-
- Persistent volumes for database
35+
- ✅ Admin user can view logs
2236

23-
### ✅ Phase 3: Logging Enhancements
24-
- Structured logging with Serilog sinks
25-
- Support for File output
26-
- Correlation ID, environment, and service enrichment
37+
---
2738

28-
### ✅ Phase 4: User Management API
29-
- Implemented JWT (Bearer) authentication and claim/role-based authorization.
30-
- Categories have modules which have functions.
31-
- Roles have functions and user have roles.
32-
- Embed full user categories in JWT (temp); plan session cache
33-
- Serilog and code first approach
39+
## 📊 Architecture Glimpse
3440

41+
![Integration Portal Architecture](docs/integration_portal_architecture.png)
42+
<sub>[View Mermaid source](docs/integration_portal_architecture.mmd)</sub>
3543

3644
---
3745

38-
## 📂 Project Structure
46+
## ⚙️ Implementation Details
3947

40-
```bash
48+
- **Login & Validation**
49+
50+
- Custom login (no ASP.NET Core Identity).
51+
52+
- **Client-side validation** with jQuery Validation + Bootstrap feedback.
53+
54+
- **Server-side validation** ensures username/password check against database seeded users.
55+
56+
- Bearer handler implemented that fetches token from Memory cache on every request
57+
58+
- Areas implemented
59+
60+
- **Users & Roles (Alice / Bob)**
61+
62+
- User credentials (`alice/alice`, `bob/bob`) seeded in DB/EF Core migration for demo.
63+
64+
- **Alice (Admin)** → sees *Logs* link enabled.
65+
66+
- **Bob (Operations)** → restricted, no access to logs.
67+
68+
- Role checks handled through **claims in JWT**.
69+
70+
- JWT is stored **in-memory cache**
71+
72+
- **Serilog Logging (Web App)**
73+
74+
- Web App configured with **Serilog file sinks** (`/logs/dev-app-.log`).
75+
76+
- Request Audibility and Exception handling middleware added in APIs
77+
78+
- Structured logs include **timestamp, environment, service name, correlation ID**.
79+
80+
- **Error Logging API Integration**
81+
82+
- On invalid login → error posted to **Error Logging API** via secured HTTP client.
83+
84+
- Uses **Polly retry policy** for resilience.
85+
86+
- API persists errors to DB + local log file (from Phase 3).
4187

42-
CentralizedLoggingMonitoring/
43-
├── CentralizedLoggingApi/ # Core API project
44-
│ ├── Controllers/ # API controllers
45-
│ ├── Models/ # EF Core models
46-
│ ├── Data/ # DbContext
47-
│ ├── Program.cs
48-
│ ├── Startup.cs (if any)
49-
│ └── appsettings.json
50-
├── docker-compose.yml # Docker Compose setup
51-
├── README.md # Documentation
52-
└── .gitignore
88+
- **Dynamic Sidebar Category Tree**
89+
90+
- After login → Web App queries **User Management API** for role/category/module/functions.
91+
92+
- Sidebar navigation auto-adjust per user role.
93+
94+
- **Logs Link (Working Feature)**
95+
96+
- Clicking *Logs* fetches data from the **Centralized Logging API** (Phase 1).
97+
98+
- Admin users can view structured logs with pagination (DataTables).
99+
100+
- Non-admins only see authorized links.
101+
102+
- **Logout & Session Handling**
103+
104+
- Logout clears JWT/session cache.
105+
106+
- User redirected back to login page.
107+
108+
- Ensures secure re-authentication before accessing APIs again.
53109

110+
---
111+
112+
## 🏗️ Planned Enhancements (Next Repository)
113+
114+
The next repository will focus on:
115+
116+
- **Centralized Authorization Layer/Handler**
117+
118+
- Area/Controller/Action logic stored in DB.
119+
120+
- Raised to in-memory cache for performance.
121+
122+
- Shared **distributed cache layer** (Dragonfly/Redis).
123+
124+
- **Cross-API Authorization Consistency**
125+
126+
- One source of truth for both Web App + APIs.
127+
128+
- Cache synchronization across services.
129+
130+
---
131+
132+
## 📂 Project Structure
133+
134+
```bash
135+
IntegrationPortal/
136+
├── Areas/
137+
│ ├── User/ # User-related features
138+
│ │ ├── Controllers/ # Controllers for User area
139+
│ │ ├── Models/ # EF Core models
140+
│ │ └── Views/ # Razor views
141+
│ ├── Admin/ # Admin-related features
142+
│ │ ├── Controllers/
143+
│ │ ├── Models/
144+
│ │ └── Views/
145+
│ └── ... # Other areas (modules, roles, etc.)
146+
├── Services/ # Shared services & API clients
147+
├── wwwroot/ # Static assets (CSS, JS, icons)
148+
├── appsettings.json # Config (logging, connection, JWT)
149+
├── docs/
150+
│ └── integration_portal_architecture.png
151+
│ └── integration_portal_architecture.mmd
152+
└── README.md # Documentation
54153
```
55154

56155
---
57156

157+
158+
58159
## ⚙️ Environments
160+
59161
The project supports multiple environments:
60162

61163
- **Development**
164+
62165
- Connection string uses local SQL Server (LocalDB).
63166
- Loaded from `appsettings.Development.json`.
64167

65168
- **Production**
169+
66170
- Connection string points to Docker SQL Server.
171+
67172
- Loaded from `appsettings.Production.json`.
173+
68174
- Environment set via:
175+
69176
```bash
70177
ASPNETCORE_ENVIRONMENT=Production
71178
```
72179

73180
---
74181

75182
## 🖥️ Running with Visual Studio (Development)
183+
76184
Open CentralizedLoggingMonitoring.sln in Visual Studio.
77185

78186
Press F5 or run the project.
@@ -84,66 +192,52 @@ By default, it uses Development environment with appsettings.Development.json.
84192
## 📦 Running with Docker (Production)
85193

86194
- **Build and start the containers**
87-
- docker-compose up --build
88195

196+
- docker-compose up --build
197+
89198
- **Stop the containers**
199+
90200
- docker-compose down
91201

92-
93202
The API will be available at:
94203

95204
HTTP → http://localhost:5000/api
96205

97206
(HTTPS optional, future phase)
98207

99-
100208
---
101209

102210
## 📈 Future Enhancements
103211

104-
### 🔒 Phase 5: MVC Asp .NetCore Web Application
105-
- Authentication and Authorization
106-
- Menu
107-
- Storing JWT in memory cache
108-
- Centralized code to call APIs from client
212+
## 🐛 Phase 6: Info Express API with Client
109213

110-
### 🐛 Phase 6: Info Express API with Client
111214
- Add SQL and SQL count in database of a report ABC
112215
- Add Parameter JSON in database of a report ABC
113216
- Add Datatable Header JSON in database of a report ABC
114217
- Update Seed Data
115218
- Create a form ABC to search and download without writing code
116219

117-
### 🐛 Phase 7: Try-Catch Integration
118-
- Using the centralized logging API in other apps
119-
- Capture and post exceptions automatically from services
220+
**This will be developed as a new repository.**
120221

121-
### 🌐 Phase 8: Web Dashboard
122-
- Lightweight web app with login
123-
- Display logs from DB
124-
- Search & filter logs by date, service, environment, severity
125-
126222
---
127223

128224
## 📬 Sample API Requests
225+
129226
Create Application
130227

131228
```bash
132-
133229
http POST /api/Applications
134230
Content-Type: application/json
135231
136232
{
137233
"name": "Payment Service",
138234
"environment": "Production"
139235
}
140-
141236
```
142237

143238
Create Error Log
144239

145240
```bash
146-
147241
http POST /api/ErrorLogs
148242
Content-Type: application/json
149243
@@ -156,7 +250,6 @@ Content-Type: application/json
156250
"userId": "user123",
157251
"requestId": "req-456"
158252
}
159-
160253
```
161254

162255
---
@@ -166,23 +259,23 @@ Content-Type: application/json
166259
Future phases will be added in branches (phase-2, phase-3, …).
167260
Main branch will always contain the latest stable version.
168261

262+
Contributions are welcome — whether bug fixes, feature enhancements, or discussions about **authorization best practices**.
263+
169264
---
170265

171266
## 📂 Repository Roadmap
172267

173268
```bash
174-
175269
phase-1-core-api → Completed Phase 1.
176270
phase-2-logging → Planned logging integration.
177271
phase-3-um-api → Planned API documentation.
178272
main → Always up to date with the latest stable phase.
179-
180273
```
181274

182275
---
183276

184277
## 📜 License
185-
This project is licensed under the MIT License.
186278

279+
This project is licensed under the MIT License.
187280

188281
---

0 commit comments

Comments
 (0)