Skip to content
| Marketplace
Sign in
Visual Studio>Templates>Web API + MVC UI + JWT Template (.NET 10)
Web API + MVC UI + JWT Template (.NET 10)

Web API + MVC UI + JWT Template (.NET 10)

Sivaprasad SR

|
1,052 installs
| (0) | Free
.NET 10 multi-project solution template: JWT-authenticated Web API, ASP.NET Core MVC admin portal (Bootstrap 5), Dapper + SQL Server (SSDT/dacpac), refresh tokens, email verification, forgot/reset/change password, role & user management (Admin/User), maintenance mode, seeded a...
Download

Web API + MVC UI Template (.NET 10)

A production-ready Visual Studio solution template for .NET 10 that scaffolds a full-stack application with JWT-authenticated Web API, ASP.NET Core MVC admin portal, SQL Server database project, and all common authentication flows — so you never write the same boilerplate twice.


What's Included

Feature API UI
Login with JWT tokens ✅ ✅ Cookie-based
Refresh token ✅ —
Email verification on sign-up ✅ ✅
Forgot / reset password ✅ ✅
Change password ✅ ✅
Role management (CRUD) ✅ Admin only ✅ Admin only
User management (CRUD) ✅ Admin only ✅ Admin only
Seeded Admin + User roles ✅ —
Seeded default admin user ✅ —
Maintenance mode — ✅
Swagger + JWT auth header ✅ —
SSDT database project (dacpac) ✅ —
Repository pattern (Dapper) ✅ ✅
NUnit unit tests ✅ —

Technology Stack

  • .NET 10 — API and UI
  • ASP.NET Core Web API — REST endpoints, JWT Bearer authentication
  • ASP.NET Core MVC — Razor-based admin portal with Bootstrap 5.3 + Font Awesome 6
  • JWT — short-lived access tokens (10 min) + refresh tokens
  • Dapper 2.1.79 — lightweight data access with repository pattern
  • SQL Server — via Microsoft.Data.SqlClient
  • SSDT — .sqlproj database project with dacpac publish, schema, and post-deploy seed scripts
  • SMTP email — account verification and password reset
  • PBKDF2-SHA256 — password hashing (100,000 iterations)
  • Swashbuckle / Swagger — API documentation with JWT auth support
  • NUnit 4 — unit tests for Services and Repository layers

Projects

Project Type Purpose
WebAPIJWTTemplate.API ASP.NET Core Web API REST API with JWT auth, Swagger
WebAPIJWTTemplate.UI ASP.NET Core MVC Admin web portal with cookie auth
WebAPIJWTTemplate.Services Class library Business logic, JWT, email, password hashing
WebAPIJWTTemplate.Repository Class library Dapper data access, entities
WebAPIJWTTemplate.DB SSDT SQL project Schema, seed scripts, dacpac
WebAPIJWT.VSIXProject VSIX Visual Studio extension packaging
WebAPIJWTTemplate.Repository.Test NUnit Repository unit tests
WebAPIJWTTemplate.Services.Test NUnit Service-layer unit tests

Prerequisites

  • Visual Studio 2022 (v17.0+) or Visual Studio 2026
  • .NET 10 SDK
  • SQL Server (LocalDB, Express, Developer, or full edition)
  • SQL Server Data Tools (SSDT) — for the .sqlproj database project

Getting Started

1. Install the extension

Install from the Visual Studio Marketplace or directly from Visual Studio: Extensions → Manage Extensions → Search "Web API + MVC UI Template".

Restart Visual Studio after installation.

2. Create a new project

File → New → Project → search for "Web API + MVC UI" → select Web API + MVC UI Template (.NET 10) → click OK.

3. Publish the database

Open WebAPIJWTTemplate.DB → right-click → Publish.

Set your target server and database name, then click Publish. The post-deploy script will:

  • Create Admin and User roles
  • Create a default admin account: admin@gmail.com / Admin@123

Change the default admin password immediately after first login in production.

4. Configure connection strings

Update appsettings.Development.json in both WebAPIJWTTemplate.API and WebAPIJWTTemplate.UI:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=YOUR_SERVER;Database=WebAPIJWTTemplate.DB;Trusted_Connection=True;TrustServerCertificate=True;"
  },
  "Jwt": {
    "Key": "YOUR_LONG_RANDOM_SECRET_KEY_MIN_32_CHARS",
    "Issuer": "WebAPIJWTTemplate",
    "Audience": "WebAPIJWTTemplate"
  },
  "Email": {
    "SmtpHost": "your-smtp-host.com",
    "SmtpPort": 587,
    "EnableSsl": true,
    "UserName": "your-smtp-user",
    "Password": "your-smtp-password",
    "FromAddress": "noreply@yourdomain.com"
  }
}

5. Run the projects

Startup project URL
WebAPIJWTTemplate.API https://localhost:7194 — Swagger at /swagger
WebAPIJWTTemplate.UI https://localhost:7102

Configure multiple startup projects in solution properties to run both simultaneously.


Architecture

Browser / API Client
       │
       ├── WebAPIJWTTemplate.UI  (MVC + Cookie Auth)
       └── WebAPIJWTTemplate.API (Web API + JWT Bearer)
               │
               └── WebAPIJWTTemplate.Services
                       │
                       └── WebAPIJWTTemplate.Repository (Dapper)
                               │
                               └── SQL Server (WebAPIJWTTemplate.DB)

Both the UI and API share the same Services and Repository layers directly — the UI does not call the API over HTTP.


Default Credentials

Email Password Role
admin@gmail.com Admin@123 Admin

New users who register via the Sign Up page receive the User role and must verify their email before signing in.


Maintenance Mode

Set MaintenanceMode:Enabled to true in WebAPIJWTTemplate.UI\appsettings.json to redirect all non-admin users to a maintenance page (HTTP 503).


License

MIT

-----------------------------------------------OLD--------------------------------------------------------------------

Usings

  • NET Core 8.0
  • JWT Token authentication to protect your API
  • DI - built in DI capabilities.
  • AutoMapper for models mappings
  • Swagger for API documentation
  • Dapper with Repository pattern for MSSQL
  • Dacpac for database script and database objects

Projects template

  • WebAPIJWTTemplate.DB - database project for publishing database
  • WebAPIJWTTemplate.Repository - repository project to connect with database
  • WebAPIJWTTemplate.Services - business layer or service project for business logic, etc.
  • WebAPIJWTTemplate.API - api project for managing the end points.

Capture1.PNG

Project requires Visual studio 2019/2022 with Dot Net core 8.0

Getting Started

  1. Install the extension from the Visual Studio Marketplace. Also, you can install it from Visual Studio.To do so click on "Extensions" menu item, then select "Browse" , search for "Web API + JWT Token Template" select it and click "Download" button.

  2. Restart Visual Studio

  3. Click on "Create a New Project..." menu item Type "Web API + JWT Token" on the search pane Select "APS.Net WebAPI Application With OWIN" and click OK button.

  4. Run .DB Project for creating the database.

  5. Open a API project and open the appsettings.js

  6. Edit the database connection string and the jwt token values

Capture2.PNG

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft