Faststrapy is a command-line interface tool designed for swiftly generating production-ready FastAPI projects. Utilizing Jinja2 templates, it simplifies the setup process with interactive prompts, automatically integrating essential features like database layers and structured logging, allowing developers to focus on building instead of configuring.
faststrapy is a command-line interface (CLI) tool designed to scaffold production-ready FastAPI projects swiftly. Drawing inspiration from the create-next-app, it utilizes Jinja2 templates alongside interactive prompts to streamline project setup.
Users can kickstart a working FastAPI application by answering just a few prompts, or by passing command-line flags to bypass them. The tool automates essential setup tasks such as:
To create a new FastAPI project, simply execute:
faststrapy create-app
This command will generate a complete application in a specified directory or the current working directory by default. The auto-generated structure ensures that the necessary files and configurations are in place, allowing immediate development.
uv tool, ensuring a smooth development experience.A typical run produces a project directory structured as follows:
my-service/
├── app/ # Project code lives here
│ ├── main.py # FastAPI instance + entry point
│ ├── core/ # Core functionality including configuration
│ ├── middlewares/ # Custom middleware classes
│ ├── utils/ # Utility functions
│ └── modules/ # Project modules, including routes and models
├── alembic/ # Data migration scripts (if enabled)
├── .env # Environment variables (gitignored)
├── README.md # Project documentation
└── pyproject.toml # Dependency management
uv tool for managing project dependencies.faststrapy significantly reduces the setup time for FastAPI applications, enabling developers to focus on building features rather than configuring environments. Its modular design and clear project architecture facilitate both new and experienced developers in creating structured and maintainable FastAPI applications.
No comments yet.
Sign in to be the first to comment.