-
Clone the repository
-
Get a working
.env
file. There is a template to follow which is.env.sample
- RUN
docker-compose up
- expects you to have docker installed
-
cd
into the cloned repo and RUNyarn install
to install all the necessary dependencies -
Make sure you have MongoDB installed and running
-
RUN
yarn test
to run the tests. -
RUN
yarn serve
to launch the app
[1] You can list assignments by calling GET /api/assignments
[2] You can list classes by calling GET /api/classes
[2] You can list upcomings by calling GET /api/upcomings
{
"message": "Classes retrieved successfully",
"data": [
{
"_id": "6077010debdb134a9c5fd3a7",
"title": "Physics",
"date": "2021-04-14T14:49:50.460Z",
"assignment": "6077010debdb1369b95fd3a6",
"createdAt": "2021-04-14T14:49:50.460Z",
"updatedAt": "2021-04-14T14:49:50.460Z",
"__v": 0,
"id": "6077010debdb134a9c5fd3a7"
}
],
"meta": {
"limit": 1,
"offset": 0,
"total": 15
}
}
-
$offet=number
allows you to skip a number of records e.gGET /api/classes?$offset=500
-
$limit=number
allows you specify how many records returned per API call e.gGET /api/classes?$limit=100
[1] To create a new class
POST /api/classes
{
"title": "some-title",
"date": "some-date"
}
[2] To create a new assignment
POST /api/assignments
{
"title": "some-title",
"date": "some-date"
}
[3] To create a new upcoming
POST /api/upcomings
{
"title": "some-title",
"date": "some-date"
}
[1] To update any of the above e.g a class, do
PUT /api/classes/:classId
{
"title": "some-new-title",
"date": "some-new-date"
}
[1] To delete any of the above e.g a class, do
DELETE /api/classes/:classId