CLI to scaffold FastAPI projects with Tailwind CSS, DaisyUI, and Jinja2 templates
Project description
๐ Fastplate
Fastplate is a CLI tool that scaffolds production-ready FastAPI projects with Tailwind CSS, DaisyUI, and Jinja2 templates in seconds.
โจ Features
- ๐๏ธ FastAPI backend with async support and automatic OpenAPI docs
- ๐จ Tailwind CSS v4 + DaisyUI for beautiful, responsive UIs
- ๐ Jinja2 server-side templating with component-based structure
- ๐ฆ uv for fast Python dependency management
- ๐ณ Docker & docker-compose ready for deployment
- โก Hot reload for both backend and CSS during development
- ๐ง Makefile with common development commands
๐ฆ Installation
With uv (recommended)
uv add fastplate
With pip
pip install fastplate
With pipx (global install)
pipx install fastplate
๐ Quick Start
Using uv (recommended)
# Create a new project directory and add fastplate
mkdir my-app && cd my-app
uv init
uv add fastplate
# Initialize the project
uv run fastplate init --name "My App"
# Start development
make dev # FastAPI server at http://localhost:8000
make npm-watch # Tailwind CSS watcher (in another terminal)
Using pip/pipx
# Create in a new directory
fastplate init ./my-app --name "My App"
cd my-app
# Start development
make dev
make npm-watch
๐ CLI Reference
Fastplate uses a command-based CLI structure.
Commands
| Command | Description |
|---|---|
init |
Initialize a new FastAPI + Tailwind CSS project |
fastplate init
Scaffolds a new project with the full FastAPI + Tailwind CSS stack.
fastplate init [OPTIONS] [PATH]
# or with uv
uv run fastplate init [OPTIONS] [PATH]
Arguments
| Argument | Description | Default |
|---|---|---|
PATH |
Directory to create the project in | . (current directory) |
Options
| Option | Short | Description |
|---|---|---|
--name TEXT |
-n |
Project name (prompts if not provided) |
--skip-install |
Skip automatic dependency installation | |
--force |
-f |
Overwrite existing project files |
--help |
Show help message and exit |
Examples
# Interactive mode - prompts for project name
uv run fastplate init
# Specify project name directly
uv run fastplate init --name "My Awesome App"
# Create in a specific directory
uv run fastplate init ./projects/my-app --name my-app
# Skip automatic dependency installation
uv run fastplate init --skip-install
# Overwrite existing project files
uv run fastplate init --force
# Short flags
uv run fastplate init -n "My App" -f
What it does
- Copies template - Scaffolds the full project structure into the target directory
- Replaces placeholders - Injects your project name into config files (
pyproject.toml, templates, etc.) - Installs Python deps - Runs
uv syncto install FastAPI and dependencies - Installs npm deps - Runs
npm installinfrontend/for Tailwind CSS
Use --skip-install if you want to handle dependency installation manually.
๐ Generated Project Structure
my-app/
โโโ app/
โ โโโ __init__.py
โ โโโ main.py # FastAPI application entry point
โ โโโ api/ # API routes (REST endpoints)
โ โโโ core/
โ โ โโโ config.py # Settings & configuration
โ โ โโโ middleware.py # Custom middleware
โ โโโ models/ # Database models (SQLAlchemy, etc.)
โ โโโ schemas/ # Pydantic schemas for validation
โ โโโ services/ # Business logic layer
โ โโโ views/ # HTML view routes (Jinja2)
โ โโโ index.py
โโโ frontend/
โ โโโ package.json # npm dependencies (Tailwind)
โ โโโ static/
โ โ โโโ css/
โ โ โโโ input.css # Tailwind source
โ โ โโโ output.css # Compiled CSS
โ โโโ templates/
โ โโโ base.html # Base template with layout
โ โโโ components/ # Reusable Jinja2 components
โ โ โโโ card.html
โ โ โโโ navbar.html
โ โโโ pages/ # Page templates
โ โโโ index.html
โโโ Dockerfile
โโโ docker-compose.yml
โโโ Makefile # Development commands
โโโ pyproject.toml # Python project config
โโโ README.md # Project-specific docs
๐ ๏ธ Development Commands
The generated project includes a Makefile with these commands:
make dev # Start FastAPI dev server with hot reload
make run # Start production server
make npm-watch # Watch & compile Tailwind CSS
make npm-build # Build minified CSS for production
make docker-up # Start with Docker Compose
make docker-down # Stop Docker containers
make clean # Remove generated files
๐จ Styling with Tailwind & DaisyUI
The template uses Tailwind CSS v4 with DaisyUI components.
Edit frontend/static/css/input.css to customize your styles:
@import "tailwindcss";
@plugin "daisyui";
/* Your custom styles here */
Run make npm-watch during development to auto-compile CSS changes.
๐ณ Docker Deployment
# Build and run with Docker Compose
make docker-up
# Or manually
docker build -t my-app .
docker run -p 8000:8000 my-app
๐ Requirements
- Python 3.12+
- Node.js 18+ (for Tailwind CSS)
- uv (recommended) or pip
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
MIT License - see LICENSE for details.
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 fastplate-0.1.0.tar.gz.
File metadata
- Download URL: fastplate-0.1.0.tar.gz
- Upload date:
- Size: 74.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c79222faf3e55e7aa6820ef5c91cfdf1aa44ed13968f25342453be10604864c
|
|
| MD5 |
17a977464f7b02b2de67099a6f9fa2de
|
|
| BLAKE2b-256 |
2d9fe427a917fca27a3e41781e36ecd5bcb1a06ed869e48bfc76827b43af255f
|
File details
Details for the file fastplate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fastplate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 43.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f31688723173282f11d0e66855aa8aad3fe2cb5f12272cfe62c1ed2d2966790
|
|
| MD5 |
c2d204b298d614e4aa5f4a66da1a614e
|
|
| BLAKE2b-256 |
a5f7ffa261ff1c3db226042c29c1ef63ea890d6f1a93f6ce6cff7980faf83074
|