Git Product home page Git Product logo

govtech-assignment's Introduction

GovTech Node.js API Asessment

Teachers need a system where they can perform administrative functions for their students. Teachers and students are identified by their email addresses.

Getting started

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.

Prerequisites

Installing

A step by step series of examples that will help you get a development environment running

  1. Clone the repository:
git clone https://github.com/koozy0/govtech-assignment.git
  1. Install dependencies:
cd ${path-to-project}
npm install
  1. Create .env file.
touch .env
  1. Update the .env file with the database configurations, using .env.example as the template.

  2. Create the database schema for local development (develop) and testing (test).

  3. Migrate the table definitions:

npm run db:migrate
  1. Seed the database:
npm run db:seed
  1. Start the server:
npm run dev
  1. Check that the development server is running by sending a GET request to 127.0.0.1:3000 where 3000 is the default port. You can change the default port by creating a PORT environment variable in the .env. You should see the following response:
{
  "message": "Server works!"
}

Running the tests

Run the following command in the project directory to run the tests:

npm run test

Routes

Main API routes

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

Utility routes - Student

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

Utility routes - Teacher

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

Deployment

To be added.

Built with

Authors

govtech-assignment's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.