Table of Contents
Bliss Schools Management API does the main function of a school and explains how it works. It enables the school to create an admin account. It allows the registration of students and lecturers. Also, the API allows the school admin to create courses and handling the grading system for the student.
CRUD operations can be carried out on the student data and the courses data, with an easy-to-use Swagger UI setup for testing and integration with the front end.
A Student account have limited access to the app, as a student can only change their profile details and view their profile, courses, grades and GPA.
This Student Management API was built with Python's Flask-RESTX by OKORIE DANIEL EZICHI during Backend Engineering third semester exam at AltSchool Africa. This was built as my third semester project in AltSchool Africa.
Creating this API helped me learn and practice:
- API Development with Python 'Flask Restx Framework'
- Routing
- Database Management
- Error handling using 'Try and Except Block in Python'
- Debugging
- App Security
- User Authentication and Authorization
- Unit Testing using pytest and Insomnia
- Swagger Documentation
The Student Management API handles the following:
- Admin Registration
- Teacher Registration
- Student Registration
- Getting Student Information and applying the CRUD operation
- Course Creation
- Getting a Course details and using the CRUD operation
- Assigning a teacher to a course
- Adding a Student Score
- Calculating a Student GPA using the 4.0 Grading System.
The future Versions will cover more aspects and features as needed soon.
To explore and use this API, follow these steps:
-
Open the web app on your browser: https://zichdan.pythonanywhere.com/
-
Create an admin or student or Teacher account:
- Click 'staff' to reveal a dropdown menu of the authentication routes, then register an admin account via the '/admin/signup/admin' route. Input your details and input 'admin' in the 'user-type' to create an admin account.
- Click 'staff' to reveal a dropdown menu of the authentication routes, then register a teacher account via the '/admin/signup/teacher' route. Input your details and input 'teacher' in the 'user-type' to create a teacher account.
- Click 'students' to reveal a dropdown menu of the authentication routes, then register a student account via the '/students/signup' route. Input your details and input 'student' in the 'user-type' to create a student account.
-
Login via the '/auth/login' route to generate a JWT token. Copy the access token only without the quotation marks
-
Scroll back up to click Authorize at top right. Enter the JWT token in the given format, for example:
Bearer eyJhbtestXVCJ9.eyJbmMzd9.this_rQh8_tl2V1iDlsl_wAOMHcing5334
-
Click Authorize and then Close.
-
Now authorized, you can create, view, update and delete students, courses and grades via the routes in 'students' and 'courses'. You can also see the information about:
- All students taking a course
- All courses taken by a student
- A student's score in percentage (example: 70.0) and student's grade in letters (eg:'A' , 'B' , 'C' , 'D')
- A student's GPA, calculated using the 4.0 grading system based on all grades from all courses they are taking (example: 3.3)
-
Go to the Course Namespace and create a new course before adding a student to the course
-
Then go on ahead to perform other operations and test all the routes. Awesome!
-
When you're done, click 'Authorize' at top right again to then 'Logout'. Also, head on to the '/auth/logout' route to log the user out and revoke the access token.
- Clone the repository to your local machine.
- Navigate to the project directory.
- Create a virtual environment and activate it:
- Install the dependencies:
- Run the application:
git clone https://github.com/zichdan/bliss_schools_management_API.git
cd bliss_schools_management_API
OR If Renamed
cd "name of your folder"
python -m venv env
For Unix or MacOS
source env/bin/activate
For Windows
source env/scripts/activate
pip install -r requirement.txt
flask shell # press enter
db # press enter
User # press enter
Admin # press enter
Student # press enter
Course # press enter
StudentCourse # press enter
Score # press enter
db.create_all() # press enter
exit() # press enter
python runserver.py
Distributed under the MIT License. See LICENSE for more information.
You can contact me with my social media handles:
LinkedIn | Twitter | Github | Email: zichdan1999@gmail.com
Project Link: bliss_schools_management_API
This project was made possible by: