Table of Contents
Backend API that allows students to login and add or remove teachers from their favourite lists
- NodeJs
- ExpressJs
- MongoDB
- Mongoose
- npm
npm install npm@latest -g
-
Clone the repo
git clone https://github.com/AbdullahNM/favourite-teacher-list
-
Install NPM packages
npm install
-
Connect to MongoDB Database and get your Database URL
For help refer : Help
-
Enter your DATABASE_URL and JWT_SECRET_KEY in
.env
DATABASE_URL = 'Enter Your URL' JWT_SECRET_KEY = 'Enter Your secret Key'
-
Start The Server (localhost:3000)
npm start
- Learner Schema
{
name: String,
age: Number,
favourite: Array,
email: Email,
password: String(Encrypted)
}
- Teacher Schema
{
name: String,
age: Number,
subject: String,
count: Number
}
- Add student to database
localhost:3000/learner/add
- Get All students
localhost:3000/learner/getAll
- Get Student By ID
localhost:3000/learner/getOne/:id
- Add teacher to favourite list
localhost:3000/learner/addfavourite
- Remove teacher from favourite list
localhost:3000/learner/removefavourite
- Login Student
localhost:3000/learner/login
- Add teachers to Database
localhost:3000/teacher/add
- Get Most Liked Teacher
localhost:3000/teacher/getMostFav
- Get All Teachers
localhost:3000/teacher/getAll
- Get Teacher By ID
localhost:3000/teacher/getOne/:id
Project Link: https://github.com/AbdullahNM/favourite-teacher-list