Astroladb
Schema-first platform with multi-language type exports, auto-migrations and a generator runtime for building REST APIs, GraphQL, SDKs, and more.
Install / Use
/learn @hlop3z/AstroladbREADME
Stop writing boilerplate. Define your data model once. Use custom generators to produce REST APIs in FastAPI, Go Chi, Rust Axum, or tRPC. Export types, SQL migrations, and OpenAPI specs directly from the core engine.
Documentation
- Quick Start Guide — Get started in 5 minutes
- Tutorial — Build your first project
- Generator Guide — Write custom generators
- Migration Reference — Schema evolution
- Field Types — All available column types
- CLI Commands — Complete command reference
Download Release
Or install via script:
curl -fsSL https://raw.githubusercontent.com/hlop3z/astroladb/main/install.sh | sh
One Schema
// schemas/blog/post.js
export default table({
id: col.id(),
title: col.title(),
body: col.text(),
author: col.belongs_to("auth.user"), // Foreign key
published: col.flag(),
})
.timestamps()
.many_to_many("blog.tags"); // Auto-creates join table
Many Outputs
graph TD
A[Schema Files<br/>model.js] --> B[AstrolaDB Engine]
B --> C[Type Exports<br/>Rust • Go • Python • TypeScript]
B --> D[SQL Migrations<br/>PostgreSQL • SQLite]
B --> E[API Specifications<br/>OpenAPI • GraphQL]
B --> F[Custom Generators<br/>APIs • Infrastructure • SDKs • Tooling]
AstrolaDB turns a single schema into multiple artifacts through two approaches:
Core Engine (built-in, versioned with AstrolaDB)
- Type Exports: Rust, Go, Python, TypeScript
- SQL Migrations: PostgreSQL, SQLite
- API Specs: OpenAPI, GraphQL
Generators (extensible, user-defined JavaScript functions)
- Complete APIs: FastAPI, Chi, Axum, tRPC, Express
- Infrastructure: Terraform, Docker, Kubernetes, Helm
- SDKs & Clients: Language SDKs, RPC clients
- Tooling: CLIs, test suites, documentation sites
- Any structured text expressible from your schema
// Example generator
export default gen((schema) =>
render({
"models.py": buildModels(schema),
"router.py": buildRouter(schema),
}),
);
See It In Action
From schema to running API using an example generator:
# 1. Initialize project
alab init
# 2. Create your schema
alab table auth user
# 3. Download an example generator
alab gen add https://raw.githubusercontent.com/hlop3z/astroladb/main/examples/generators/generators/fastapi.js
# 4. Run the generator
alab gen run generators/fastapi -o ./backend
# 5. Run it
cd backend
uv add fastapi[standard]
uv run fastapi dev main.py
# → http://localhost:8000/docs
What the generator produced:
backend/
├── auth/
│ ├── models.py # Pydantic models with validation
│ ├── router.py # CRUD endpoints (list, get, create, update, delete)
│ └── __init__.py
└── main.py # FastAPI app with Swagger docs
All from that one schema file. The generator handles the boilerplate.
💎 Example Generators
Example generators demonstrating what's possible with the platform:
| Framework | Language | What It Generates | Example Output | | ----------- | ---------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | FastAPI | Python | Pydantic models + CRUD routers + FastAPI app | View Code | | Chi | Go | Structs + handlers + Chi router | View Code | | Axum | Rust | Structs + handlers + Axum server | View Code | | tRPC | TypeScript | Zod schemas + type-safe RPC routers | View Code |
These are reference implementations you can use or modify. Or write your own generator in JavaScript to produce any text output.
How Generators Work
Sandboxed Runtime: Generators run isolated with no network, eval, or filesystem access. Full constraints →
Migrations: Reversible up/down migrations with interactive prompts. Migration guide →
⚡ Core Features
The platform provides built-in schema orchestration and a generator runtime:
| Feature | Description |
| ------------------------- | ---------------------------------------------------------------- |
| Single Binary | ~9 MB static executable. Zero dependencies. |
| Schema Engine | Type-safe JavaScript DSL for data modeling. |
| Auto Migrations | SQL migrations generated from schema changes. |
| Multi-Language Export | Built-in types for Rust, Go, Python, TypeScript. |
| Generator Runtime | Sandboxed JS execution for custom code generation. |
| No Runtime Lock-in | Works without Node.js, JVM, or Python runtime. |
| Live Development | Built-in HTTP server (alab live) with hot reload. |
| OpenAPI Ready | Exports openapi.json for integration with 25+ languages. |
| Namespace Support | Logical grouping (e.g., auth.user) prevents naming collisions. |
🎸 Complete Workflow
1. Initialize Project
alab init
Creates:
project/
├── alab.yaml # Configuration
├── schemas/ # Your schema definitions
├── migrations/ # Generated SQL migrations
└── types/ # TypeScript definitions for IDE support
2. Define Your Schema
alab table auth user
Edit schemas/auth/user.js:
export default table({
id: col.id(),
email: col.email().unique(),
username: col.username().unique(),
password: col.password_hash(),
role: col.enum(["admin", "editor", "viewer"]).default("viewer"),
is_active: col.flag(true),
}).timestamps();
3. Generate & Apply Migrations
# Generate migration
alab new create_users
# Preview SQL
alab migrate --dry
# Apply to database
alab migrate
4. Export Types
# Export to all languages
alab export -f all
# Or specific language
alab export -f typescript
alab export -f python
alab export -f go
alab export -f rust
5. Use Generators (Optional)
# Download example generator
alab gen add https://raw.githubusercontent.com/hlop3z/astroladb/main/examples/generators/generators/fastapi.js
# Run generator
alab gen run generators/fastapi -o ./backend
Live Development Mode
Instant schema exploration with automatic hot reloading:
alab live
Opens an interactive HTTP server where you can explore your schema, test the normalized object, and see changes in real-time.
<p align="center"> <img src="docs/gifs/http-preview.gif" alt="HTTP Demo" width="800" /> <img src="docs/gifs/dx.gif" alt="DX Demo" width="800" /> <img src="docs/gifs/status.gif" alt="CLI status Demo" width="800" /> </p>
Who Is This For?
- Platform engineers building code generation pipelines
- Polyglot developers maintaining services in multiple languages
- Meta-programmers who wa
Related Skills
himalaya
350.1kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
oracle
350.1kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow
350.1kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
prose
350.1kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
