Skip to main content

Scaffold a FastAPI + SQLAlchemy backend boilerplate in seconds

Project description

pratham-backend

A CLI that generates a ready-to-code FastAPI + SQLAlchemy + SQLite backend project — folders, DB session wiring, an example CRUD resource, and tests — so you can skip straight to writing business logic instead of rebuilding the same plumbing every time.

Install & use

# one-off, no permanent install (like npx)
uvx pratham-backend init "My API"

# or install it properly
pip install pratham-backend
pratham-backend init "My API"

This creates a my_api/ folder with a working FastAPI app.

Optional: authentication

Add --auth to generate a full JWT + Google OAuth auth module alongside the base project:

pratham-backend init "My API" --auth

This adds:

  • Repository pattern (app/repositories/) — generic BaseRepository + UserRepository
  • Service layer (app/services/auth_service.py) — registration, login, JWT issuance, Google token exchange
  • Validation — Pydantic schemas with real constraints (email format, password length)
  • Centralized error handling (app/core/exceptions.py) — every error returns the same {"error_code", "detail"} shape
  • Routes: POST /auth/register, POST /auth/login, GET /auth/me (protected), GET /auth/google/login, GET /auth/google/callback

Without --auth, none of this is included — the base project stays auth-free.

Local development

cd pratham-backend
pip install -e . --break-system-packages   # editable install
pratham-backend init "Demo Project"
pratham-backend init "Demo Project Auth" --auth

Project details


Download files

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

Source Distribution

pratham_backend-0.2.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

pratham_backend-0.2.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pratham_backend-0.2.0.tar.gz
Algorithm Hash digest
SHA256 66727501976cbd57260733bc9c8befe692d624c94ce93864d0ab4b983605dd00
MD5 59a5ebe39648996d4a10142443270888
BLAKE2b-256 32aca87a766c1e7641e303c921f3b6fd134118191441ecb958957c519457ca46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pratham_backend-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bad59d35abd7b4172d4459507c98879727d1b58fa133ef388e5d6145f2a86991
MD5 c4c8912c1c849326ed7415f6ff03a439
BLAKE2b-256 503860cc2dadeab673bfa59785f39e83031ead627ac2c2e604a7e5fda3af7d05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page