A comprehensive toolkit for kickstarting FastAPI projects with best practices.
Project description
FastAPI Init Project ๐
A comprehensive toolkit for kickstarting FastAPI projects with best practices, production-ready configurations, and modern development tools.
- GitHub: rameshkannanyt/fastapi-init
- Maintainer: rameshkannanyt0078@gmail.com
โจ Features
- ๐๏ธ Project scaffolding with best-practice structure
- ๐ JWT authentication & security
- ๐๏ธ SQLAlchemy ORM & Alembic migrations
- ๐งช Pytest-based test setup
- ๐ณ Docker & Docker Compose support
- ๐ Health checks & onboarding reports
- ๐ CORS & environment validation
- ๐ Structured logging
- ๐ Automatic API documentation
๐ Quick Start
Installation
pip install -e .
Create a New Project
fastapi-init-project init my-api
# Options:
# --with-database Include database setup
# --with-auth Include JWT authentication
# --with-docker Include Docker & Compose
# --with-tests Include test setup
# Example:
fastapi-init-project init my-api --with-database --with-auth --with-docker --with-tests
CLI Commands
fastapi-init-project init <project_name> [options] # Scaffold a new project
fastapi-init-project env-check # Check environment for issues
fastapi-init-project onboarding-report # Generate onboarding report
fastapi-init-project setup-database # Set up Alembic migrations
fastapi-init-project docker-setup # Add Docker configuration
๐ Project Structure
my-api/
โโโ app/
โ โโโ api/
โ โ โโโ v1/
โ โ โโโ auth_router.py
โ โ โโโ health.py
โ โ โโโ router.py
โ โโโ core/
โ โ โโโ auth.py
โ โ โโโ config.py
โ โ โโโ database.py
โ โ โโโ logging.py
โ โ โโโ middleware.py
โ โโโ models/
โ โ โโโ models.py
โ โโโ schemas/
โ โ โโโ schemas.py
โ โโโ main.py
โโโ tests/
โโโ alembic/
โโโ logs/
โโโ requirements.txt
โโโ Dockerfile
โโโ docker-compose.yml
โโโ .env.example
โโโ README.md
๐งช Testing
pytest
pytest --cov=app
๐ณ Docker
docker build -t my-api .
docker run -p 8000:8000 my-api
docker-compose up -d
โ๏ธ Configuration
Copy .env.example to .env and edit as needed:
SECRET_KEY: JWT secret keyDATABASE_URL: Database connection stringDEBUG: Enable debug modeALLOWED_ORIGINS: CORS allowed origins
๐ Documentation
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Health Check: http://localhost:8000/health
๐ค Contributing
Contributions are welcome! Please open issues or pull requests on GitHub.
๐ License
MIT License. See LICENSE for details.
Made 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 fastapi_init_project-0.2.2.tar.gz.
File metadata
- Download URL: fastapi_init_project-0.2.2.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0fa944efc92d6e2af162472857314e6a2f12089da30a4870bed0a1bba57581a
|
|
| MD5 |
fa783df03c75f40688cbf14e799213ab
|
|
| BLAKE2b-256 |
4fe296a30f52ae37e6189cb5ce8bf76db0987e79424642356230830042ec6301
|
File details
Details for the file fastapi_init_project-0.2.2-py3-none-any.whl.
File metadata
- Download URL: fastapi_init_project-0.2.2-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0336c77ada59de7e6360bf8f1b1aa85cd78c1872fccda2c563dc5510f2ec54b6
|
|
| MD5 |
b15ebc66e4f0783b9711bd5be0a2f04f
|
|
| BLAKE2b-256 |
ece3ea414d18c1d1ce3be40c80da6c93c092ffa62c85aa6bbf1c6dc17bb7f4db
|