A robust, flexible, and scalable .NET API starter template designed to accelerate the development of enterprise-grade applications. This template includes a pre-configured setup with Entity Framework Core, AutoMapper, JWT authentication, role-based access control, multitenancy, and essential services for cloud storage and logging. Perfect for developers looking to kickstart their .NET projects with a solid foundation.
- Entity Framework Core: Pre-configured for use with SQL databases and includes an in-memory database setup for testing.
- AutoMapper: Simplifies object-to-object mapping.
- JWT Authentication: Implements token-based authentication and role-based access control.
- Role Management: Predefined roles and easy-to-extend role-based permissions.
- Multitenancy: Baked-in support for multitenancy to manage multiple clients within a single application instance.
- Cloud Storage: Integration with MinIO or Azure Blob Storage for file management.
- Swagger Integration: Auto-generated API documentation with Swagger UI.
- Logging: Integrated logging with Serilog for better observability and diagnostics.
- .NET 8 SDK
- SQL Server or PostgreSQL for database (optional)
- MinIO or Azure Storage for file storage (optional)
-
Clone the repository:
git clone https://github.com/TONYOG12/DotNetApiStarter.git cd DotNetApiStarter -
Configure environment variables:
- Create a
.envfile in the root directory. - Add necessary configurations for the database, JWT, and cloud storage.
- Create a
-
Run the application:
dotnet run
-
Access Swagger UI:
Navigate to
https://localhost:5001/to explore the API documentation.
- /API: Contains the main application logic, controllers, and services.
- /DOMAIN: Defines the domain entities and core business logic.
- /INFRASTRUCTURE: Includes data access and external services integration.
- /SHARED: Holds shared utilities, DTOs, and other cross-cutting concerns.
- /TESTS: Contains unit and integration tests.
For instructions on how to set up and run the application using Docker, please refer to the Docker Setup Instructions.
Contributions are welcome! Please open an issue or submit a pull request.