Teachers need a system where they can perform administrative functions for their students. Teachers and students are identified by their email addresses.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
A step by step series of examples that will help you get a development environment running
- Clone the repository:
git clone https://github.com/koozy0/govtech-assignment.git
- Install dependencies:
cd ${path-to-project}
npm install
- Create
.env
file.
touch .env
-
Update the
.env
file with the database configurations, using.env.example
as the template. -
Create the database schema for local development (develop) and testing (test).
-
Migrate the table definitions:
npm run db:migrate
- Seed the database:
npm run db:seed
- Start the server:
npm run dev
- Check that the development server is running by sending a GET request to
127.0.0.1:3000
where3000
is the default port. You can change the default port by creating aPORT
environment variable in the.env
. You should see the following response:
{
"message": "Server works!"
}
Run the following command in the project directory to run the tests:
npm run test
Method | Route | Description |
---|---|---|
POST | /api/register | Register one or more students to a specified teacher |
GET | /api/commonstudents | Retrieve students who are registered to all of the given teachers |
POST | /api/suspend | Suspend a specified student |
POST | /api/retrievefornotifications | Retrieve a list of students who can receive a given notification |
Method | Route | Description |
---|---|---|
GET | /api/student | Retrieve all students |
GET | /api/student/:id | Retrieve a student with the given id |
POST | /api/student | Create a student |
PUT | /api/student/:id | Update the details of a student with the given id |
DELETE | /api/student/:id | Delete a student with the given id |
Method | Route | Description |
---|---|---|
GET | /api/teacher | Retrieve all teachers |
GET | /api/teacher/:id | Retrieve a teacher with the given id |
POST | /api/teacher | Create a teacher |
PUT | /api/teacher/:id | Update the details of a teacher with the given id |
DELETE | /api/teacher/:id | Delete a teacher with the given id |
To be added.