Skip to content

Commit 85a6c2b

Browse files
author
Timothy Dodd
committed
Upgrade to .NET 10 and migrate to Dapper-based ORM
Upgraded the backend API from .NET 9 to .NET 10 for improved performance. Replaced Entity Framework Core with RoboDodd.OrmLite (Dapper-based) to simplify database operations and eliminate migrations. Added webhook capture and management features, including new endpoints (`/api/hook/{bucket}` and `/api/webhooks/*`), real-time webhook notifications via SignalR, and new entity models (`Webhook` and `WebhookBucket`). Updated the Angular 19 frontend to support webhook capture and inspection. Updated documentation to reflect architectural changes, removed EF Core dependencies, and added new dependencies for RoboDodd.OrmLite. Revised project structure and patterns to align with the new ORM.
1 parent 5356588 commit 85a6c2b

2 files changed

Lines changed: 43 additions & 38 deletions

File tree

CLAUDE.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
## Project Overview
66

77
MailVoid is a developer email testing tool with two main components:
8-
- **Backend API**: C# .NET 9 web API that manages emails, authentication, and webhook integration
9-
- **Frontend**: Angular 19 web application for viewing and managing test emails
8+
- **Backend API**: C# .NET 10 web API that manages emails, authentication, and webhook integration
9+
- **Frontend**: Angular 19 web application for viewing and managing test emails and webhooks
1010

11-
The application receives webhook events from your mail server and stores emails in a MySQL database for developers to view through the web interface.
11+
The application receives webhook events from your mail server and stores emails in a MySQL database for developers to view through the web interface. It also includes a webhook capture feature for testing HTTP webhooks.
1212

1313
## Architecture
1414

1515
### Backend (src/MailVoidApi/)
16-
- **Controllers**: REST API endpoints for authentication, mail management, and webhooks
17-
- **Services**: Core business logic including AuthService, MailGroupService, UserService, and background task processing
18-
- **Models**: Entity classes for User, Mail, MailGroup, and RefreshToken with Entity Framework annotations
19-
- **Data**: MailVoidDbContext for Entity Framework Core database operations
16+
- **Controllers**: REST API endpoints for authentication, mail management, webhook capture, and webhook management
17+
- **Services**: Core business logic including AuthService, MailGroupService, UserService, WebhookBucketService, and background task processing
18+
- **Models**: Entity classes for User, Mail, MailGroup, RefreshToken, Webhook, and WebhookBucket with RoboDodd.OrmLite annotations
19+
- **Data**: DatabaseService for RoboDodd.OrmLite database operations (Dapper-based)
2020
- **Common**: Shared utilities including pagination, caching (TimedCache), and database extensions
2121
- **Authentication**: JWT-based authentication with refresh token support
22-
- **Database**: MySQL with Entity Framework Core 8 and Pomelo MySQL provider
23-
- **Real-time**: SignalR hub for real-time email notifications
22+
- **Database**: MySQL with RoboDodd.OrmLite (Dapper-based micro ORM)
23+
- **Real-time**: SignalR hub for real-time email and webhook notifications
2424

