This is a small REST API implementing some queries about students data and universities data.
The API implemented in NestJS with mongoose.
Please read the whole README before running the app.
Clone this repo and run:
$ npm installTo run the server, run one of these commands:
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prodThe server will run locally on port 3000.
To check the requests (with Postman for example) the global URI should be this:
http://localhost:3000/api
Concatenate to this URI the requested endpoints.
No need to pass anything in body.
The IDs both university ID and student ID represented as natural integer numbers (starting from 1).
Each endpoint that includes {universityId} or {studentId} replace with actual number at the URI.
Some of the POST methods require passing json object at the body.
For university creation you must pass the fields: name, maxNumberOfStudents and minGpa.
For student creation you must pass the fields: name and array of grades. Each grade is a json object that has the fields: courseName and grade.
For both of the cases the document won't be created if you will not pass the mentioned fields.
The data base is MongoDB and stored in cloud through the Atlas service.
No need to install Mongo locally.
You can install only the Compass software if you wish to see the whole data base.
You might notice that each document contains more fields than requested, don't worry about not passing them at the body.
These fields created at the server side and serves mostly student enrolling.
The _id field generated by regular counting and serves as the student\university ID.