Mediaine.Enterprise.Template 1.3.0

dotnet new install Mediaine.Enterprise.Template@1.3.0
                    
This package contains a .NET Template Package you can call from the shell/command line.

Enterprise Backend API

Enterprise Backend API Starter Template built with modern ASP.NET Core technologies and Clean Architecture principles.

NuGet

Continuous Integration

Publish NuGet Package

Enterprise-grade ASP.NET Core (.NET 10) API starter, packaged as a reusable dotnet new template. Scaffold a complete, production-ready Clean Architecture solution in seconds — every project, namespace, and the solution file are renamed to your chosen project name automatically.


What you get

  • Clean Architecture (Domain / Application / Infrastructure / Presentation)
  • CQRS with MediatR and a FluentValidation pipeline
  • Mapster object mapping
  • ASP.NET Identity + JWT with refresh-token rotation, hashing & reuse detection
  • Role / Permission / Module-based authorization
  • Audit logging, global exception handling, generic API response
  • Generic pagination / search / sorting
  • Serilog, OpenTelemetry, Health Checks
  • Hangfire background jobs, File upload
  • Scalar OpenAPI reference UI
  • Unit + Integration tests
  • Docker & docker-compose

Documentation

Document Description
Architecture Solution layers, CQRS, and design decisions
Setup Local and Docker setup, migrations, and configuration
Contributing Branching, workflow, and coding conventions
Changelog Notable changes per release
Roadmap Planned future development
Security Security features and vulnerability reporting
Release Notes v1.3.0 Highlights of the v1.3.0 release (refinement & hardening)
Release Notes v1.2.0 Highlights of the v1.2.0 release (Health Checks dashboard)
Release Notes v1.1.0 Highlights of the v1.1.0 release (File Attachments)
Release Notes v1.0.0 Highlights of the v1.0.0 release

Installation Solution Template

Install Solution Template

dotnet new install Mediaine.Enterprise.Template

Create a New Solution

dotnet new enterprise -n MyCompany.Api

This produces MyCompany.Api/ with every project renamed (MyCompany.Api.Application, MyCompany.Api.Domain, MyCompany.Api.WebAPI, …), all namespaces updated, and MyCompany.Api.slnx ready to build:

cd MyCompany.Api
dotnet build

Aliases: enterprise, enterprise-api, cleanarch.

Visual Studio

After installing the package, the template appears in Create a new project as "Enterprise Backend API Starter" (C#).

Update / Uninstall

dotnet new update
dotnet new uninstall Mediaine.Enterprise.Template

Quick Start

Local

# 1. Clone the repository
git clone https://github.com/adityapratamaf/EnterpriseProjectAPI.git
cd Enterprise

# 2. Restore and build
dotnet restore
dotnet build

# 3. Run the API (migrations and seeding run automatically on startup)
dotnet run --project src/Presentation/Enterprise.WebAPI

Then open the API documentation at http://localhost:5152/scalar/docs.

Docker

cp .env.example .env
docker compose up -d

The API is available at http://localhost:5000 (/scalar/docs for documentation, /health for health checks).

Default Administrator

Email:    admin@enterprise.local
Password: Admin123!

For detailed instructions, configuration, and troubleshooting, see the Setup guide.


Features

Architecture

  • Clean Architecture
  • CQRS Pattern (MediatR)
  • Result Pattern
  • Generic Pagination
  • Dependency Injection
  • Middleware Pipeline
  • Options Pattern
  • Extension-Based Startup Configuration

Authentication

  • JWT Authentication
  • Refresh Token Rotation
  • Multi Device Login
  • Session Tracking
  • Logout
  • Logout All Devices
  • Token Revocation

Authorization

  • ASP.NET Identity
  • Role Based Access Control (RBAC)
  • Dynamic Permission Policy
  • Permission Matrix
  • Module Management
  • Role Management
  • Permission Management

Security

  • JWT Bearer Authentication
  • Password Hashing
  • Rate Limiting
  • CORS Policy
  • Global Exception Handling

Monitoring & Logging

  • Serilog
  • Seq Integration
  • OpenTelemetry
  • Request Logging
  • Health Checks

Background Processing

  • Hangfire
  • SQL Server Storage

Database

  • Entity Framework Core
  • SQL Server
  • Automatic Database Migration
  • Automatic Database Seeding

Validation

  • FluentValidation
  • Validation Pipeline

Testing

  • Unit Tests
  • Integration Tests

API Documentation

  • OpenAPI
  • Scalar API Documentation

Project Structure

src
├── Core
│   ├── Enterprise.Domain
│   └── Enterprise.Application
│
├── Infrastructure
│   ├── Enterprise.Infrastructure.Identity
│   ├── Enterprise.Infrastructure.Persistence
│   └── Enterprise.Infrastructure.Shared
│
└── Presentation
    └── Enterprise.WebAPI

Technology Stack

Technology Purpose
ASP.NET Core 10 Web API Framework
Entity Framework Core ORM
SQL Server Database
MediatR CQRS
FluentValidation Validation
Mapster Object Mapping
ASP.NET Identity Authentication & Authorization
JWT Authentication
Hangfire Background Jobs
Serilog Logging
Seq Log Aggregation
OpenTelemetry Observability
Health Checks UI Health Monitoring Dashboard
Scalar API Documentation
Docker Containerization

Installed Modules

  • Authentication
  • Users
  • Roles
  • Permissions
  • Modules
  • Products
  • Audit Logs
  • File Attachments

API Response Format

All API responses use a standardized response model.

{
  "success": true,
  "message": "Success",
  "data": {},
  "errors": null
}

Pagination Format

Request

GET /api/products?pageNumber=1&pageSize=10&search=monitor

Response

{
  "success": true,
  "message": "Success",
  "data": {
    "items": [],
    "totalCount": 100,
    "pageNumber": 1,
    "pageSize": 10
  },
  "errors": null
}

Authentication Flow

Login

POST /api/auth/login

Refresh Token

POST /api/auth/refresh

Logout

POST /api/auth/logout

Profile

GET /api/auth/profile

Audit Log Example

{
  "action": "UPDATE",
  "module": "Users",
  "tableName": "AspNetUsers",
  "oldValues": {},
  "newValues": {}
}

Testing

Unit Tests

dotnet test tests/Enterprise.Application.UnitTests

Coverage includes:

  • Validators
  • Commands
  • Queries
  • Business Rules

Integration Tests

dotnet test tests/Enterprise.Application.IntegrationTests

Coverage includes:

  • Authentication
  • Authorization
  • Health Endpoint
  • Protected Endpoints
  • API Integration

Running with Docker

docker compose up --build

Health Check

/healthcheck-ui

API Documentation

Scalar

/scalar/docs

OpenAPI

/openapi/v1.json

Logging

Serilog writes logs to:

  • Console
  • Rolling File
  • Seq

Author

Enterprise Backend Architecture Starter Template


License

MIT © 2026 Aditya Pratama Febriono

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 127 9/8/2026
1.2.0 272 8/26/2026
1.1.0 170 8/12/2026
1.0.0 194 7/29/2026