Cundi.Api.Template
1.0.14
dotnet new install Cundi.Api.Template::1.0.14
Cundi WebAPI Template
A DevExpress XAF-based WebAPI project template with integrated Keycloak authentication and Refine frontend framework support.
Features
- ✅ DevExpress XAF 25.1.7 Framework
- ✅ ASP.NET Core 9.0 WebAPI
- ✅ JWT and Keycloak Authentication
- ✅ XPO ORM Data Access
- ✅ Swagger API Documentation
- ✅ Local NuGet Package Support
- ✅ Pre-configured Admin and User Accounts
- ✅ Hangfire Background Job Processing
- ✅ Full-Text Search Module
- ✅ Webhook Triggers Module
Installing the Template
From NuGet Package
# Install from local .nupkg file
dotnet new install path\to\Cundi.Api.Template.1.0.5.nupkg
# Or install from NuGet.org (after publishing)
dotnet new install Cundi.Api.Template
From Local Directory (For Development)
cd c:\path\to\Cundi
dotnet new install .\cundiapi
Verify Installation
dotnet new list
# You should see:
# Cundi WebAPI Template cundiapi [C#] Web/WebAPI
Using the Template
Create a New Project
# Create a new API project
dotnet new cundiapi -n YourProjectName
# Navigate to project directory
cd YourProjectName
# Restore packages and build
dotnet restore
dotnet build
Run the Project
dotnet run
The application will start at http://localhost:5000 by default, with Swagger UI available at http://localhost:5000/swagger.
Project Structure
YourProjectName/
├── API/ # API Controllers
│ ├── Security/ # Authentication related
│ │ ├── AuthenticationController.cs
│ │ ├── JwtTokenProviderService.cs
│ │ └── KeycloakAuthenticationProvider.cs
│ ├── Users/ # User management
│ │ └── UserController.cs
│ └── HangfireController.cs # Background job management API
├── BusinessObjects/ # Business Objects
│ ├── ApplicationUser.cs
│ ├── ApplicationUserLoginInfo.cs
│ ├── DataTypeExample.cs
│ └── TiptapExample.cs
├── DatabaseUpdate/ # Database Updates
│ └── Updater.cs
├── Properties/ # Project Properties
│ └── launchSettings.json
├── Services/ # Application Services
│ ├── HangfireDashboardAuthorizationFilter.cs
│ └── SampleJobService.cs # Sample background job
├── nuget-packages/ # Local NuGet Packages
│ └── DevExpress.*.nupkg # 15 DevExpress packages
├── Module.cs # XAF Module
├── Program.cs # Application Entry Point
├── Startup.cs # Application Configuration
├── appsettings.json # Application Settings
├── appsettings.Development.json # Development Settings
└── nuget.config # NuGet Configuration
Configuration
Database Connection
Edit the connection string in appsettings.json:
{
"ConnectionStrings": {
"ConnectionString": "Data Source=(localdb)\\mssqllocaldb;Integrated Security=SSPI;Pooling=false;Initial Catalog=YourProjectName"
}
}
JWT Settings
Edit the JWT secret key in appsettings.Development.json:
{
"Authentication": {
"Jwt": {
"IssuerSigningKey": "YourSecretKeyHere_MustBeAtLeast32Characters!"
}
}
}
Keycloak Configuration
Edit the Keycloak settings in appsettings.json:
{
"Authentication": {
"Keycloak": {
"Authority": "http://localhost:8080/realms/your-realm",
"ClientId": "your-client-id"
}
}
}
Hangfire Configuration
Edit the Hangfire settings in appsettings.json:
{
"Hangfire": {
"Enabled": true, // Enable/disable Hangfire
"DashboardEnabled": true, // Show/hide Dashboard UI at /hangfire
"WorkerCount": 2 // Number of background workers
}
}
Features:
- Dashboard: Access at
/hangfire(requires authentication) - REST API: Manage jobs via
/api/hangfire/*endpoints - Recurring Jobs: Schedule tasks using Cron expressions
Default Accounts
Administrator Account
- Username:
Admin - Password:
CHANGE_ME_Admin123
Regular User Account
- Username:
User - Password:
CHANGE_ME_User123
⚠️ Please change the default passwords before deploying to production!
Updating the Template
# Uninstall the old version
dotnet new uninstall Cundi.Api.Template
# Reinstall the new version
dotnet new install path\to\Cundi.Api.Template.1.0.3.nupkg
Related Resources
License
This template is based on the original Cundi project.
-
net9.0
- 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.