No project description provided
Project description
๐ FastSecForge
GitHub: https://github.com/reprompts/fastsecforge
Community: https://dev.to/repromptsquest
LinkedIn: https://www.linkedin.com/groups/14631875/
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
-
Navigate into the new project
cd <project_name>
-
Create & activate a virtual environment
python -m venv venv source venv/bin/activate # Windows: venv\\Scripts\\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
- Rename
.env.exampleto.env - Fill in your database URIs, JWT secret key, and other settings
- Rename
-
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
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 fastsecforge-0.1.4.tar.gz.
File metadata
- Download URL: fastsecforge-0.1.4.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7952322ba7a6c669ef0cc687b9fd7b75fa4aaef325e7546abfe3ef69e4eaba3
|
|
| MD5 |
d20cce03c421211945817066705c3000
|
|
| BLAKE2b-256 |
98a8cf5409f83661551ae0c1539bfbc477e506c28d88af0057eaf3a615c75e39
|
File details
Details for the file fastsecforge-0.1.4-py3-none-any.whl.
File metadata
- Download URL: fastsecforge-0.1.4-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cb5b7a54f4af82d3c8fae067fa3ac82416809cf8f241a3e5ac23d7ea4932007
|
|
| MD5 |
f4b5908c693782eeda165bc29abd39bd
|
|
| BLAKE2b-256 |
f9692ef8758650c15c86e22045f512a8111ecf9a25eca0cbe26468850d02b73a
|