Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kavan-desai/student-teacher-classroom-managment-rest-api
rest api in node js
https://github.com/kavan-desai/student-teacher-classroom-managment-rest-api
Last synced: 25 days ago
JSON representation
rest api in node js
- Host: GitHub
- URL: https://github.com/kavan-desai/student-teacher-classroom-managment-rest-api
- Owner: KAVAN-DESAI
- Created: 2022-08-21T06:08:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-20T11:33:56.000Z (10 months ago)
- Last Synced: 2024-01-20T12:33:16.687Z (10 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Backend API using Node js
## Table of Content
- [Introduction](#introduction)
- [Heroku Deployment](#heroku-deployment)
- [API Endpoints](#api-endpoints)
- [Installation](#installation)## Introdution
- API is for classroom management with 2 users:
1. student
2. teacher- API's responds dynamically based on the user
- Tokens are generated using JWT library
- MongoDB is used as database## Heroku Deployment
- Link to homepage endpoint : - https://obscure-mountain-47599.herokuapp.com/
## API Endpoints
```json
"Homepage": "https://obscure-mountain-47599.herokuapp.com/",
"Authentification": {
"register": "/api/user/register",
"login": "/api/user/login"
},
"Classroom": {
"addClassroom": "/api/classroom/add",
"getAllClassroom": "/api/classroom/classrooms",
"updateClassroom": "/api/classroom/update",
"deleteClassroom": "/api/classroom/delete",
"assignClassroom": "/api/classroom/assign"
},
"ClassroomFile": {
"uploadFileClassroom": "/api/classroom/file/upload",
"renameFileClassroom": "/api/classroom/file/rename",
"updateFileClassroom": "/api/classroom/file/update",
"deleteFileClassroom": "/api/classroom/file/delete"
},
"Feed": {
"getClassesFeed": "/api/feed/classes",
"getFilesFeedByFilter": "/api/feed/files",
"searchFileByName": "/api/feed/files/search"
}
```## Installation
- Open the terminal and input the Following commands in root dir(ensure to have node js installed)
```bash
npm i
npm start
```- to get all endpoints we need to call homepage API(using postman)
1. open the postman and import the file postman collection
2. got to Home collection and select homepage API and send the request
3. we get a json response will all endpoints## Data Model
- Here I have used embedded data model.
1. student:
```bash
{
name: {
type : String,
required: true,
min : 6,
max: 255
},
email: {
type : String,
required: true,
max: 255,
min: 6
},
password:{
type : String,
required: true,
max:1024,
min:6
},
userType: {
type: String,
default: "student"
},
rollNumber: {
type: String,
required: true,
},
classesEnrolled:{
type: Array,
default:[],
},
date: {
type: Date,
default: Date.now
}
}
```2. teacher:
```bash
{
name: {
type : String,
required: true,
min : 6,
max: 255
},
email: {
type : String,
required: true,
max: 255,
min: 6
},
password:{
type : String,
required: true,
max:1024,
min:6
},
userType: {
type: String,
default: "teacher"
},
classTutor:{
type: Array,
default:[],
},
date: {
type: Date,
default: Date.now
}
}
```
3. classroom:
```bash
{
name: {
type : String,
required: true,
min : 6,
max: 255
},
classroomCapacity:{
type : String,
required: true,
},
students:{
type: Array,
defauls: [],
},
resources :{
type: Array,
defauls: [],
},
createdBy: {
type : String,
required: true,
},
date: {
type: Date,
default: Date.now
}
}
```