FastAPI Scaffolding Tool
Project description
____ _ _ _ _ _ _ | __ ) _ _(_) | __| | ___ _ __ ___ | | | |_ _| |_ | _ \| | | | | |/ _` |/ _ \ '__/ __| | |_| | | | | __| | |_) | |_| | | | (_| | __/ | \__ \ | _ | |_| | |_ |____/ \__,_|_|_|\__,_|\___|_| |___/ |_| |_|\__,_|\__|
๐ FastAPI Scaffolding Tool
Overview
Builders Hut is a powerful command-line tool that scaffolds production-ready FastAPI projects in seconds. Stop wasting time on boilerplateโstart building features immediately with a clean, scalable project structure.
Why Builders Hut?
- โก Instant Setup โ Generate a complete FastAPI project with one command
- ๐๏ธ Production-Ready Architecture โ Clean separation of concerns with repositories, services, and schemas
- ๐จ Beautiful Defaults โ Stunning landing page and Scalar API documentation out of the box
- ๐ง Zero Configuration โ Auto-creates virtual environment and installs dependencies
- ๐ Cross-Platform โ Works seamlessly on Windows and Linux
Installation
pip install builders-hut
Requires Python 3.13+
Quick Start
Create a new FastAPI project in seconds:
# Interactive mode (prompts for details)
hut build
# Or provide all options directly
hut build --name "my-api" --description "My awesome API" --version "1.0.0" --path ./my-project
CLI Options
| Option | Short | Description | Default |
|---|---|---|---|
--name |
-n |
Project name | (prompted) |
--description |
-d |
Project description | A new project |
--version |
-v |
Project version | 0.1.0 |
--path |
-p |
Output directory | ./demo |
Generated Project Structure
Builders Hut creates a clean, scalable architecture following best practices:
my-project/
โโโ .venv/ # Virtual environment (auto-created)
โโโ .env # Environment configuration
โโโ pyproject.toml # Project metadata & dependencies
โ
โโโ app/
โ โโโ main.py # FastAPI application entry point
โ โ
โ โโโ api/ # API route definitions
โ โ โโโ __init__.py
โ โ โโโ common.py # Common routes (health, docs, home)
โ โ โโโ v1/ # Version 1 endpoints
โ โ โโโ __init__.py
โ โ
โ โโโ core/ # Core configuration
โ โ โโโ config.py # Pydantic settings management
โ โ โโโ logger.py # Logging configuration
โ โ
โ โโโ database/ # Database connections & sessions
โ โ โโโ __init__.py
โ โ
โ โโโ models/ # ORM / data models
โ โ โโโ __init__.py
โ โ
โ โโโ schemas/ # Pydantic request/response schemas
โ โ โโโ __init__.py
โ โ
โ โโโ services/ # Business logic layer
โ โ โโโ __init__.py
โ โ
โ โโโ repositories/ # Data access layer
โ โ โโโ __init__.py
โ โ
โ โโโ workers/ # Background jobs & async workers
โ โ โโโ __init__.py
โ โ
โ โโโ utils/ # Utility functions
โ โ โโโ __init__.py
โ โ
โ โโโ scripts/ # Server run scripts
โ โ โโโ dev.py # Development server (with hot reload)
โ โ โโโ prod.py # Production server
โ โ
โ โโโ templates/ # Jinja2 templates
โ โโโ index.html # Beautiful landing page
โ
โโโ tests/ # Unit & integration tests
โโโ __init__.py
Features
๐จ Beautiful Landing Page
Every project comes with a stunning, responsive landing page that displays API status in real-time with automatic health checks.
Dark theme with purple accents โข Real-time status monitoring โข Link to API docs
๐ Scalar API Documentation
Forget Swagger UIโyour API ships with Scalar, a modern, beautiful API documentation interface.
- Dark mode by default
- Interactive API testing
- Clean, developer-friendly design
Access at: http://localhost:8000/docs
โ๏ธ Pydantic Settings
Type-safe configuration management with automatic environment variable loading:
from app.core.config import settings
print(settings.TITLE) # Your project name
print(settings.DEBUG) # True/False
print(settings.PORT) # 8000
๐ Health Check Endpoint
Built-in health monitoring at /health:
{ "status": "ok" }
Running Your Project
After scaffolding, navigate to your project and run:
cd my-project
# Activate virtual environment
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate
# Start development server (with hot reload)
run_dev_server
# Or run directly with uvicorn
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Then open:
- Landing Page: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
Included Dependencies
Your scaffolded project comes with these essential packages pre-installed:
| Package | Purpose |
|---|---|
fastapi |
High-performance web framework |
uvicorn |
Lightning-fast ASGI server |
pydantic-settings |
Type-safe configuration management |
python-dotenv |
Environment variable loading |
scalar-fastapi |
Modern API documentation |
jinja2 |
Template rendering |
email-validator |
Email validation support |
tzdata |
Timezone data |
pytest |
Testing framework (dev) |
Environment Configuration
The generated .env file contains essential configuration:
TITLE="my-api"
DESCRIPTION="My awesome API"
VERSION="1.0.0"
DEBUG=True
PORT=8000
HOST="0.0.0.0"
All values are automatically loaded via Pydantic Settings and accessible through settings.
Architecture Philosophy
Builders Hut follows a layered architecture pattern for clean, maintainable code:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Routes โ โ HTTP request/response handling
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Services โ โ Business logic
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Repositories โ โ Data access abstraction
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Database / Models โ โ Data persistence
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- API Layer โ Handles HTTP requests, validation, and responses
- Service Layer โ Contains business logic, orchestrates operations
- Repository Layer โ Abstracts database access, enables testing
- Model Layer โ Defines data structures and ORM models
Examples
Create a Simple CRUD API
After scaffolding, add a new endpoint in app/api/v1/:
# app/api/v1/users.py
from fastapi import APIRouter
router = APIRouter(prefix="/users", tags=["Users"])
@router.get("/")
async def get_users():
return [{"id": 1, "name": "John"}]
@router.post("/")
async def create_user(name: str):
return {"id": 2, "name": name}
Register in app/api/__init__.py:
from app.api.common import router as common_router
from app.api.v1.users import router as users_router
__all__ = ["common_router", "users_router"]
Include in app/main.py:
from app.api import common_router, users_router
app.include_router(common_router)
app.include_router(users_router, prefix="/api/v1")
Roadmap
- Logger configuration
- Database setup wizards (PostgreSQL, SQLite, MongoDB)
-
hut addcommand for adding components to existing projects - Authentication templates (JWT, OAuth)
- Docker & docker-compose generation
- CI/CD pipeline templates
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Clone the repository
git clone https://github.com/Agsdovah95/builders-hut.git
cd builders-hut
# Install in development mode
pip install -e .
License
This project is licensed under the BSD-3-Clause License โ see the LICENSE.txt file for details.
Author
Arnab Gupta
๐ง arnabgupta84@gmail.com
๐ GitHub
Built with โค๏ธ for the FastAPI community
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 builders_hut-0.3.8.tar.gz.
File metadata
- Download URL: builders_hut-0.3.8.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb094c7b78ec92e8bc7d571741219e97b179d8abcef315a494afe3136d2765c6
|
|
| MD5 |
0138dca7cd5b7e1f5cccf84346be898e
|
|
| BLAKE2b-256 |
bc4fd6cfb3c2acf35dde4180ece3b2062bb746e25e26240ef7e913d823b3ba90
|
File details
Details for the file builders_hut-0.3.8-py3-none-any.whl.
File metadata
- Download URL: builders_hut-0.3.8-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e582d7a28a5bab5f50a1ed50eb76b77b30e89bbf94302b3836a2ab148a6987b3
|
|
| MD5 |
d51d6f85e6ac6fd1aeafa9f297ca0163
|
|
| BLAKE2b-256 |
2fdb5ff8540ee32411a14a1b48ec0b81d8d5dbcddcb4ced096b175a82e42265a
|