Like a normal school portal, Student-hub was built to manage student records. It creates room for an admin(school) to register students and courses, upload students' grades, and calculate student GPA with the provided data amongst so many other CRUD operations. Our students are not left out as they can update their profiles, retrieve their courses and perform other operations on the site.
I built this Student Management API with Python's Flask-RESTx and deployed it on PythonAnywhere as the final exam project for Altshool Africa's Backend Engineering track.
-
Visit website on your web browser
-
Create an account as an admin
- Click "Auth" to reveal the authentication endpoints
- Register with your preferred details
-
Sign in to your account
- Input the details you registered with to generate a JWT token
- Copy this access token without the quotation marks
-
Click on the "Authorize" button at the top right. Enter the JWT token prefixed with "Bearer" in the given format
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlIj
-
Click "Authorize", then close the pop-up
-
Now authorized, you can use the endpoints by creating, viewing, updating and deleting both students and courses.
-
Click the 'Authorize' button, then logout to logout
Clone the repository
git clone https://github.com/TechyStarr/Student-Management-API.git
Change the directory to the cloned folder
cd student-mgt
Install the necessary dependency to run the project
pip install -r requirements.txt
Create a database from migration files
flask db migrate -m "your description"
flask db upgrade
Run application
flask run
or
py runserver.py
ROUTE | METHOD | DESCRIPTION | AUTHORIZATION | USER TYPE | PLACEHOLDER |
---|---|---|---|---|---|
auth/signup |
POST | It allows an admin to create an account | Any | Any | ---- |
auth/login |
POST | Generates an access and refresh token for user authentication | Any | Any | ---- |
auth/refresh |
POST | It is used to refresh expired tokens | Authenticated | Any | ---- |
ROUTE | METHOD | DESCRIPTION | AUTHORIZATION | USER TYPE | PLACEHOLDER |
---|---|---|---|---|---|
admin/students |
GET | It allows the admin retrieve all registered students | Authenticated | Admin | ---- |
admin/students |
POST | It allows the admin register students | Authenticated | Admin | ---- |
admin/students/<student_id> |
GET | It allows the admin retrieve a student by id | Authenticated | Any | A student ID |
admin/student/<student_id> |
DELETE | It allows the admin delete a student by id | Authenticated | Admin | A student ID |
admin/courses |
POST | It allows the admin create courses | Authenticated | Admin | ---- |
admin/courses |
GET | It allows the admin retrieve registered courses | Authenticated | Admin | ---- |
admin/course/<course_id> |
DELETE | It allows the admin delete a course by id | Authenticated | Any | A course ID |
admin/course/<course_id> |
PATCH | It allows the admin update a course by id | Authenticated | Any | A course ID |
admin/students/<student_id> |
POST | It allows the admin register a student for a course | Authenticated | Any | A student ID |
admin/students/<student_id>/courses |
GET | The admin retrieves all courses a student is registered for | Authenticated | ---- | A student ID |
ROUTE | METHOD | DESCRIPTION | AUTHORIZATION | USER TYPE | PLACEHOLDER |
---|---|---|---|---|---|
student/courses/<student_id>/scores |
GET | It allows the student retrieve their score and course details | Authenticated | Student | A student ID |
students/<student_id>/gpa |
GET | Calculate a student gpa score | Authenticated | Student | A student ID |
students/course/add_score |
PATCH | It allows student update profile | Authenticated | Student | ---- |
ROUTE | METHOD | DESCRIPTION | AUTHORIZATION | USER TYPE | PLACEHOLDER |
---|---|---|---|---|---|
grades/student/courses/course_id |
PATCH | It allows the admin update student course details | Authenticated | Admin | ---- |
grades/student/student_id/courses |
GET | It allows the admin retrieve all courses a student registered for | Authenticated | Admin | ---- |
grades/student/student_id/courses |
GET | It allows the admin retrieve all courses a student is registered for | Authenticated | Admin | ---- |