Table of Contents
The Student course management system built with NodeJS and Express. It allows managing students and courses through CRUD operations (Create, Read, Update, Delete). Students and courses have detailed information stored, and you can search for them by name or phone number. Additionally, the system lets students register for courses and generates reports on both students and courses.
-
To test the deployed API, click here.click-here
-
This is an example of how to list things you need to use the software and how to install them.
-
npm
npm install npm@latest -g
or
-
yarn
npm install yarn@latest -g
_Below is an example of how to settup the project requirement
-
Clone the repo
https://github.com/MeeReak/student-course-management.git
-
Install NPM or YARN packages
npm install
or
yarn install
-
Enter your .env variables in
configs/.env
NODE_ENV=dev LOG_LEVEL=debug DB_URL=your_database_url PORT=3000
_Below is an example of how to get start the project!
-
Start Server
npm run start:dev
or
yarn start:dev
-
Run Test
npm run start:test
or
yarn start:test
Below are some examples of how to use the API endpoints.
For more examples, please refer to the Documentation
- Create Student:
POST /v1/students
- Retrieve a Student:
GET /v1/students/{id}
- Update Student:
POST /v1/students/{id}
- Delete Student:
DELETE /v1/students/{id}
- List Students:
GET /v1/students
- Search Students by Full Name or Phone Number:
GET /v1/students/search?query={query}
- Create Course:
POST /v1/courses
- Retrieve a Course:
GET /v1/courses/{id}
- Update Course:
PUT /v1/courses/{id}
- Delete Course:
DELETE /v1/courses/{id}
- List Courses:
GET /v1/courses
- Search Courses by Name:
GET /v1/courses/search?name={name}
- Advanced Search Courses by Start Date and End Date:
GET /v1/courses/date?startDate={startDate}&endDate={endDate}
- Register Course for Student:
POST /v1/students/{id}/course/{courseId}
- Remove Course for Student:
DELETE /v1/students/{id}/course/{courseId}
- Course Report:
GET /v1/courses/reports
- Student Report:
GET /v1/students/reports
- Student
{
"name":{
"en": "Kaizen",
"km": "សុខគា"
},
"dateOfBirth": "02-02-2022", # format "yy,mm,dd"
"gender": "Male",
"phoneNumber": "0123456789"
"courses": [
"667fb8a1fd67fa8bce216370",
"667fb9e20d778b0eb1a8d0db"
],
}
- Course
{
"name": "Javascript",
"professorName": "Kaizen",
"startDate": "04-01-2024",
"endDate": "12-01-2024",
"limit": 15,
"Enroll": [
"667f9b5d608df88473d6dc1a",
"667fbc0c2ee96d8d99d0b68e"
],
}
- Student
{
"_id": "667fbc0c2ee96d8d99d0b68e",
"name":{
"en": "Kaizen",
"km": "សុខគា"
},
"dateOfBirth": "02-02-2022", # format "yy,mm,dd"
"gender": "Male",
"phoneNumber": "0123456789"
"courses": [
"667fb8a1fd67fa8bce216370",
"667fb9e20d778b0eb1a8d0db"
],
"is_deleted": false,
"__v": 1
}
- Course
{
"name": "Javascript",
"professorName": "Kaizen",
"startDate": "04-01-2024",
"endDate": "12-01-2024",
"limit": 15,
"Enroll": [
"667f9b5d608df88473d6dc1a",
"667fbc0c2ee96d8d99d0b68e"
],
}
Student Document Validation:
name
:{en
: Must be a non-empty string.km
: Must be a non-empty string. }dateOfBirth
: Must be a valid date.gender
: Must be either "male", "female", or “other” valid options.phoneNumber
: Must be a valid phone number format .Course
: Must be an array of valid course IDs. The string of IDs should not exceed
Course Document Validation:
name
: Must be a non-empty string.professorName
: Must be a non-empty string.limit
: Must be a positive integer.startDate
: Must be a valid date.endDate
: Must be a valid date and must be afterstart_date
.Enroll
: Must be an array of valid student IDs. The string of IDs should not exceed .
Rin Tithyareak - @Mee Reak - [email protected]
Project Link: https://github.com/MeeReak/student-course-management.git