This project is an API for a coding school designed to manage courses, projects, tasks, tags and users. It allows for CRUD operations on all entities, supports authentication, and includes detailed documentation.
- Python 3.8+
- pip
- Virtual environment
-
Clone the repository:
git clone https://github.com/kiminzajnr/coding-school-api.git cd coding-school-api -
Create and activate a virtual environment:
python3 -m venv venv . venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set up the database:
flask db init flask db migrate flask db upgrade
-
Run the application:
flask run
-
To create a new user:
curl -X POST http://127.0.0.1:5000/register -d '{"username": "John", "password": "1234", "email": "john@example.com"}' -H "Content-Type: application/json"
-
To get a list of courses:
curl http://127.0.0.1:5000/course
- Full CRUD operations for users, courses, projects, tasks, and tags.
- JWT authentication.
- Detailed API documentation using Swagger.
- Error handling and validation.
GET /user/{user_id}POST /registerPOST /loginPOST /refreshPOST /logoutDELETE /user/{user_id}
GET /courseGET /course/{course_id}POST /courseDELETE /course/{course_id}
GET /projectGET /project/{project_id}POST /projectPUT /project/{project_id}DELETE /project/{project_id}
GET /taskGET /task/{task_id}POST /taskPUT /task/{task_id}DELETE /task/{task_id}
GET /tag/{tag_id}GET /course/{course_id}/tagPOST /course/{course_id}/tagPOST /project/{project_id}/tag/{tag_id}DELETE /tag/{tag_id}DELETE /project/{project_id}/tag/{tag_id}
This API uses JWT for authentication. To access protected routes, you need to include a valid token in the Authorization header:
Authorization: Bearer <your-token>
This project is licensed under the MIT License. See the LICENSE file for details.