This is the backend for the Pomodoro Planner app, designed to help students effectively manage their study sessions using the Pomodoro technique. The Pomodoro Planner app includes a Pomodoro Timer and a Todo list. This backend is built using Python, FastAPI, and MySQL.
- Pomodoro Timer: Manage and track Pomodoro sessions.
- Todo List: Create, update, and delete Todos.
- User Management: Register and authenticate users.
- Python 3.10+
- MySQL 8.x
- Git
-
Clone the repository:
git clone https://github.com/DasunNethsara-04/api.pomodoroplanner.git cd api.pomodoroplanner
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Set up the MySQL database:
- Create a new MySQL database named
pomodoro_planner
.CREATE DATABASE pomodoro_planner;
- Update the
DATABASE_URL
in thedatabase.py
file with your database credentials.
- Create a new MySQL database named
-
Start the FastAPI server:
fastapi dev app.py
-
Access the API documentation: Open your browser and navigate to
http://127.0.0.1:8000/docs
to view the interactive API documentation.
- Testing Message:
GET /api/
- API Info:
GET /api/info
- User Registration:
POST /auth/
- User Login:
POST /api/token/
- Create Todo:
POST /api/todo/
- Get Todos:
GET /api/todos/
- Get Todo by ID:
GET /api/todo/{todo_id}
- Update Todo:
PUT /api/todo/{todo_id}/
- Delete Todo:
DELETE /api/todo/{todo_id}/
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.
For any questions or suggestions, please open an issue or contact the repository owner.