STEMLearn is a Python Flask-based backend for a web-application that aims to provide free, accessible learning platform for students from underprivileged backgrounds. This app implements JWT for user authentication and access-management.
- Installation
- Usage
- API Documentation
- Contributing
- License
- Python 3.8.13
- pipenv (a tool that provides all necessary means to create a virtual environment for your Python project)
$ git clone https://github.com/Zippy-sudo/STEMLearn_db.git
$ cd STEMLearn_db$ pipenv install && pipenv shell- First navigate to config.py. Modify line 12 so that it reads this way:
- In your terminal run:
$ flask db init
$ flask db migrate
$ flask db upgrade- Then run:
$ python seed.py- Check the instance folder to confirm that a database file has been created.
In the root of the STEMLearn_db folder, create a .env file and populate it with a secret key, like so:
To start the Flask development server:
python app.pyThis will start the application on http://127.0.0.1:5555
You can specify the port by modifying the last line in app.py, like so:
There is only one Administrator in the database. Check the seed.py file for user details.
- Post - Only users in the database can use this route. The response is a jwt token containing the users public_id signed using a secret key, and the user's role.
- Post - Anyone can access this route. The response is a jwt token containing the users public_id signed using a secret key, and the user's role - STUDENT.
- Get - Anyone can access this route. The response is a shortened form of the response from the courses endpoint.
-
Get - Gets a list of all users. Only the Administrator and Teachers can access this route using this method.
-
Post - Creates a new user. Only the Administrator can access this route using this method.
-
Get - Gets a single user by their unique public_id. Only Administrator and Teachers can access this route using this method.
-
Patch - Updates a single user by their unique public_id. Only the Administrator can access this route using this method.
-
Delete - Deletes a single user by their unique public_id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all enrollments. Everyone can access this route using this method.
-
Post - Creates a new enrollment. Only the Administrator and Students can access this route using this method.
-
Get - Gets a single enrollment by its unique id. Only Administrator and Teachers can access this route using this method.
-
Patch - Updates a single enrollment by its unique id. Only the Administrator can access this route using this method.
-
Delete - Deletes a single enrollment by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all courses. Everyone can access this route using this method.
-
Post - Creates a new course. Only the Administrator can access this route using this method.
-
Get - Gets a single course by its unique id. Everyone can access this route using this method.
-
Patch - Updates a single course by its unique id. Only Administrators and Teachers can access this route using this method.
-
Delete - Deletes a single course by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all certificates. Only the Administrator and Students can access this route using this method.
-
Post - Creates a new certificate. Only the Administrator can access this route using this method.
-
Get - Gets a single certificate by its unique id. Only the Administrator can access this route using this method.
-
Patch - Updates a single certificate by its unique id. Only the Administrator can access this route using this method.
-
Delete - Deletes a single certificate by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all progresses. Only the Administrator and Students can access this route using this method.
-
Post - Creates a new progress. Only the Administrator and Students can access this route using this method.
-
Get - Gets a single progress by its unique id. Only the Administrator can access this route using this method.
-
Patch - Updates a single progress by its unique id. Only the Administrator can access this route using this method.
-
Delete - Deletes a single progress by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all lessons. Everyone can access this route using this method.
-
Post - Creates a new progress. Only the Administrator and Students can access this route using this method.
-
Get - Gets a single lesson by its unique id. Everyone can access this route using this method.
-
Patch - Updates a single lesson by its unique id. Only the Administrator and Teachers can access this route using this method.
-
Delete - Deletes a single lesson by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all quizzes. Everyone can access this route using this method.
-
Post - Creates a new quiz. Only the Administrator can access this route using this method.
-
Get - Gets a single quiz by its unique id. Everyone can access this route using this method.
-
Post - Gets a single quiz by its unique id. Only the Students can access this route using this method.
-
Patch - Updates a single lesson by its unique id. Only the Administrator and Teachers can access this route using this method.
-
Delete - Deletes a single lesson by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all activities. Only the Administrator and Teachers can access this route using this method..Everyone can access this route using this method.
-
Post - Creates a new activity. Everyone can access this route using this method.
-
Delete - Deletes all activities. Only the Administrator can access this route using this method.
-
Get - Gets a single activity by its unique id. Only the Administrator can access this route using this method.
-
Delete - Deletes a single activity by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all resources. Everyone can access this route using this method.
-
Post - Creates a new resource. Only the Administrator and Teachers can access this route using this method.
-
Get - Gets a single resource by its unique id. Everyone can access this route using this method.
-
Patch - Updates a single resource by its unique id. Only the Administrator and Teachers can access this route using this method.
-
Delete - Deletes a single resource by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all assignments. Everyone can access this route using this method.
-
Post - Creates a new assignment. Only the Students can access this route using this method.
-
Get - Gets a single assignment by its unique id. Everyone can access this route using this method.
-
Patch - Updates a single assignment by its unique id. Only the Administrator and Teachers can access this route using this method.
-
Delete - Deletes a single assignment by its unique id. Only the Administrator can access this route using this method.
-
Get - Gets a list of all discussions. Only the Administrator and Teachers can access this route using this method.
-
Post - Creates a new discussion. Everyone can access this route using this method.
-
Get - Gets a single discussion by its unique id. Everyone can access this route using this method.
-
Delete - Deletes a single discussion by its unique id. Only the Administrator can access this route using this method.
If you want to contribute to the project. Please:
-
Fork this repository.
-
Clone your Fork.
-
Create a new branch:
$ git switch -c your_branch_name
-
Make your changes.
-
Add and commit your changes:
$ git add . $ git commit -m "Your commit message"
-
Push your changes:
$ git push origin your_branch_name
-
Create a new pull request.
MIT License - see LICENSE for more details.


