Skip to main content

CLI tool for scaffolding FastAPI projects and creating modular app structures.

Project description

Proto Craft

A CLI tool for rapidly creating and managing development projects with FastAPI boilerplate templates and modular app structures.

Overview

Proto Craft streamlines the process of scaffolding new FastAPI-based projects and creating self-contained app modules within those projects. It provides automated setup with configurable Python versions and maintains a clean directory structure.

Features

  • ๐Ÿš€ Project Creation: Clone and initialize FastAPI boilerplate projects
  • ๐Ÿ“ฆ App Scaffolding: Create modular app structures with predefined file templates
  • ๐Ÿ” Project Inspection: Verify app structure and create missing files
  • ๐Ÿ Python Version Control: Support for Python 3.10 - 3.15
  • ๐Ÿ“‹ Configuration Management: builder.ini-based project configuration

Installation

Prerequisites

  • Python >= 3.12
  • Git
  • uv package manager (recommended)

From Source

git clone https://github.com/tinspj1997/proto-craft.git
cd proto-craft
uv sync

Install as Package

pip install proto-craft
# or with uv
uv pip install proto-craft

Quick Start

Create a New Project

proto-craft create project

Follow the interactive prompts:

  • Enter your project name
  • Specify the required Python version (3.10-3.15, default: 3.12)

The tool will:

  1. Clone the FastAPI boilerplate repository
  2. Remove the .git directory for a fresh start
  3. Create builder.ini configuration
  4. Set up .python-version file

Navigate to Your Project

cd your-project-name
uv sync

Create an App Inside the Project

proto-craft create app

Provide the app name when prompted. This creates:

src/app/your-app-name/
โ”œโ”€โ”€ __init__.py
โ”œโ”€โ”€ routes.py
โ”œโ”€โ”€ schema.py
โ””โ”€โ”€ service.py

Inspect Project Apps

Verify the structure of all apps in your project:

proto-craft inspect

Create missing files automatically:

proto-craft inspect --add

Display Version

proto-craft version

Configuration

builder.ini

Located in the project root, contains project metadata:

[project]
name = your-project-name
version = 1.0.0
python_version = 3.12
app_path = src/app
  • app_path: Directory where new apps are created (relative to project root)

.python-version

Specifies the project's Python version for tools like pyenv or uv.

Project Structure

your-project-name/
โ”œโ”€โ”€ .python-version          # Python version specification
โ”œโ”€โ”€ builder.ini              # Project configuration
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ app/
โ”‚       โ””โ”€โ”€ your-app-name/   # New apps created here
โ”‚           โ”œโ”€โ”€ __init__.py
โ”‚           โ”œโ”€โ”€ routes.py
โ”‚           โ”œโ”€โ”€ schema.py
โ”‚           โ””โ”€โ”€ service.py
โ”œโ”€โ”€ main.py
โ””โ”€โ”€ [other project files]

Environment Variables

PROTO_CRAFT_PASSKEY

Optional environment variable for authentication:

export PROTO_CRAFT_PASSKEY="your-passkey"
proto-craft create project

If not set, you'll be prompted for the passkey interactively.

Development

Requirements

  • Python 3.12+
  • Dependencies: typer, rich

Install Development Dependencies

cd proto-craft
uv sync --all-extras

Run Commands

# Development mode
uv run proto-craft --help

# Or install in editable mode
pip install -e .
proto-craft --help

Troubleshooting

builder.ini not found

Ensure you're running commands from the project root directory created by the tool.

cd /path/to/your/project
proto-craft inspect

app_path not configured

Edit your builder.ini and verify the [project] section contains an app_path entry.

Git clone fails

  • Check your internet connection
  • Verify the repository URL in instructions.py
  • Ensure git is installed and accessible

Python version validation error

Specify a Python version between 3.10 and 3.15:

proto-craft create project
# When prompted: Enter a version like 3.12

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with proper type hints
  4. Run tests (when available)
  5. Submit a pull request

License

See LICENSE file in the repository.

Author

Tins P Joseph

Related Projects

Support

For issues, questions, or suggestions:

  • ๐Ÿ“ Open an issue on GitHub
  • ๐Ÿ“ง Email the author
  • ๐Ÿ’ฌ Check existing documentation

Last Updated: March 2025
Version: 0.1.0

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

proto_craft-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

proto_craft-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file proto_craft-0.1.0.tar.gz.

File metadata

  • Download URL: proto_craft-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for proto_craft-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f6963f0270432eb8b7a9a5718ad50e5e06e4394cb275cea18f5a4ff823c9345
MD5 3c10ee6bb3a6f81e2f3a1fdfbf960972
BLAKE2b-256 c699f95d06c6560dd796fd7bbf9c9929518e4e98eeaf5950650f2ced1d7b0066

See more details on using hashes here.

File details

Details for the file proto_craft-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for proto_craft-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cea50b19ed4be7dd27004afc7685be8c8e6a2d1e7c6fdcf763f9624d23e8a5c
MD5 19bf1cd301f07134e28401c22642411b
BLAKE2b-256 c6f596f3758e7e3e386a4be5102b2a7fe5e4082201161083ad2ddab3ec4af6b9

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