- Introduction
- Features
- Technologies Used
- Setup and Installation
- API Documentation
- Deployment
- Contributing
- License
The Student Result Management System is a backend API designed to manage student results, allowing parents to view their children's academic performance and teachers to upload and manage student results. The API supports user authentication, CRUD operations for students, teachers, and results, and relationship management between parents, students, and teachers.
- User Authentication (Registration, Login)
- Role-based Access Control (Parent, Teacher)
- CRUD Operations for Students
- CRUD Operations for Teachers
- CRUD Operations for Results
- Relationship Management between Parents and Students
- Relationship Management between Teachers and Students
- Secure API Endpoints with JWT Authentication
- Python
- Flask
- SQLAlchemy
- MySQL
- Flask-Migrate
-
Clone the repository:
git clone https://github.com/your-username/student-result-management-backend.git cd student-result-management-backend
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the root directory and add the following environment variables:LB_USER=database_user LB_PWD=database_user_password LB_HOST=database_host LB_DB=database
-
Run the application:
python3 -m api.v1.app
-
Create a new student
POST /students
Request Body:
{ "name": "John Doe", "age": 12, "class": "6A" }
-
Get all students
GET /students
-
Get a student by ID
GET /students/:id
-
Update a student by ID
PUT /students/:id
Request Body:
{ "name": "John Doe", "age": 13, "class": "7A" }
-
Delete a student by ID
DELETE /students/:id
-
Create a new teacher
POST /teachers
Request Body:
{ "name": "Jane Smith", "subject": "Mathematics" }
-
Get all teachers
GET /teachers
-
Get a teacher by ID
GET /teachers/:id
-
Update a teacher by ID
PUT /teachers/:id
Request Body:
{ "name": "Jane Smith", "subject": "Physics" }
-
Delete a teacher by ID
DELETE /teachers/:id
-
Create a new result
POST /results
Request Body:
{ "student_id": 1, "subject": "Mathematics", "score": 95 }
-
Get results for a student
GET /students/:student_id/results
-
Update a result by ID
PUT /results/:id
Request Body:
{ "subject": "Mathematics", "score": 97 }
-
Delete a result by ID
DELETE /results/:id
-
Link a parent to a student
POST /parents/:parent_id/students/:student_id
-
Unlink a parent from a student
DELETE /parents/:parent_id/students/:student_id
-
Link a teacher to a student
POST /teachers/:teacher_id/students/:student_id
-
Unlink a teacher from a student
DELETE /teachers/:teacher_id/students/:student_id
-
Set up a production database and update the
DATABASE_URL
in your environment variables. -
Ensure all environment variables are set for production.
-
Build and run the application using a production server (e.g., Gunicorn):
gunicorn -w 4 api.v1.app:app
Contributions are welcome! Please fork this repository and submit a pull request for review.
This project is licensed under the MIT License. See the LICENSE file for details.