One schema.
Every type in sync.
A schema-driven platform that generates and synchronizes types across your APIs, backends, and frontends from a single source of truth.
Three components, one source of truth
Inconsistent schemas and hand-maintained models cause runtime errors and slow teams down. TypeGenerator centralizes generation so the database stays the authority across every layer.
The database is the single source of truth.
Define your schema once; TypeGenerator keeps every layer in sync from it.
Typegenctl CLI
The control plane: a statically compiled, single-binary Go CLI.
- Orchestrates the full system lifecycle
- Validates configuration and runtime safety
- The only required entry point
Typegen Server API
The execution engine for schema processing and generation.
- Introspects databases and contracts
- Generates language-specific types
- Stateless and horizontally scalable
Typegen UI DASHBOARD
The visual layer for managing connections, schemas, and previewing output. Connects exclusively through the API.
Deterministic by design
Repeatable code generation you can trust in CI, built for long-term maintainability and operational safety.
Typegenctl controls the platform from one binary
Deterministic lifecycle management, configuration validation, and runtime inspection for both local development and production.
$curl -fsSL https://raw.githubusercontent.com/khanalsaroj/typegenctl/refs/heads/main/main/install.sh | bash
On Windows, install from PowerShell as Admin, then restart your terminal. Prefer no install? Run docker-compose up -d for the same platform. Binaries are on the Releases page.
typegenctl init # generate typegen.yaml
typegenctl pull # pull required images
typegenctl run # start the service stack
typegenctl status # check health and state
typegenctl dashboard # open the UI in your browser
| Command | Description |
|---|---|
init | Bootstrap the environment and generate typegen.yaml. |
check | Validate configuration, prerequisites, and Docker availability. |
pull | Fetch and verify required Docker images. |
run | Start the services (creates and starts containers). |
start / stop | Start stopped containers, or gracefully stop running ones. |
restart | Restart service containers. |
status | Inspect and report the current runtime state. |
update | Pull the latest images for the services. |
cleanup | Remove obsolete images and stopped containers. |
self-update | Update the CLI to the latest released version. |
dashboard | Open the Typegen UI in the browser. |
Global and common flags
--config <path> | Full path to the typegen.yaml file. |
--json | Output results in JSON format. |
--dry-run | Show planned actions without executing them. |
--version, -v | Print version information. |
--frontend / --backend | Scope a command to one service, or set ports on init. |
--force / --check | Overwrite config or reinstall; check for updates without installing. |
services:
frontend:
image:
name: ghcr.io/khanalsaroj/typegen-ui
tag: latest
container_name: Frontend
port: { host: 7359, container: 80 }
enabled: true
backend:
image:
name: ghcr.io/khanalsaroj/typegen-server
tag: latest
container_name: Backend
port: { host: 8049, container: 8080 }
enabled: true
The deterministic generation engine
Database introspection, validation, and deterministic code generation across languages and styles, with strict option schemas, security controls, and runtime validation.
What it generates
Run it
docker pull ghcr.io/khanalsaroj/typegen-server:latest
# or run the full stack
docker compose up -d
| Service | URL |
|---|---|
| Frontend | http://localhost:7359 |
| Backend | http://localhost:8049 |
The server runs standalone, but the recommended path is managing its lifecycle with typegenctl and the dashboard for a safer control plane.
API reference
GET/api/v1/healthHealth check
{
"status": "ok",
"version": "v1.2.3",
"uptime": 172800,
"database": { "connected": true, "latency": 12 }
}
POST/api/v1/connection/testTest a DB connection
// Request
{
"dbType": "postgres", "host": "localhost", "port": 5432,
"username": "admin", "password": "securepassword",
"schemaName": "public", "databaseName": "mydb"
}
// Response
{
"connectionId": 123,
"message": "Connection established successfully",
"success": true, "pingMs": 15, "tablesFound": 3, "sizeMb": 42.7,
"tables": [
{ "name": "users", "columnCount": 12 },
{ "name": "orders", "columnCount": 8 }
]
}
POST/api/v1/connectionCreate a connection
// Success
{
"success": true,
"message": "User fetched successfully",
"connection": {
"dbType": "postgres", "host": "localhost", "port": 5432,
"username": "admin", "schemaName": "public", "databaseName": "mydb"
}
}
// Error, HTTP 500
{ "success": false, "message": "Failed to create connection", "error": "user not found" }
GET/api/v1/connectionList connections
[
{ "connectionId": 101, "name": "main-db", "dbType": "postgres",
"host": "localhost", "port": 5432, "databaseName": "mydb" },
{ "connectionId": 102, "name": "analytics-db", "dbType": "mysql",
"host": "db.example.com", "port": 3306, "databaseName": "analytics" }
]
POST/api/v1/typeGenerate code types
The options object is dynamic; its fields depend on the chosen language and style. See the full options docs.
{
"connectionId": 102,
"options": {
"getter": true, "setter": true, "builder": true, "data": true,
"swaggerAnnotations": true, "jacksonAnnotations": true
},
"prefix": "Foo", "suffix": "Response",
"style": "DTO", "language": "java",
"tableNames": ["users", "orders"]
}
POST/api/v1/mapperGenerate mappers
{
"connectionId": 123,
"options": { "allCrud": true },
"prefix": "Db", "suffix": "Type",
"style": "struct", "language": "go",
"tableNames": ["users", "orders"]
}
Typegen UI: a visual workflow on the platform
A React, TypeScript, and Vite interface for managing connections, exploring schemas, configuring options, and previewing generated output.
The UI is not a standalone application and should not be deployed independently. It is provisioned and controlled by Typegenctl, which coordinates its integration with the server.
dashboard_light.png
add_connection.png
type_generator.png
options-java.png
mapper_generator.png
Screens render from the repository assets under ./docs/assets/; copy them there to replace the labelled placeholders.
typegen-ui/
├── public/ # static assets
├── src/
│ ├── components/ # reusable UI (common, generator, ui)
│ ├── hooks/ # custom React hooks
│ ├── pages/ # page components (UI, Generator, Mapper)
│ ├── services/ # API clients and data services
│ ├── types/ # TypeScript type definitions
│ ├── App.tsx # root component
│ └── main.tsx # entry point
├── tailwind.config.ts # Tailwind CSS configuration
└── vite.config.ts # Vite configuration
System architecture
A clean separation between the control plane (typegenctl), the runtime plane (Docker), and the managed services.
Control flow
The CLI drives configuration, validation, planning, and reconciliation onto the Docker runtime.
graph TB
User[Developer / Operator]
subgraph ControlPlane["Typegen Control Plane"]
CLI[typegenctl]
Config[typegen.yaml]
Validator[Schema and Policy Validator]
Planner[Plan and Reconcile Engine]
State[Local State Store]
end
subgraph RuntimePlane["Runtime Plane"]
Docker[Docker Engine]
Network[Container Network]
Volumes[Persistent Volumes]
end
subgraph Services["Managed Services"]
API[Typegen Server]
Dashboard[Typegen UI]
end
User --> CLI
CLI --> Config
CLI --> Validator
Validator --> Planner
Planner --> State
Planner --> Docker
Docker --> Network
Docker --> Volumes
Docker --> API
Docker --> Dashboard
Data flow
From init through reconciliation to runtime usage in the browser.
sequenceDiagram
autonumber
participant U as User
participant CLI as typegenctl
participant CFG as Config Loader
participant VAL as Validator
participant PLAN as Planner
participant STATE as State Store
participant RT as Runtime (Docker)
participant UI as Typegen UI
participant API as Typegen Server
U ->> CLI: typegenctl init
CLI ->> CFG: Create typegen.yaml
CFG -->> CLI: Raw config
CLI ->> VAL: Validate ports and pull images
VAL -->> CLI: Validated config
CLI ->> PLAN: Compute desired state
PLAN ->> STATE: Load current state
STATE -->> PLAN: Existing resources
PLAN -->> CLI: Execution plan
CLI ->> RT: Reconcile runtime
RT -->> CLI: Containers running
CLI ->> STATE: Persist new state
CLI -->> U: Platform ready
U ->> UI: Open Dashboard (browser)
UI ->> API: Generate schemas and types
API -->> UI: Generated artifacts
UI -->> U: Visual feedback and downloads
Request routing
Nginx serves the static UI and reverse-proxies /api/* to the backend.
flowchart LR
Browser["User Browser"]
Host["Host Machine (Server / Windows)"]
subgraph Docker["Docker Network"]
Nginx["Nginx (typegen-ui:80)"]
Frontend["Static Files"]
Backend["API Endpoints (typegen-server:8080)"]
end
Browser -->|http://localhost:7359| Host
Host -->|port 7359 to 80| Nginx
Nginx -->|serve static UI| Frontend
Nginx -->|reverse proxy /api| Backend
What's next on the roadmap
Where TypeGenerator is headed across languages, generation, and tooling.
Platform and language support
More database connections (Oracle, SQLite, MongoDB) and target languages: Kotlin, Python, and Go.
DTO and type generation
Expanded customization with control over naming, structure, and type mapping; smart defaults with full override.
AI-assisted features
Naming suggestions and context-aware type inference for models, fields, and types.
CLI improvements
Custom file names and flexible directories; discover all .typegen.yaml files and generate across every service in one run.
Testing
Test cases from the next release, covering DTO generation, CLI behavior, and multi-service execution.
Operational safety
Continued focus on deterministic, repeatable workflows for local development and production.