:)
A backend REST API built with Express.js and MySQL for managing university course advising and registration workflows.
It is part of a full-stack project, and the frontend can be found here:
https://github.com/tahi4/connect-advising-frontend
app.js
db.js
controllers/
middleware/
models/
routes/
package.json
.gitignore
misc
npm installSet up MySQL database and configure db.js.
npm run dev| Method | Endpoint | Params / Body |
|---|---|---|
| POST | /auth/signup | name, email, password, role |
| POST | /auth/login | email, password |
All routes require authentication with role =
student
| Method | Endpoint | Params / Body |
|---|---|---|
| GET | /students/courses | - |
| GET | /students/courses/:courseId | courseId |
| POST | /students/add-course | studentId, courseId, sectionId, advisorId |
| POST | /students/drop-course | studentId, courseId, sectionId |
| GET | /students/my-courses/:studentId | studentId |
| GET | /students/info/:studentId | studentId |
| PUT | /students/confirm-advising/:studentId | studentId |
| GET | /students/id-by-email/:email | studentEmail |
All routes require authentication with role =
advisor
| Method | Endpoint | Params / Body |
|---|---|---|
| GET | /advisors/waiting-students | - |
| PUT | /advisors/approve/:studentId | studentId, status (approved / denied) |
| POST | /advisors/add-course | advisorId, studentId, courseId, sectionId |
| POST | /advisors/drop-course | studentId, courseId, sectionId |
| GET | /advisors/student-courses/:studentId | studentId [For fetching selected courses by students] |
| GET | /advisors/courses/:studentId | studentId [For fetching all courses other than the selected ones by a student] |
| GET | /advisors/course-detail/:courseId | courseId |
| GET | /advisors/id-by-email/:email | studentEmail |
All routes require authentication with role =
registrar
| Method | Endpoint | Params / Body |
|---|---|---|
| POST | /registrars/course | courseId, title, name, examSchedule, courseCredit, registrarEmail, registrarId |
| DELETE | /registrars/course/:courseId | courseId |
| POST | /registrars/section | courseId, sectionId, schedule, faculty, seatAvailability |
| DELETE | /registrars/section/:courseId/:sectionId | courseId, sectionId |
- All course addition endpoints handle: credit limit, schedule clash, seat availability, and section swaps.
- Transactions ensure data consistency for add/drop operations.
- Endpoints are grouped by role:
/students,/advisors,/registrars,/auth.