A production-ready .NET 10 boilerplate with microservices architecture, featuring Cassandra, Redis, RabbitMQ, and comprehensive service implementations.
- β RESTful API with Swagger/ReDoc documentation
- β Apache Cassandra for distributed NoSQL storage
- β Redis for high-performance caching
- β RabbitMQ for asynchronous message processing
- β JWT Authentication for secure API access
- β Rate Limiting with multiple strategies (Fixed Window, Token Bucket, Sliding Window)
- β Mail Service with queue-based async sending
- β Media Service with MinIO object storage and ImageSharp optimization
- β Worker Service for background job processing
- β Logging with Serilog and Seq dashboard
- β Docker containerization with Docker Compose
- β Health Checks for all services
- β BCrypt password hashing
- β Repository Pattern with dependency injection
βββββββββββββββ ββββββββββββ βββββββββββββ
β Client ββββββΆβ API ββββββΆβ Cassandra β
βββββββββββββββ ββββββ¬ββββββ βββββββββββββ
β
ββββββ΄βββββββ
β β
βββββββΌβββββ ββββββΌββββββ
β Redis β β RabbitMQ β
β Cache β β Queue β
ββββββββββββ ββββββ¬ββββββ
β β
βββββββΌβββββ ββββββΌβββββββ
β MinIO β β Worker β
β Media | β Service β
ββββββββββββ βββββββββββββ
# Clone the repository
git clone https://github.com/Xjectro/dotnet-boilterplate.git
cd dotnet-boilterplate
# Start development environment
make dev
# Access the application
# API: http://localhost:5143
# Swagger: http://localhost:5143/swagger
# MinIO Console: http://localhost:9001 (minioadmin/minioadmin123)
# RabbitMQ Management: http://localhost:15672 (admin/admin123)# Restore dependencies
dotnet restore
# Run the application
dotnet run
# Or use the Makefile
make runComprehensive documentation is available in the Documentation folder:
- System Overview - Architecture and project structure
- Cassandra Database - Database setup and usage
- RabbitMQ Queue - Message queue implementation
- Mail Service - Email service with async processing
- Media Service - File upload, storage and delivery with MinIO
- Redis Cache - Caching strategies and usage
- JWT Authentication - Security and authentication
- Rate Limiting - API throttling and DDoS protection
- Logging (Serilog + Seq) - Structured logging and monitoring
- Validation (FluentValidation) - Model and request validation
- Docker Setup - Container orchestration
Key configuration can be set via environment variables:
# JWT
JwtSettings__Secret=your-secret-key
JwtSettings__ExpiryMinutes=60
# Redis
Redis__Host=redis:6379
# Cassandra
Cassandra__ContactPoints=cassandra
Cassandra__Port=9042
Cassandra__Keyspace=default_keyspace
# RabbitMQ
RabbitMq__Host=rabbitmq
RabbitMq__Port=5672
RabbitMq__Username=admin
RabbitMq__Password=admin123
# Media (MinIO)
Media__Endpoint=http://minio:9000
Media__AccessKey=minioadmin
Media__SecretKey=minioadmin123
Media__BucketName=uploads
Media__PublicUrl=http://localhost:9000
Media__MaxFileSize=10485760
# Mail
Mail__SmtpHost=smtp.gmail.com
Mail__SmtpPort=587
Mail__SmtpUsername=your-email@gmail.com
Mail__SmtpPassword=your-app-passwordSee appsettings.Development.json for all available options.
GET /healthPOST /api/mail/send
Content-Type: application/json
{
"to": ["user@example.com"],
"subject": "Welcome!",
"body": "<h1>Hello World</h1>",
"isHtml": true
}# Upload file
POST /api/media/upload?folder=images&generateThumbnail=true
Content-Type: multipart/form-data
# Get file
GET /api/media/{fileName}
# Delete file
DELETE /api/media/{fileName}
# List files
GET /api/media/list?folder=imagesGET /api/client
POST /api/client
PUT /api/client/{id}
DELETE /api/client/{id}Visit /swagger for complete API documentation.
βββ Source/
β βββ Configurations/ # Configuration classes
β βββ Controllers/ # API controllers
β βββ DTOs/ # Data transfer objects
β βββ Extensions/ # Service extensions
β βββ Models/ # Database models
β βββ Repositories/ # Data access layer
β βββ Services/ # Business logic
β βββ BCryptService/
β βββ CassandraService/
β βββ JwtService/
β βββ MailService/
β βββ RabbitMqService/
β βββ RedisService/
β βββ WorkerService/
βββ Docker/ # Docker compose files
βββ Documentation/ # Detailed documentation
βββ Api.csproj # Project file
βββ Program.cs # Application entry point
βββ README.md
dotnet builddotnet testdotnet format# Start development environment (with build)
make dev
# Start production environment (detached with build)
make prod
# View logs
docker compose -f Docker/docker-compose.dev.yml logs -f
# Stop services
docker compose -f Docker/docker-compose.dev.yml down
# Stop and remove volumes
docker compose -f Docker/docker-compose.dev.yml down -v- Port: 9042
- Keyspace: default_keyspace
- Replication: SimpleStrategy (Dev)
- Port: 6379
- Persistence: AOF enabled
- AMQP Port: 5672
- Management: http://localhost:15672
- Credentials: admin/admin123
- Port: 5143
- Swagger: http://localhost:5143/swagger
- ReDoc: http://localhost:5143/api-docs
- JWT token-based authentication
- BCrypt password hashing
- Environment variable configuration
- Docker secrets support
- HTTPS ready
All services include health checks:
# API Health
curl http://localhost:5143/health
# Docker health status
docker ps --format "table {{.Names}}\t{{.Status}}"- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENCE file for details.
For questions or support, please open an issue on GitHub.
- .NET Team for the amazing framework
- Docker for containerization
- Apache Cassandra for distributed database
- Redis for caching
- RabbitMQ for message queuing
Built with β€οΈ using .NET 10