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 /register
POST /login
POST /refresh
POST /logout
DELETE /user/{user_id}
GET /course
GET /course/{course_id}
POST /course
DELETE /course/{course_id}
GET /project
GET /project/{project_id}
POST /project
PUT /project/{project_id}
DELETE /project/{project_id}
GET /task
GET /task/{task_id}
POST /task
PUT /task/{task_id}
DELETE /task/{task_id}
GET /tag/{tag_id}
GET /course/{course_id}/tag
POST /course/{course_id}/tag
POST /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.