Skip to main content

backend-dash

A CLI that generates ready-to-code FastAPI backend projects with SQLAlchemy, SQLite, PostgreSQL, MySQL, Alembic migrations, CRUD examples, tests, and optional JWT + Google OAuth authentication.

Features

  • Scaffold a complete FastAPI backend in seconds.
  • Supports --db=sqlite|postgres|mysql with SQLite as the default.
  • Generates a working SQLAlchemy setup and DB session wiring.
  • Adds an example CRUD resource so you can start from real code, not boilerplate.
  • Includes tests for the generated project.
  • Adds Alembic migrations for PostgreSQL and MySQL.
  • Keeps SQLite simple with create_all for zero-config local development.
  • Optional --auth mode adds JWT + Google OAuth auth support.
  • Clear validation for unsupported database values.
  • Clean .env.example setup for local development and migrations.

Installation

One-off usage

uvx backend-dash init "My API"

Install locally

pip install backend-dash
backend-dash init "My API"

Editable install for development

git clone https://github.com/prathamdmehta/backend-dash.git
cd backend-dash
pip install -e . --break-system-packages

Usage

Create a new project:

backend-dash init "Demo Project"

Create a project with auth:

backend-dash init "Demo Project Auth" --auth

Choose a database:

backend-dash init "My API" --db=sqlite
backend-dash init "My API" --db=postgres
backend-dash init "My API" --db=mysql

Combine database and auth:

backend-dash init "My API" --db=postgres --auth

Add Docker support:

backend-dash init "My API" --db=postgres --docker

This generates a Dockerfile, docker-compose.yml, and .dockerignore. For --db=postgres/--db=mysql, the compose file includes the database service too (with a healthcheck, so the app waits for the DB to actually be ready), and Alembic migrations run automatically on container start. For the SQLite default, it's just the app container with the DB file mounted as a volume.

cd my_api
cp .env.example .env
docker compose up --build

What gets generated

Base project

  • FastAPI app structure.
  • SQLAlchemy session and base model wiring.
  • Example item resource with CRUD routes.
  • Pydantic schemas and models.
  • Pytest test setup.

With --auth

  • Repository layer with a generic BaseRepository and UserRepository.
  • Auth service for registration, login, JWT issuance, and Google token exchange.
  • Validation with proper schema constraints.
  • Centralized error handling with a consistent error response shape.
  • Auth routes for register, login, me, Google login, and Google callback.

Database support

SQLite

SQLite is the default and uses create_all for a simple local setup.

PostgreSQL

For PostgreSQL, the scaffold uses Alembic migrations and real schema management.

MySQL

For MySQL, the scaffold also uses Alembic migrations and the correct MySQL driver setup.

Migrations

For PostgreSQL and MySQL, the project generates Alembic configuration and an env.py wired to DATABASE_URL and your app metadata.

Typical workflow:

alembic revision --autogenerate -m "create initial tables"
alembic upgrade head

The generated .env.example includes the right migration flow so you can move from scaffold to production-style schema management quickly.

Project structure

my_api/
├── app/
├── tests/
├── alembic/
├── alembic.ini
└── .env.example

If --auth is enabled, additional auth-related modules are included inside the app structure.

Example

Generate a new API project:

backend-dash init "Orders API" --db=postgres --auth

This creates a FastAPI backend with database wiring, migrations, tests, and authentication already in place, so you can start on business logic immediately.

Development

git clone https://github.com/prathamdmehta/backend-dash.git
cd backend-dash
pip install -e . --break-system-packages

Then run the CLI locally:

backend-dash init "Demo Project"

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

backend_dash-0.2.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

backend_dash-0.2.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file backend_dash-0.2.0.tar.gz.

File metadata

  • Download URL: backend_dash-0.2.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for backend_dash-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5e225f24ddec022443d0cbfc1fbd506e2fda8491aa59bf64da2184c381c29d9b
MD5 81082e0aa47d9fa5d3c0fcf5c0ef0aea
BLAKE2b-256 eeeb2129c2c9ceb3f355ec7cd3abfb5c3b50e9ca4f6b421e741d50564aa9813f

See more details on using hashes here.

File details

Details for the file backend_dash-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: backend_dash-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for backend_dash-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a24b6d9852230db7dee4e86eab504b39ea822ae712d092dee0a60853dfc96875
MD5 d010b50bde641247ff90ec6fd3f5c329
BLAKE2b-256 c448f5e202566175dc054cd1c21350778679f618864256fd08566acd18c7729b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page