This repository contains the code for the completed djamware tutorial on using the Sequelize ORM package in an Express application. Under the hood, the ORM uses PostgreSQL as database for this example.
- JavaScript
- Node.js
- Express.js
- PostgreSQL
- Sequelize ORM
In order to run the program, you need to install Node.js on your computer:
- Download the binaries
- If you use Linux, follow the installation instructions.
Once installed, install the program's dependencies with npm install
in your terminal with the project's folder as working directory.
You can then start the Express server by typing npm start
.
- Classroom:
- id:
number
- class_name:
string
- id:
- Student
- id:
number
- classroom_id:
number
- student_name:
string
- id:
- Lecturer
- id:
number
- lecturer_name:
string
- id:
- Course
- id:
number
- lecturer_id:
number
- course_name:
string
- id:
Once you have the server up and running, the following end points will be reachable in http://localhost:4001/
:
GET
/api/classroom
/api/classroom/:id
POST
/api/classroom
/api/classroom/add_with_students
PUT
/api/classroom/:id
DELETE
/api/classroom/:id
GET
/api/student
/api/student/:id
POST
/api/student
/api/student/add_course
PUT
/api/student/:id
DELETE
/api/student/:id
GET
/api/lecturer
/api/lecturer/:id
POST
/api/lecturer
/api/lecturer/add_with_course
PUT
/api/lecturer/:id
DELETE
/api/lecturer/:id
GET
/api/course
/api/course/:id
POST
/api/course
PUT
/api/course/:id
DELETE
/api/course/:id