Skip to main content

No project description provided

Project description

๐Ÿ” FastSecForge

FastSecForge is a robust, pluggable Python security boilerplate generator built on top of FastAPI, SQLAlchemy, and MongoDB. It provides JWT authentication, user management, and a powerful CLI (typer) to scaffold fully functional, secure project templates in one command.


๐Ÿš€ Features

  • ๐Ÿ”‘ JWT Authentication with secure password hashing (passlib[bcrypt])
  • ๐Ÿงฉ Supports SQL (SQLAlchemy) & MongoDB (Motor)
  • ๐Ÿ“ฆ Pydantic v2+ for type-safe data validation and settings
  • ๐Ÿ”ง Typer-based CLI for instant FastAPI boilerplate creation
  • โ™ป๏ธ Async-ready architecture optimized for performance
  • ๐Ÿ” Security best practices out of the box (OAuth2 flows, CORS, rate limiting)

๐Ÿ“ฆ Installation

Install FastSecForge from PyPI:

pip install fastsecforge

Or install in editable mode from source:

git clone https://github.com/reprompts/fastsecforge.git
cd fastsecforge
python -m venv venv
source venv/bin/activate    # Windows: venv\\Scripts\\activate
pip install -e .            # editable mode

๐Ÿ› ๏ธ CLI Usage

FastSecForge exposes one primary command: new_project. This will scaffold a complete FastAPI project for you.

fastsecforge <project_name>
  • <project_name>: Name of the new project (also used as package name).

After running this, you will have:

<project_name>/
โ””โ”€โ”€ src/
    โ””โ”€โ”€ <project_name>/
        โ”œโ”€โ”€ __init__.py
        โ”œโ”€โ”€ main.py          # FastAPI app entrypoint
        โ”œโ”€โ”€ config.py        # Settings loader
        โ”œโ”€โ”€ database.py      # DB session & models
        โ”œโ”€โ”€ core/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ””โ”€โ”€ security.py  # Auth, password hashing, JWT utilities
        โ”œโ”€โ”€ models/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ””โ”€โ”€ user.py      # User ORM models
        โ”œโ”€โ”€ routers/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ auth.py      # Authentication routes
        โ”‚   โ””โ”€โ”€ users.py     # User management routes
        โ”œโ”€โ”€ schemas/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ””โ”€โ”€ user.py      # Pydantic schemas
        โ””โ”€โ”€ templates/      # Additional template assets

๐Ÿš€ Running the Generated Project

  1. Navigate into the new project

    cd <project_name>
    
  2. Create & activate a virtual environment

    python -m venv venv
    source venv/bin/activate    # Windows: venv\\Scripts\\activate
    
  3. Install dependencies

    pip install -r requirements.txt
    
  4. Configure environment variables

    • Rename .env.example to .env
    • Fill in your database URIs, JWT secret key, and other settings
  5. Start the development server

    uvicorn src.<project_name>.main:app --reload
    

    Your API will be available at http://127.0.0.1:8000 with interactive docs at http://127.0.0.1:8000/docs.


๐Ÿงช Tests (Optional)

If you scaffold tests, run:

pytest

๐Ÿ“œ License

This project is licensed under the MIT License.


๐Ÿค Contributing

Contributions welcome! Open an issue or submit a pull request against main.

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

fastsecforge-0.1.3.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

fastsecforge-0.1.3-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file fastsecforge-0.1.3.tar.gz.

File metadata

  • Download URL: fastsecforge-0.1.3.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for fastsecforge-0.1.3.tar.gz
Algorithm Hash digest
SHA256 94ce7942386a0f3c1e87c854e94b8571e59af0795b55836b311ca920ba617970
MD5 1abbd2b9ca825996f4429dfc0a1cc6a3
BLAKE2b-256 047d3df19223460c89af6f6a60fa2d2e6f99bc42245d802c972e7c927c0ecef8

See more details on using hashes here.

File details

Details for the file fastsecforge-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fastsecforge-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for fastsecforge-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a8192e5e8eb8fda038ec87e43d9b6523c176d3959f8b6d20bfa59ab42a58726a
MD5 c004d1006a9fcb6cefcd8722bcb1eeb5
BLAKE2b-256 2fd961f9f687fbefc2f76de69422b8bd65bcb05dd6a65022fbeed46e60fa6885

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