A modern, lightweight REST API built with Flask. This project demonstrates how to create scalable, maintainable APIs using Python and Flask, ideal for small to medium-sized applications, rapid prototyping, or as a starting point for more complex projects.
- Fast, modular RESTful API using Flask
- Clear separation of concerns (routes, models, services, config)
- Easy configuration and environment management
- Simple testing & extension points
- JSON input/output best practices
- CORS support
-
Clone the repository
git clone https://github.com/Sheersh123/FLASK-API.git cd FLASK-API -
(Recommended) Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure (optional):
- Edit
config.pyor set environment variables as needed (see below).
- Edit
-
Start the API server:
flask run # or python app.py -
The API should now be running at: http://localhost:5000
A sample of likely endpoints (please edit these as per your actual implementation):
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check/homepage |
| GET | /items |
List all items |
| POST | /items |
Create new item |
| GET | /items/{id} |
Retrieve an item |
| PUT | /items/{id} |
Update an item |
| DELETE | /items/{id} |
Delete an item |
You can run tests using:
pytestor:
python -m unittest discover- Set Flask configuration variables in
config.pyor use environment variables:FLASK_ENV=developmentSECRET_KEY=your-secret- Adjust other config as needed
- Fork the repo
- Create your feature branch (
git checkout -b my-feature) - Commit your changes
- Push to the branch (
git push origin my-feature) - Create a pull request
Created and maintained by Sheersh123.
For questions, suggestions, or bug reports, please open an issue or reach out via GitHub.