Table of Contents
An api to simulate FFCS course registration offered in Vellore Institute of Technology
, as a part of Dyte
hiring process. This api follows guidelines and instructions given at: Google Docs Link.
The testing tool can be found here: Dyte python script.
To get the project up and running follow these simple steps:
-
Clone the repo
git clone https://github.com/yvs2701/dyte-api-VITHIRING-phase1.git
You can instead download the coedbase as an archive from the download code button.
-
Install dependencies
npm install
-
Create a
.env
file and fill in the following secrets:- PORT_NO // for express server
- DB_PORT
- DB_HOST
- DB_USER
- DB_PASSWORD
- DB_NAME
-
To initialize or reset your database in Postgres, run:
npm run init-db
-
To run the server in development mode run the following command:
npm run start
-
The server provides the following routes:
/admin/faculty
(POST): creates a new faculty resource./admin/slot
(POST): creates a new slot resource along with timings./admin/course
(POST): creates a new course resource which references slots and faculties./admin/student
(POST): creates a student resource if no such resource exists. Otherwise returns same student resource everytime./faculty/:id
(GET): returns a faculty resource./course/:id
(GET): returns a course resource./register
(POST): associates a student resource with course resource (many-to-many).timetable
(GET): fetches all the registered courses and their slots for the given student.