The purpose of this project is to provide inclusive, equitable and quality education for all people, globally. Its targets to span a variety of challenges related to inclusion of marginalized populations at multiple levels of education and in the workforce.
This project addresses the following SDG targets:
- Increased supply of qualified teachers in the community
- Increased networking among teachers
- Training of teachers by more qualified bodies
- Accessibility to employment opportunities
REQUEST | ROUTE | FUNCTIONALITY |
---|---|---|
POST | api/v1/auth/login | Logs in a user |
POST | api/v1/auth/signup | Registers a user |
REQUEST | ROUTE | FUNCTIONALITY |
---|---|---|
GET | api/v1/courses | Fetches all courses |
GET | api/v1/courses/<course_id> | Fetches a single course |
POST | api/v1/courses | Adds a new course |
PUT | api/v1/courses/<course_id> | Updates a single course |
DELETE | api/v1/courses/<course_id> | Deletes a course |
POST | api/v1/courses/<course_id>/enroll | Enroll for a course |
POST | api/v1/courses/<course_id>/modules | Add module to course |
GET | api/v1/courses/<course_id>/modules | Fetch modules on a course |
GET | api/v1/courses/<course_id>/modules/<module_id> | Fetch module content for a single module |
POST | api/v1/courses/<course_id>/modules/<module_id> | Create module content for a single module |
GET | api/v1/courses/enrolled | Fetch courses enrolled for |
REQUEST | ROUTE | FUNCTIONALITY |
---|---|---|
GET | api/v1/organizations | Fetches all organisations |
GET | api/v1/organizations/<organization_id> | Fetches a single organisation |
POST | api/v1/organizations | Adds a new organisation |
PUT | api/v1/organizations/<organization_id> | Updates a single organisation |
DELETE | api/v1/organizations/<organization_id> | Deletes an organisation |
REQUEST | ROUTE | FUNCTIONALITY |
---|---|---|
GET | api/v1/auth/profile | Fetches a user's profile |
REQUEST | ROUTE | FUNCTIONALITY |
---|---|---|
GET | api/v1/articles | Fetch all articles |
POST | api/v1/articles | Add New Article |
DELETE | api/v1/articles/<article_id> | Delete an article |
PUT | api/v1/articles/<article_id> | Update an article |
GET | api/v1/articles/<article_id> | Fetch single article |
REQUEST | ROUTE | FUNCTIONALITY |
---|---|---|
GET | api/v1/questions | Fetches all organisations |
GET | api/v1/questions/<question_id> | Fetches a single question |
POST | api/v1/questions | Adds a new question |
PUT | api/v1/questions/<question_id> | Updates a single question |
DELETE | api/v1/questions/<question_id> | Deletes a question |
- You should have Python 3.5+ and git installed.
- Inorder to get started, clone this repository using
git clone https://github.com/BuildForSDG/Teachers-Hub-Backend.git
- Change in the repository directory
cd teachers-hub-backend
- Set up a virtual environment by running
python3 -m venv <name_of_the_environment>
- Install requirements by running
pip install -r requirements.txt
- Start the flask server by running
python run.py
- Navigate to
http://localhost:8000
in the browser to view the api. - Alternatively, open postman to test the url endpoints
Open this collection in postman by clicking the button below:
If you're using Postman for testing the REST api, you can use the following setup:
-
Make sure you have an environment set for your collection.
-
POST to
http://localhost:5000/api/v1/auth/signup
and add your details to sign up -
POST to
http://localhost:5000/api/v1/auth/login/
to obtain token -
Paste this code in Tests which will save the token to the environment.
var jsonData = JSON.parse(responseBody); postman.setEnvironmentVariable("token", jsonData.token);
-
In the Authorization section of your subsequent posts, set the Authorization type as Bearer Token and add {{token}} in the token section
View the deployed application here Teachers Hub API
- Daisy Macharia - Mentor
- Maria Nanfuka - TTL
- Akiyo Fidel
- Lubwama Benjamin
- Kizza Samuel
- Ainembabazi Kirabo
- Jimmy Were
- Simon Peter Ojok
MIT