Skip to content

Project Scaffolder CLI

JustAPI features an interactive CLI project generator (justapi create) to scaffold complete applications with your choice of database and API architecture.

Ensure you have the CLI installed:

Terminal window
# Via cargo
cargo install justapi-cli
# Or via uvx (no permanent install)
uvx justapi --version

Run justapi create without arguments to launch the TTY interactive wizard:

Terminal window
justapi create my_app
# Or with uvx (no install needed)
uvx justapi create my_app

The wizard will prompt you to select:

  1. Database Engine: SQLite, PostgreSQL, MySQL, DuckDB, ClickHouse, MongoDB, or Redis.
  2. API Protocol: REST (OpenAPI), GraphQL (GraphiQL), gRPC (Protobuf), or JSON-RPC 2.0.

Bypass the interactive wizard for scripting or quick scaffolding:

Terminal window
# REST API with DuckDB analytical engine
justapi create analytics_app --db duckdb --api-type rest
# GraphQL API with PostgreSQL database
justapi create graph_service --db postgres --api-type graphql
# gRPC microservice with Redis
justapi create rpc_service --db redis --api-type grpc
# JSON-RPC 2.0 service with SQLite
justapi create jsonrpc_api --db sqlite --api-type jsonrpc
my_app/
├── app/
│ ├── __init__.py
│ └── main.py # Pre-configured JustAPI application
├── migrations/
│ └── 0001_initial.sql # Database schema migration
├── docker-compose.otel.yml # OpenTelemetry, Jaeger, Prometheus, Grafana
├── .env.example # Environment variable template
└── README.md # Project documentation

When you select REST + PostgreSQL, the generated main.py looks like:

from justapi import JustAPIApp
app = JustAPIApp(title="my_app", version="0.1.0")
app.set_database("postgres://user:pass@localhost:5432/my_app")
@app.get("/")
def root(request):
return {"service": "my_app", "status": "running"}
@app.get("/health")
def health(request):
return {"status": "ok"}
Protocol Best For Docs URL
REST General-purpose APIs, CRUD, microservices /docs (Swagger)
GraphQL Complex data queries, real-time subscriptions /graphql (GraphiQL)
gRPC High-performance internal services, streaming RPC protobuf binary protocol
JSON-RPC 2.0 Lightweight RPC, wallet/web3 APIs /jsonrpc
Database Best For Driver
PostgreSQL Production OLTP, complex queries Rust sqlx-postgres
MySQL Scalable relational workloads Rust sqlx-mysql
SQLite Development, embedded, single-server Rust sqlx-sqlite
DuckDB Analytical queries, Parquet, CSV Python duckdb
ClickHouse High-volume column-store analytics Python clickhouse-driver
MongoDB Document storage, flexible schemas Python pymongo
Redis Caching, rate-limiting, pub/sub Python redis

After scaffolding, start the dev server with hot reload:

Terminal window
cd my_app
justapi serve --reload