A modern ASP.NET Core 9.0 web application demonstrating clean architecture patterns with Supabase integration
This project showcases modern .NET development practices through a veterinary contact management system. Built with ASP.NET Core 9.0 and Supabase, it demonstrates clean architecture principles, RESTful API design, and real-time database integration.
- Clean Architecture: Separation of concerns with distinct layers for Controllers, Models, and Contracts
- Modern .NET: Built on .NET 9.0 with latest C# 12 features
- Cloud Database: Real-time integration with Supabase PostgreSQL
- API Documentation: Interactive Swagger/OpenAPI documentation
- Dependency Injection: Leverages ASP.NET Core's built-in DI container
- JSON Handling: Advanced serialization with Newtonsoft.Json
βββ Controllers/ # API endpoints and business logic
β βββ VetController.cs # CRUD operations for veterinarians
β βββ ControllerBoilerplate.cs # Template for new controllers
βββ Models/ # Database entity mappings
β βββ VetModel.cs # Supabase table mapping
β βββ HealthCheckModel.cs # System health monitoring
βββ Contracts/ # Data Transfer Objects (DTOs)
β βββ CreateVetRequest.cs # API request validation models
βββ Pages/ # Razor Pages UI (optional frontend)
βββ Program.cs # Application entry point & configuration
- Supabase Integration: Direct PostgreSQL connection with real-time capabilities
- Entity Mapping: Automatic table-to-class mapping with attributes
- Type Safety: Strongly-typed database operations
- RESTful Design: Standard HTTP methods with proper status codes
- Input Validation: Request DTOs separate from database models
- Error Handling: Comprehensive exception management
- Documentation: Auto-generated API documentation
- Environment-based Settings: Separate configs for development/production
- Secure Credentials: Configuration-based connection strings
- Flexible Deployment: Easy environment switching
Method | Endpoint | Description | Request Body |
---|---|---|---|
POST |
/vet/{id} |
Create new veterinarian | CreateVetRequest |
GET |
/vet/{id} |
Get veterinarian by ID | - |
PUT |
/vet/{id} |
Update veterinarian | UpdateVetRequest (planned) |
DELETE |
/vet/{id} |
Delete veterinarian | - (planned) |
{
"title": "Dr.",
"firstName": "John",
"lastName": "Smith",
"email": "john.smith@vetclinic.com",
"phone": "+1234567890",
"clinicName": "Downtown Veterinary Clinic",
"clinicAddress": "123 Main St, City, State 12345"
}
- .NET 9.0 SDK
- Supabase Account (free tier available)
- IDE: Visual Studio 2022, VS Code, or JetBrains Rider
-
Clone the repository
git clone <repository-url> cd min-api-project
-
Configure Supabase
# Create appsettings.Development.json { "SupabaseUrl": "your-supabase-project-url", "SupabaseApiKey": "your-supabase-anon-key", "UseSwagger": true, "DetailedErrors": true }
-
Install dependencies
dotnet restore
-
Run the application
# HTTP (recommended for development) dotnet run --launch-profile http # HTTPS dotnet run --launch-profile https
-
Access the application
- API: http://localhost:5144
- Swagger UI: http://localhost:5144/swagger
- Web Interface: http://localhost:5144 (Razor Pages)
CREATE TABLE vet (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
title VARCHAR(10),
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
email VARCHAR(255) UNIQUE,
phone VARCHAR(20) NOT NULL,
clinic_name VARCHAR(200),
clinic_address TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
# Build the project
dotnet build
# Run with specific profile
dotnet run --launch-profile http # Port 5144
dotnet run --launch-profile https # Port 7020
# Add new packages
dotnet add package [PackageName]
# Restore dependencies
dotnet restore
- Separation of Concerns: Clear distinction between data models, request DTOs, and business logic
- Dependency Injection: Leverages ASP.NET Core's built-in container for loose coupling
- Configuration Management: Environment-based settings with validation
- Error Handling: Proper HTTP status codes and exception management
- Minimal APIs: Lightweight, performance-focused endpoints
- Record Types: Immutable data structures where applicable
- Nullable Reference Types: Enhanced type safety
- Global Using Statements: Reduced code verbosity
- Real-time Capabilities: Supabase real-time subscriptions enabled
- Automatic Refresh: Token management handled automatically
- Type-safe Queries: Strongly-typed database operations
- Migration Support: Schema versioning through Supabase dashboard
- Complete CRUD operations (Update, Delete)
- Authentication and authorization with JWT
- Unit and integration testing
- Docker containerization
- CI/CD pipeline setup
- Rate limiting and API versioning
- Logging and monitoring integration
- Performance optimization and caching
- Configuration-based secret management
- Input validation and sanitization
- SQL injection protection through ORM
- HTTPS redirection in production
- CORS configuration for cross-origin requests
- Async/await patterns for non-blocking I/O
- Connection pooling through dependency injection
- JSON serialization optimizations
- Lazy loading where applicable
This project demonstrates proficiency in modern .NET development, cloud database integration, and RESTful API design principles. Built as a portfolio piece to showcase full-stack development capabilities.