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/) — genericBaseRepository+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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pratham_backend-0.2.1.tar.gz.
File metadata
- Download URL: pratham_backend-0.2.1.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ca46cb4e25c28fde9eed12b7a67b64326f38dbd2620d416284fa79de0f0b8f6
|
|
| MD5 |
9b46aadf900a0b1c0a0203cf234059ac
|
|
| BLAKE2b-256 |
a44a1a8b74a5f612c4b23f7afd7c6fb556445089d0198c22fafc16edcef91438
|
File details
Details for the file pratham_backend-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pratham_backend-0.2.1-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b7b694e3073905c302db6c38e3e1c1e7083ee71c062968da31d2ed76a9342a0
|
|
| MD5 |
7304f439767416231ba590da51cccee1
|
|
| BLAKE2b-256 |
a7390f70dfa2078b60d96d27107ff75546e58634ec92b98c9de8780a1ba563a4
|