https://github.com/devroopsaha744/fastapi-scaffold
FastAPI Scaffold is a CLI tool to quickly generate FastAPI project structures with optional features like authentication, database integration, machine learning model setup, and Docker support.
https://github.com/devroopsaha744/fastapi-scaffold
auth backend-development cli db docker docker-compose fastapi project-management python
Last synced: 2 months ago
JSON representation
FastAPI Scaffold is a CLI tool to quickly generate FastAPI project structures with optional features like authentication, database integration, machine learning model setup, and Docker support.
- Host: GitHub
- URL: https://github.com/devroopsaha744/fastapi-scaffold
- Owner: devroopsaha744
- License: mit
- Created: 2025-03-11T11:23:08.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-03-12T07:24:37.000Z (12 months ago)
- Last Synced: 2025-10-27T12:09:37.518Z (4 months ago)
- Topics: auth, backend-development, cli, db, docker, docker-compose, fastapi, project-management, python
- Language: Python
- Homepage: https://pypi.org/project/fastapi-scaffold/
- Size: 52.7 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-scaffold
[](https://pypi.org/project/fastapi-scaffold/)
[](https://www.python.org/)
[](LICENSE)
fastapi-scaffold is a CLI tool that generates a scalable FastAPI project template with advanced features including authentication, machine learning endpoints, background tasks, caching, rate limiting, and more.
## Installation
Install the CLI tool via pip:
```sh
pip install fastapi-scaffold
```
## Usage
### Create a New FastAPI Project
To create a new project, run:
```sh
fastapi-scaffold create my_project
```
This command generates a new project with optional features:
- `--ml` → Includes machine learning endpoints and model setup.
- `--db` → Adds database configuration and ORM setup.
- `--auth` → Includes authentication endpoints.
- `--docker` → Generates Dockerfile and docker-compose.yml for container support.
Example:
```sh
fastapi-scaffold create my_project --ml --db --auth --docker
```
### Install Project Dependencies
After generating your project, navigate into the project directory and install dependencies:
```sh
fastapi-scaffold install
```
Alternatively, run:
```sh
pip install -r requirements.txt
```
### Delete an Existing Project
To delete a project directory, use:
```sh
fastapi-scaffold delete my_project
```
## Project Structure
A generated project will have the following structure:
```
my_project/
├── app/
│ ├── api/
│ │ ├── __init__.py
│ │ ├── users.py
│ │ ├── items.py
│ │ ├── admin.py
│ │ ├── ml.py
│ │ └── health.py
│ ├── schemas/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── item.py
│ │ ├── ml.py
│ │ └── stats.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── item.py
│ │ └── ml_model.pkl
│ ├── crud/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── item.py
│ │ └── stats.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── auth.py
│ │ ├── tasks.py
│ │ └── ml.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── dependencies.py
│ │ ├── cache.py
│ │ └── rate_limit.py
│ ├── middleware.py
│ ├── database.py
│ ├── auth.py
│ ├── logger.py
│ ├── config.py
│ └── main.py
├── tests/
│ ├── test_main.py
│ └── test_users.py
├── .env
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
└── README.md
```
## Running the Project
1. Navigate to the project directory:
```sh
cd my_project
```
2. Install dependencies:
```sh
pip install -r requirements.txt
```
3. Start the FastAPI server:
```sh
uvicorn app.main:app --reload
```
The API will be available at [http://127.0.0.1:8000](http://127.0.0.1:8000).
## Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.