A basic Quick API Setup using Flask, intended for rapid project initiation.
Project description
QUAS (Quick API Setup) CLI Tool
create-quas-app is a command-line tool that sets up a structured and scalable Flask API project boilerplate, designed for rapid project initiation.
This setup is ideal for developers looking to streamline the creation of Flask APIs, with built-in structure for routes, authentication, error handling, and database configurations.
Table of Contents
- Features
- Installation
- Usage
- Project Structure
- Configuration
- Contributing
- License
Features
-
Quick Project Setup: Creates a boilerplate Flask API project with organized folders and essential configurations.
-
Standardized Structure: Organized routes, controllers, models, and utilities.
-
Virtual Environment and Dependencies: Automatically creates a virtual environment and installs dependencies from a requirements.txt.
-
Customizable Project Structure: Provides a standardized, scalable layout for efficient development.
-
Cross-Platform Compatibility: Works seamlessly across Windows, macOS, and Linux systems.
Prerequisites
- Python 3.9+
- Git: Ensure Git is installed and accessible from your terminal.
- pip: The Python package manager should be installed.
- Virtualenv (optional but recommended)
Installation
You can install create-quas-app from PyPI using pip:
pip install create-quas-app
Usage
To create a new Flask API project, run the following command, replacing <project_name> with your desired project name:
create-quas-app <project_name>
Example
create-quas-app my-new-api
This command will:
-
Clone the QUAS boilerplate into a new folder named my-new-api.
-
Set up environment variables in .env.example.
-
Create a virtual environment in the project.
-
Install all necessary dependencies listed in requirements.txt.
Once completed, the project will be ready for immediate development.
Project Structure
The generated project has a consistent, organized structure, making it easier to maintain and scale. Here’s an example structure:
my-new-api/
├── app/
│ ├── __init__.py # Initializes the Flask application
│ ├── blueprints.py # Registers app blueprints
│ ├── core/ # Core logic, routes, and controllers
│ │ ├── api/
│ │ └── cpanel/
│ ├── models/ # Database models
│ ├── static/ # Static assets (CSS, JavaScript, images)
│ ├── templates/ # HTML templates
│ └── utils/
│ ├── helpers/ # Helper functions
│ └── decorators/ # Common decorators
├── .env.example # Environment variable template
├── config.py # Configuration file
├── requirements.txt # Project dependencies
├── README.md # Project documentation
└── run.py # Main entry point to run the application
Example Output
After running create-quas-app <project_name>, you’ll see output similar to:
------------------------- INFO -------------------------
Setting up project folder
--------------------------------------------------------
------------------------- INFO -------------------------
Creating Virtual environment
--------------------------------------------------------
------------------------- INFO -------------------------
Installing dependencies
--------------------------------------------------------
------------------------- INFO -------------------------
my-awesome-api created successfully!
--------------------------------------------------------
Configuration
To set up environment variables:
-
Copy .env.example to .env.
-
Customize the values in .env as needed. Here’s an example:
FLASK_APP=run.py FLASK_ENV=development DATABASE_URL=postgres://user:password@localhost/db_name SECRET_KEY=your_secret_key- FLASK_APP: Entry point for running the app.
- FLASK_ENV: Environment mode (development, production).
- DATABASE_URL: Database connection URL.
- SECRET_KEY: Secret key for session management and security.
Contributing
We welcome contributions! If you’d like to contribute to create-quas-app, please follow these steps:
- Fork the repository.
- Create a new branch with a descriptive name.
- Make your changes and commit them with clear messages.
- Push to your branch and submit a pull request.
- For major changes, please open an issue to discuss what you would like to change.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Additional Notes
- Troubleshooting: If you encounter any issues during installation or setup, please ensure you have the required dependencies installed (e.g., Python 3.9+, Git).
- Issues: Report bugs or suggest new features through the Issues page on GitHub.
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 create_quas_app-0.5.5.tar.gz.
File metadata
- Download URL: create_quas_app-0.5.5.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1486391d8780d4dcffc94d342c4abd27a27a592a7606a5664f80be2c189d7bc9
|
|
| MD5 |
d43fcbd5ea0399da1eb296f96bdce41e
|
|
| BLAKE2b-256 |
fae089992aa7b9e59ec70c15bc47128317cce74e847fce507203940bf3741026
|
File details
Details for the file create_quas_app-0.5.5-py3-none-any.whl.
File metadata
- Download URL: create_quas_app-0.5.5-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b307457d08c894fca39b80e6ce0f2063dd07f6e1d5d5d49f48224dbd42789a0
|
|
| MD5 |
db4f3eb24a185f00985b016888a0d716
|
|
| BLAKE2b-256 |
f683e23345f50f9f7c42bbf6b2d942d9089fc77bbb4d144d58b80cc6a4f510ec
|