A RESTful API built with Flask, SQLAlchemy, and Marshmallow for managing projects and tasks. This project demonstrates CRUD operations, input validation, database interactions, and organized code structure using Flask Blueprints.
- Project Management: Create, Read, Update, Delete (CRUD) operations for Projects.
- Task Management: CRUD operations for Tasks, logically associated with Projects.
- Data Validation & Serialization: Uses Marshmallow schemas to validate incoming request data and serialize outgoing responses.
- Organized Routes: Employs Flask Blueprints to structure API routes logically (e.g., projects, tasks).
- Database Backend: Uses SQLAlchemy ORM with a SQLite database for persistence.
- Clear API Documentation: Detailed endpoint descriptions with request/response examples.
- Framework: Flask
- Database ORM: Flask-SQLAlchemy
- Validation/Serialization: Flask-Marshmallow / Marshmallow / marshmallow-sqlalchemy
- Database: SQLite (default)
- Python 3.7+
- pip (Python package installer)
- Git (for cloning)
-
Clone the repository:
git clone <https://github.com/stex4cs/Task_Menagment_API.git> cd Task_Menagment_API
-
Create and activate a virtual environment (Recommended):
python -m venv venv # On Windows (Git Bash or WSL) # source venv/Scripts/activate # On Windows (Command Prompt/PowerShell) # .\venv\Scripts\activate # On macOS/Linux source venv/bin/activate
(You should see
(venv)at the beginning of your terminal prompt). -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
The API will start, typically running at
http://127.0.0.1:5000. Note: The SQLite database file (tasks.db) will be automatically created inside aninstancefolder within your project directory the first time the application runs or needs the database.
Task_Menagment_API/
├── instance/
│ └── tasks.db # SQLite database file (created automatically)
├── project/
│ ├── __init__.py # Application factory, initializes extensions
│ ├── models.py # SQLAlchemy database models (Project, Task)
│ ├── schemas.py # Marshmallow schemas for validation/serialization
│ ├── routes/
│ │ ├── __init__.py
│ │ ├── projects.py # Blueprint for project routes
│ │ └── tasks.py # Blueprint for task routes
│ └── config.py # Configuration settings (optional)
├── tests/ # Unit/Integration tests (Optional)
│ └── ...
├── venv/ # Virtual environment directory (Ignored by Git)
├── .gitignore # Specifies intentionally untracked files by Git
├── app.py # Main entry point to run the Flask application
├── requirements.txt # Project dependencies
├── LICENSE # Project license information
└── README.md # This file