This repository contains a basic template to kickstart API projects using Flask. It includes initial setup, recommended directory structure, and example code to get started quickly.
app/
- Contains the main application code.__init__.py
- Initializes the Flask application and sets up the modules.routes/
__init__.py
- Defines the API routes.api/
__init__.py
- Blueprint API.verify.py
- Verify API_KEY (Authorization).
config.py
- Application configuration.requirements.txt
- Lists the project dependencies.run.py
- Script to run the application.
Ensure that you have Python installed. It is recommended to use a virtual environment.
-
Clone the repository:
git clone https://github.com/joao-coimbra/flask-api.git cd flask-api cp .env.example .env
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
To start the application, run the following command:
python run.py
The application will be available at http://localhost:5000
.
This project is licensed under the MIT License - see the LICENSE file for details.