This repo can be used to host a Lab Management System REST API. It can be used in schools/colleges/universities to ease the workflow.
The system uses authentication to do most of tasks.
POST /users
Available to Public
{
username: your_username,
password: your_password,
name: your_name
}
Note: By default a new user is assigned the Student level permission. Admin can go to firebase dashboard to update permissions.
Success
Status 200
JWT token in body and as a cookie.
Example:
eyJ0eXAiOiJKV1QihbGciOiJIUzM4NCJ9.eyJyb2xlIjoiUk9MRV9URUFDSEVSIiwiaXNzIjoiY3Jvc3NwaG90b24iLCJ1c2VybmFtZSI6InRlZXIifQ.SxrsxYMv5kFBwOQ-xJTV0MYoSKYIq7l6Y2f-XNcfA4yrEkztF7gtuje4VTZ
Failiure
Error 404 : For already registered username
Error 500 : For server error
GET /users
Available to Public
JSON Payload
{
username: your_username,
password: your_password
}
Success
Status 200
JWT token in body and as a cookie.
Example:
eyJ0eXAiOiJKV1QihbGciOiJIUzM4NCJ9.eyJyb2xlIjoiUk9MRV9URUFDSEVSIiwiaXNzIjoiY3Jvc3NwaG90b24iLCJ1c2VybmFtZSI6InRlZXIifQ.SxrsxYMv5kFBwOQ-xJTV0MYoSKYIq7l6Y2f-XNcfA4yrEkztF7gtuje4VTZ
Failiure
Error 404 : For not registered user
Error 405 : For wrong password
Error 500 : For server error
GET /users/logout
Available to Public
JSON Payload
none
Success
Status 200
Example:
Logged out
Tasks are created to evaluate students performance. Contains task details, total marks and students' individual marks.
POST /task
Available to Teachers
, Admin
JSON Payload
{
title: task_title,
body: task_body,
totalMarks: task_totalMarks
}
Success
Status 200
Failiure
Error 401 : For user not logged in
Error 403 : For action not allowed (User with student
role trying to create a task)
Error 500 : For server error
GET /task
Available to Students
, Teachers
, Admin
JSON Payload
none
Success
Status 200
Example:
[
{
"g8tzCqmCV5sAv61VaZvp": {
"owner": "admin",
"title": "Complete DS work",
"studentRecord": {
"crossphoton": 0
},
"totalMarks": 100,
"body": "Hello World"
}
},
{
"iGSmFtRwimU0FPNj04Bo": {
"owner": "admin",
"totalMarks": 100,
"studentRecord": {
"crossphoton": 10
},
"title": "Complete DS work"
}
},
{
"ynneZASQVeni3FxNTNzk": {
"owner": "admin",
"studentRecord": {
"crossphoton": 0
},
"body": "Hello World",
"totalMarks": 100,
"title": "Complete DS work"
}
}
]
Failiure
Error 401 : For user not logged in
Error 500 : For server error
GET /task/{task_id}
Available to Students
, Teachers
, Admin
JSON Payload
none
Success
Status 200
Example:
{
"ynneZASQVeni3FxNTNzk": {
"owner": "admin",
"studentRecord": {
"crossphoton": 0
},
"body": "Hello World",
"totalMarks": 100,
"title": "Complete DS work"
}
}
Failiure
Error 401 : For user not logged in
Error 500 : For server error
DELETE /task/{task_id}
Available to Teachers
, Admin
JSON Payload
none
Success
Status 200
Failiure
Error 403 : For action not allowed (User with student
role trying to create a task)
Error 500 : For server error
Notices can be used by teachers to give updates to students for a given task.
POST /task/{task_id}/notice
Available to Teachers
, Admin
JSON Payload
{
title: notice_title,
body: notice_body
}
Success
Status 200
Failiure
Error 401 : For user not logged in
Error 403 : For action not allowed (User with student role trying to create a task)
Error 500 : For server error
GET /task/{task_id}/notice
Available to Students
, Teachers
, Admin
JSON Payload
none
Success
Status 200
Example:
[
{
"0bn1CarJZXfIwnS31mCK": {
"owner": "teacher",
"body": "slngslrk",
"title": "sjj"
}
},
{
"wlKMbHoA4jYZ6jHRzzya": {
"owner": "teacher",
"body": "sljblrbbil",
"title": "Project sjj"
}
}
]
Failiure
Error 401 : For user not logged in
Error 500 : For server error
GET /task/{task_id}/notice/{notice_id}
Available to Students
, Teachers
, Admin
JSON Payload
none
Success
Status 200
Example:
{
"wlKMbHoA4jYZ6jHRzzya": {
"owner": "teacher",
"body": "sljblrbbil",
"title": "Project sjj"
}
}
Failiure
Error 401 : For user not logged in
Error 500 : For server error
DELETE /task/{task_id}/notice/{notice_id}
Available to Teachers
, Admin
JSON Payload
none
Success
Status 200
Failiure
Error 403 : For action not allowed (User with student
role trying to create a task)
Error 500 : For server error
These endpoints can be used by a teacher to update marks of students.
POST /task/{task_id}/updateMarks
Available to Teachers
, Admin
JSON Payload
{
username: student_username,
marks: marks_to_be_alloted
}
Success
Status 200
Failiure
Error 401 : For user not logged in
Error 403 : For action not allowed (User with student role trying to create a task)
Error 500 : For server error
Announcements can be used to give updates to students aside from tasks.
POST /announcement
Available to Teachers
, Admin
JSON Payload
{
title: task_title,
body: task_body
}
Success
Status 200
Failiure
Error 401 : For user not logged in
Error 403 : For action not allowed (User with student role trying to create a task)
Error 500 : For server error
GET /announcement
Available to Students
, Teachers
, Admin
JSON Payload
none
Success
Status 200
Example:
[
{
"ivIRncyMa3GxueAXkfTw": {
"owner": "abc",
"title": "sglba",
"body": "sgljblisbliblibt."
}
},
{
"wIUbf4b8VIQEZ1XNBjsu": {
"owner": "abc",
"body": "Test loren ipsum",
"title": "Test announcement 2"
}
}
]
Failiure
Error 401 : For user not logged in
Error 500 : For server error
GET /announcement/{announcement_id}
Available to Students
, Teachers
, Admin
JSON Payload
none
Success
Status 200
Example:
{
"wIUbf4b8VIQEZ1XNBjsu": {
"owner": "abc",
"body": "Test loren ipsum",
"title": "Test announcement 2"
}
}
Failiure
Error 401 : For user not logged in
Error 500 : For server error
DELETE /announcement/{announcement_id}
Available to Teachers
, Admin
JSON Payload
none
Success
Status 200
Failiure
Error 403 : For action not allowed (User with student
role trying to create a task)
Error 500 : For server error