2525
### Frontend (src/MailVoidWeb/)
2626
- **Architecture**: Angular 19 standalone components with reactive forms and routing
@@ -39,7 +39,7 @@ The application receives webhook events from your mail server and stores emails
3939
dotnet run # Run API (also starts frontend via SPA proxy)
4040
dotnet build # Build the API
4141
dotnet test # Run tests (if any exist)
42-
dotnet ef database update # Apply database migrations
42+
# Note: Database tables are created automatically on startup (no migrations needed)
4343
```
4444

4545
### Frontend (Angular)
@@ -70,12 +70,15 @@ npm run format # Format code with Prettier
7070
## Key Patterns
7171

7272
### Backend Patterns
73-
- Controllers use Entity Framework Core with Pomelo MySQL provider for database operations
73+
- Controllers use RoboDodd.OrmLite (Dapper-based) for database operations
74+
- Use `db.From<T>()` for fluent query building with `.Where()`, `.OrderBy()`, `.Limit()`
75+
- Use `db.SelectAsync<T>()`, `db.SingleAsync<T>()`, `db.InsertAsync()`, `db.UpdateAsync()`, `db.DeleteAsync()`
76+
- Use `db.CountAsync<T>()` for counting records
7477
- JWT authentication with refresh token rotation
7578
- Background task queue for async operations
7679
- Pagination implemented via PagedResults<T> utility
7780
- Custom exception handling and logging
78-
- DbContext pattern with MailVoidDbContext for data access
81+
- DatabaseService pattern for connection management
7982

8083
### Frontend Patterns
8184
- Standalone Angular components (no NgModules)
@@ -102,6 +105,8 @@ npm run format # Format code with Prettier
102105
- **MailGroup**: Rules-based email organization with retention policies
103106
- **RefreshToken**: Secure token rotation for authentication
104107
- **UserMailRead**: Tracking read status for emails per user
108+
- **Webhook**: Captured HTTP webhook requests
109+
- **WebhookBucket**: Organization for webhook captures with retention policies
105110

106111
## Default Credentials
107112
- Username: admin
@@ -113,19 +118,21 @@ npm run format # Format code with Prettier
113118
- `/api/mailgroup/*`: Mail group management
114119
- `/api/user/*`: User management and settings
115120
- `/api/health`: Health check endpoint
121+
- `/api/hook/{bucket}`: Webhook capture endpoint (POST/PUT/PATCH - no auth required)
122+
- `/api/webhooks/*`: Webhook management API (requires auth)
116123
- `/webhooks/mail`: Mail server webhook endpoint
117124
- `/mailHub`: SignalR hub for real-time notifications
118125

119126
## Dependencies
120127

121128
### Backend NuGet Packages
122-
- Microsoft.AspNetCore.Authentication.JwtBearer (9.0.8)
123-
- Microsoft.EntityFrameworkCore (8.0.17) - Using v8 for Pomelo compatibility
124-
- Pomelo.EntityFrameworkCore.MySql (8.0.3)
125-
- Microsoft.AspNetCore.SpaProxy (9.0.8)
126-
- AspNetCore.HealthChecks.MySql (9.0.0)
127-
- Microsoft.Extensions.Caching.Memory (9.0.8)
128-
- Microsoft.Extensions.Diagnostics.HealthChecks (9.0.8)
129+
- Microsoft.AspNetCore.Authentication.JwtBearer
130+
- RoboDodd.OrmLite (git submodule - Dapper-based micro ORM)
131+
- MySqlConnector
132+
- Dapper
133+
- Microsoft.AspNetCore.SpaProxy
134+
- AspNetCore.HealthChecks.MySql
135+
- Microsoft.Extensions.Caching.Memory
129136

130137
### Frontend NPM Packages
131138
- Angular 19 (v20.1.5) - Core framework

README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,32 @@ MailVoid is a developer-focused email testing tool that simplifies managing mult
99
1010
## 🚀 Features
1111

12-
- **Backend API**: RESTful API built with C# .NET 9
12+
- **Backend API**: RESTful API built with C# .NET 10
1313
- JWT-based authentication with refresh token rotation
1414
- Webhook integration for email capture from your mail server
15+
- Webhook capture feature for testing HTTP webhooks
1516
- Health check endpoints for monitoring
1617
- Real-time notifications via SignalR
17-
18+
1819
- **Web Frontend**: Modern Angular 19 SPA
1920
- Clean, responsive interface for email management
2021
- Email grouping and organization
22+
- Webhook capture and inspection UI
2123
- User settings and password management
22-
- Real-time email notifications
23-
24-
- **Database**: MySQL with Entity Framework Core
24+
- Real-time email and webhook notifications
25+
26+
- **Database**: MySQL with RoboDodd.OrmLite (Dapper-based)
2527
- Efficient email storage and retrieval
2628
- User management and authentication
2729
- Email grouping with retention policies
30+
- Webhook bucket organization
2831

2932
## 📋 Requirements
3033

31-
- .NET 9 SDK
32-
- Node.js 20.19+ and npm
34+
- .NET 10 SDK
35+
- Node.js 22+ and npm
3336
- MySQL 8.0+
34-
- Mail server with webhook support
37+
- Mail server with webhook support (optional)
3538

3639
## 🛠️ Installation
3740

@@ -64,12 +67,7 @@ cd MailVoid
6467
}
6568
```
6669

67-
3. Run database migrations:
68-
```bash
69-
dotnet ef database update
70-
```
71-
72-
4. Start the API (this also serves the frontend in production):
70+
3. Start the API (tables are created automatically on startup):
7371
```bash
7472
dotnet run
7573
```
@@ -134,8 +132,8 @@ docker run -p 5133:80 mailvoid
134132
### Technologies Used
135133

136134
**Backend:**
137-
- .NET 9
138-
- Entity Framework Core 8 with Pomelo MySQL provider
135+
- .NET 10
136+
- RoboDodd.OrmLite (Dapper-based micro ORM)
139137
- JWT Authentication
140138
- SignalR for real-time updates
141139

@@ -155,8 +153,8 @@ MailVoid/
155153
│ ├── MailVoidApi/ # .NET Backend API
156154
│ │ ├── Controllers/ # API endpoints
157155
│ │ ├── Services/ # Business logic
158-
│ │ ├── Models/ # Entity models
159-
│ │ └── Data/ # EF Core context
156+
│ │ ├── Models/ # Entity models
157+
│ │ └── Data/ # Database service
160158
│ └── MailVoidWeb/ # Angular Frontend
161159
│ ├── src/app/
162160
│ │ ├── Pages/ # Page components
@@ -182,4 +180,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail
182180

183181
- [Microsoft](https://microsoft.com/) for .NET and development tools
184182
- [Angular](https://angular.io/) for the frontend framework
185-
- [Pomelo](https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql) for MySQL EF Core provider
183+
- [Dapper](https://github.com/DapperLib/Dapper) for the micro ORM foundation

0 commit comments

Comments
 (0)