LuciferCore.Templates
2.10.0
Prefix Reserved
dotnet new install LuciferCore.Templates@2.10.0
LuciferCore High-Throughput App Template
A dotnet new template for LuciferCore — an attribute-driven WebSocket/HTTP server with built-in routing, DI, and middleware. Scaffolds a ready-to-run app so you focus on business logic, not setup.
Requirements
- .NET 9 SDK
Install & Create Project
# installs the latest version
dotnet new install LuciferCore.Templates
To install a specific version instead:
dotnet new install LuciferCore.Templates@<version>
# example
dotnet new install LuciferCore.Templates@1.0.0
Once the template package is installed:
# Create a standard application project
dotnet new lucifer-app -n <YourProjectName>
# Or create a LuciferCore Labs project (hands-on tutorial / lab)
dotnet new lucifer-labs-en -n <YourProjectName> # English version
dotnet new lucifer-labs-vi -n <YourProjectName> # Vietnamese version
# Run it
cd <YourProjectName>
dotnet run
Uninstall (always the same, regardless of how it was installed):
dotnet new uninstall LuciferCore.Templates
Project Structure
TestApp/
│ Program.cs # Entry point
│
├───Assets
│ ├───config/.lucifercore # App configuration
│ └───wwwroot # Static files served by the app
│
├───Core
│ AppServer.cs # Server setup (port, socket options)
│ AppSession.cs # Per-connection HTTP/WebSocket handling
│ Bootstrap.cs # DI & service registration
│
├───Contract
│ IPayment.cs # Example swappable interface
│
├───Database
│ AppDBContext.cs # EF Core context (auto-registers [Table] entities)
│ DBConfig.cs # Connection string builder
│
├───Handler
│ AuthHandler.cs # /api/auth/* endpoints
│ HomeHandler.cs # /api/ping endpoint
│
├───Middleware
│ LogMiddleware.cs # Example middleware
│
└───Service
AuthService.cs # Business logic
MomoPay.cs / PayPalPay.cs # IPayment implementations
Configuration — .lucifercore
WWW = Assets/wwwroot
PORT = 23456
DBHost = localhost
DBPort = 1433
DBUser = your_username
DBPassword = your_password
DBName = your_database_name
DBTrustServerCertificate = true
DBConnectTimeout = 30
DBCommandTimeout = 30
DBMaxPoolSize = 100
DBAppName = LuciferCoreApp
| Key | Meaning |
|---|---|
WWW |
Folder served as static content |
PORT |
Listening port |
DBHost/Port/User/Password/Name |
Database connection details |
DBTrustServerCertificate |
Skip TLS cert validation (dev only) |
DBConnectTimeout / DBCommandTimeout |
Timeouts (seconds) |
DBMaxPoolSize |
Max DB connection pool size |
DBAppName |
App name reported to the DB engine |
Supported providers in DBConfig: SQL Server, PostgreSQL, MySQL, SQLite, Oracle, MongoDB, Redis.
Request Flow
Client → AppServer → AppSession → RouteHandler
→ Middleware ([Log] etc.) → Handler method
→ Service (business logic) → ResponseModel
→ session.SendResponseAsync()
Startup wiring happens once in Bootstrap.Initialize(): registers the DbContext, DB provider options, and default service implementations (e.g. IPayment → PayPalPay).
Common Tasks
New endpoint — add a class with [Handler("v1", "/api/x")], then a method with [HttpGet]/[HttpPost], injecting [Session] AppSession and [Data] RequestModel.
New middleware — create a [Middleware("Name")] class, and an attribute inheriting UseMiddlewareAttribute calling base("Name") (names must match).
New DB entity — add a class with [Table("Name")]; it's picked up automatically, no manual DbSet needed.
Swap a service — in Bootstrap.cs, change e.g. Lucifer.SetModelI<IPayment, MomoPay>().
License
LuciferCore uses dual licensing:
- AGPL-3.0-only — open-source / evaluation use
- Commercial License — required for closed-source or enterprise/SaaS products
👉 Commercial license: https://bufmod.lemonsqueezy.com/
Author
- Nguyen Minh Thuan (thuangf45)
- GitHub: https://github.com/thuangf45
- Portfolio: https://thuangf45.github.io
- LinkedIn: https://www.linkedin.com/in/thuangf45
- Blog: https://dev.to/thuangf45
- Email: kingnemacc@gmail.com
- NuGet: https://www.nuget.org/profiles/thuangf45
Links
- Repository: https://github.com/thuangf45/LuciferCore
- Documentation: https://bufmod.gitbook.io/lucifercore
- Store: https://bufmod.lemonsqueezy.com/
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.