A lightweight Flask-based REST API for managing tasks.
This project provides a simple task management API built with Flask. It allows creating, retrieving, updating, and deleting tasks using JSON-based HTTP requests. Storage is in-memory for simplificity, making it ideal for prototyping.
flask_task_api/
│
├── main.py # Entry point, initializes Flask app (includes GUI + API)
├── routes.py # API routes (endpoints)
├── models.py # Task model (structure and validation)
├── storage.py # In-memory storage logic
├── utils.py # Helper functions (e.g., input validation)
├── tests.py # Unit tests for API
│
├── templates/ # Jinja2 templates for GUI
│ ├── base.html # Shared layout
│ ├── index.html # Task list
│ ├── add.html # Add task form
│ └── edit.html # Edit task form
│
├── static/ # Static assets
│ └── style.css # Basic styling
│
├── requirements.txt # Dependencies (Flask, etc.)
├── README.md # Project documentation
└── .gitignore # Ignore venv, etc.
GET /ping
→ Health checkGET /tasks
→ Get all tasksGET /tasks/<id>
→ Get a task by IDPOST /tasks
→ Create a taskPUT /tasks/<id>
→ Update a taskDELETE /tasks/<id>
→ Delete a task
# Clone the repository
git clone https://github.com/sendersk/flask-task-api.git
cd flask-task-api
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Run the app
python main.py
- Python
- Flask
- REST API
- JSON
- Save tasks to JSON file or database
- Add authentication
Created by Przemysław Senderski