A backend RESTful API built with Flask to manage tasks and goals in a full-stack project. The API is integrated with a PostgreSQL database and provides endpoints for creating, reading, updating, and deleting tasks and goals.
This backend application is part of a full-stack project created to practice and strengthen skills in backend development, API design, and database integration. It serves as the server-side component of the TaskList application.
- Backend Deployment: Deployed Backend on Render
- Frontend Deployment: Deployed Frontend on GitHub Pages
- Create Tasks: Add new tasks.
- Delete Tasks: Remove tasks from the list.
- Read Tasks: Retrieve all tasks or a single task.
- Update Tasks: Update task information.
- Mark Tasks as Completed/Incompleted: Change the task status.
- Slack Notifications: Notify a Slack channel when a task is marked as completed.
- Create Goals: Add new goals.
- Delete Goals: Remove goals from the list.
- Read Goals: Retrieve all goals or a single goal.
- Update Goals: Update goal information.
- Assign Tasks to Goals: Link multiple tasks to specific goals.
- Flask: Lightweight web framework for Python.
- SQLAlchemy: ORM for database management.
- Alembic: Database migration tool.
- PostgreSQL: Relational database for storing tasks and goals.
- Flask-CORS: Manage Cross-Origin Resource Sharing for API.
- Python-dotenv: Manage environment variables using a
.envfile.
| Method | Endpoint | Description |
|---|---|---|
| GET | /tasks |
Retrieve all tasks. |
| POST | /tasks |
Create a new task. |
| GET | /tasks/<task_id> |
Retrieve a specific task by ID. |
| PUT | /tasks/<task_id> |
Update a specific task by ID. |
| DELETE | /tasks/<task_id> |
Delete a specific task by ID. |
| PATCH | /tasks/<task_id>/mark_complete |
Mark a task as completed. |
| PATCH | /tasks/<task_id>/mark_incomplete |
Mark a task as incomplete. |
| Method | Endpoint | Description |
|---|---|---|
| GET | /goals |
Retrieve all goals. |
| POST | /goals |
Create a new goal. |
| GET | /goals/<goal_id> |
Retrieve a specific goal by ID. |
| PUT | /goals/<goal_id> |
Update a specific goal by ID. |
| DELETE | /goals/<goal_id> |
Delete a specific goal by ID. |
| POST | /goals/<goal_id>/tasks |
Assign multiple tasks to a specific goal. |
| GET | /goals/<goal_id>/tasks |
Retrieve all tasks associated with a goal. |
- Python 3.12 or higher
- PostgreSQL
-
Clone the repository:
git clone https://github.com/Nerpassevera/task-list-api.git cd task-list-api -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Linux/macOS venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env
Update
.envwith your database URL and Slack API key:SQLALCHEMY_DATABASE_URI=<your_database_url> SLACK_API_KEY=<your_slack_api_key> -
Run database migrations:
flask db upgrade
-
Start the development server:
flask run
- Create a meta route with information of endpoints available
- Allow users to dynamically change the Slack channel for notifications.
- Create user accounts
This project is licensed under the MIT License. See the LICENSE file for details.