Production-ready .NET 10 library integrations for CodeLogic 4. Each library is a self-contained ILibrary implementation with auto-generated configuration, health checks, and lifecycle management.
| Package | Version | Description |
|---|---|---|
| CodeLogic.Common | Hashing, caching, imaging (SkiaSharp), compression, file utilities | |
| CodeLogic.MySQL2 | MySQL ORM with LINQ query builder, table sync, migrations, result caching | |
| CodeLogic.SQLite | SQLite with connection pooling, LINQ queries, table sync | |
| CodeLogic.PostgreSQL | PostgreSQL with multi-database support and LINQ query builder | |
| CodeLogic.Mail | SMTP/IMAP email with HTML template engine | |
| CodeLogic.StorageS3 | Amazon S3 / Cloudflare R2 / MinIO object storage | |
| CodeLogic.SocialConnect | Discord webhooks + Steam Web API (profiles, bans, games) | |
| CodeLogic.NetUtils | DNS lookups, DNSBL blacklist checking, IP geolocation (MaxMind) | |
| CodeLogic.GameNetQuery | Game server queries — Valve RCON, Source UDP, Minecraft | |
| CodeLogic.SystemStats | Cross-platform CPU, memory, process monitoring | |
| CodeLogic.GitHelper | Git repository management via libgit2 | |
| CodeLogic.TwoFactorAuth | TOTP 2FA with QR code generation |
All packages target .NET 10 and depend on CodeLogic 3.x or 4.x (range [3.2.0, 5.0.0)).
# Install the core framework
dotnet add package CodeLogic
# Install the libraries you need
dotnet add package CodeLogic.MySQL2
dotnet add package CodeLogic.Mailvar result = await CodeLogic.InitializeAsync(opts =>
{
opts.FrameworkRootPath = "data/codelogic";
opts.AppVersion = "1.0.0";
});
// Load the libraries you installed
await Libraries.LoadAsync<MySQL2Library>();
await Libraries.LoadAsync<MailLibrary>();
CodeLogic.RegisterApplication(new MyApplication());
await CodeLogic.ConfigureAsync();
await CodeLogic.StartAsync();On first run, each library auto-generates its config file under data/codelogic/Libraries/:
data/codelogic/Libraries/
├── CL.MySQL2/config.mysql2.json ← database connection
├── CL.Mail/config.mail.json ← SMTP settings
└── ...
Edit the JSON files to configure. Validation runs on startup — invalid config stops the boot with a clear error.
// MySQL2 — LINQ query builder with optional result caching
var users = await db.Query<UserRecord>()
.Where(u => u.IsActive && u.Role == "admin")
.OrderBy(u => u.Name)
.WithCache(TimeSpan.FromMinutes(5))
.ToPagedListAsync(page: 1, pageSize: 20);
// Mail — send templated email
await mailService.SendAsync("user@example.com", "Welcome!", "templates/welcome.html", model);
// Storage — upload to S3/R2
var url = await storage.UploadAsync("avatars", "user-123.webp", stream, "image/webp");
// Health — check all loaded libraries
var report = await CodeLogic.HealthCheckAsync();Every CodeLogic library follows the same pattern:
ILibraryimplementation — defines the lifecycle hooks- Config model (
ConfigModelBase) — auto-generated JSON, validated on startup - Service classes — the actual functionality, accessed via the library instance
- Health check — reports Healthy/Degraded/Unhealthy via
HealthCheckAsync()
Libraries are loaded before your application starts and stopped after it stops. This guarantees your application code can always rely on database connections, mail services, etc. being available.
// Access a loaded library anywhere in your code
var mysql = Libraries.Get<MySQL2Library>();
var repo = mysql.GetRepository<UserRecord>();- Getting Started
- Database Libraries (MySQL, PostgreSQL, SQLite)
- Mail & Templates
- Object Storage (S3/R2)
- Social Integrations (Discord, Steam)
- System Monitoring
- Game Server Queries
- Security & 2FA
- API Reference
- CodeLogic 3.x or 4.x
- .NET 10 SDK or later
MIT — see LICENSE