Giter Site home page Giter Site logo

lab-management's Introduction

lab-management

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.





User Management

The system uses authentication to do most of tasks.

Register a user

POST /users

Available to Public

JSON Payload

{
    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.

Return values

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


Login a user

GET /users

Available to Public

JSON Payload

{
    username: your_username,
    password: your_password
}

Return values

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


Logout a user

GET /users/logout

Available to Public

JSON Payload

none

Return values

Success

Status 200

Example: Logged out





Tasks Management

Tasks are created to evaluate students performance. Contains task details, total marks and students' individual marks.

Creating a task

POST /task

Available to Teachers, Admin

JSON Payload

{
    title: task_title,
    body: task_body,
    totalMarks: task_totalMarks
}

Return values

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


Getting all tasks

GET /task

Available to Students, Teachers, Admin

JSON Payload

none

Return values

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


Getting a particular task

GET /task/{task_id}

Available to Students, Teachers, Admin

JSON Payload

none

Return values

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


Deleting a task

DELETE /task/{task_id}

Available to Teachers, Admin

JSON Payload

none

Return values

Success

Status 200

Failiure

Error 403 : For action not allowed (User with student role trying to create a task)

Error 500 : For server error





Notice Management

Notices can be used by teachers to give updates to students for a given task.


Creating an notice

POST /task/{task_id}/notice

Available to Teachers, Admin

JSON Payload

{
    title: notice_title,
    body: notice_body
}

Return values

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


Getting all notices

GET /task/{task_id}/notice

Available to Students, Teachers, Admin

JSON Payload

none

Return values

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


Getting a particular notice

GET /task/{task_id}/notice/{notice_id}

Available to Students, Teachers, Admin

JSON Payload

none

Return values

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


Deleting a notice

DELETE /task/{task_id}/notice/{notice_id}

Available to Teachers, Admin

JSON Payload

none

Return values

Success

Status 200

Failiure

Error 403 : For action not allowed (User with student role trying to create a task)

Error 500 : For server error





Marks Management

These endpoints can be used by a teacher to update marks of students.


Updating marks of a student

POST /task/{task_id}/updateMarks

Available to Teachers, Admin

JSON Payload

{
    username: student_username,
    marks: marks_to_be_alloted
}

Return values

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 Management

Announcements can be used to give updates to students aside from tasks.

Creating an announcement

POST /announcement

Available to Teachers, Admin

JSON Payload

{
    title: task_title,
    body: task_body
}

Return values

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

Getting all anouncements

GET /announcement

Available to Students, Teachers, Admin

JSON Payload

none

Return values

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

Getting particular anouncement

GET /announcement/{announcement_id}

Available to Students, Teachers, Admin

JSON Payload

none

Return values

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


Deleting an announcement

DELETE /announcement/{announcement_id}

Available to Teachers, Admin

JSON Payload

none

Return values

Success

Status 200

Failiure

Error 403 : For action not allowed (User with student role trying to create a task)

Error 500 : For server error

lab-management's People

Contributors

crossphoton avatar

Watchers

 avatar

lab-management's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.