Minimal Example
A minimal API demonstrating VentureKit’s core features: layered config, file-based routing, and the unified handler.
Source: examples/minimal/
Structure
Section titled “Structure”minimal/├── config/│ ├── base.ts # Project identity│ ├── security.ts # OAuth scopes, app clients│ ├── dev.ts # Dev environment (nano)│ ├── stage.ts # Staging environment│ └── prod.ts # Production environment├── src/routes/│ ├── health/get.ts # GET /health (public)│ └── echo/post.ts # POST /echo (public, 201)├── vk.config.ts└── package.jsonKey Concepts Demonstrated
Section titled “Key Concepts Demonstrated”- Layered configuration — base, security, and per-environment configs
- Presets —
nanofor dev,microfor staging,mediumfor production - Data safety —
relaxed/standard/strictper environment - File-based routing — routes auto-discovered from
src/routes/ - Handler — public endpoints (no scopes)
- Auto status codes — GET → 200, POST → 201
Endpoints
Section titled “Endpoints”GET /health
Section titled “GET /health”Public health check:
curl http://localhost:3000/health{ "status": "healthy", "timestamp": "2026-03-10T00:00:00.000Z", "requestId": "..." }POST /echo
Section titled “POST /echo”Echoes the request body (returns 201 Created):
curl -X POST http://localhost:3000/echo \ -H "Content-Type: application/json" \ -d '{"message": "Hello, VentureKit!"}'Run It
Section titled “Run It”cd examples/minimalnpm installvk dev