A System for teachers to perform admin functions for their students.
Consists of a set of API endpoints which provides these functionalities -
- A teacher can register multiple students.
- A student can be registered under multiple teachers.
- Teachers can retrieve all students common to all of them.
- Teacher can suspend a student.
- Teachers can send notifications to students to inform students of important announcements.
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.
Technology Stack
node js (server)
express js (api)
mocha & chai (unit testing)
mysql (db)
docker (not in scope)
A step by step series of examples that tell you how to get a development env running
Node JS app dependencies
npm install express body-parser --save
npm install mocha chai chai-http --save-dev
- Running the app -> var host = 'localhost'; //change in server.js
- Open terminal(in the project directory) and enter
node server.js
Access through -> url: http://localhost:8080/api
- Running inside a Docker -> var host = 'mysql'; //change in server.js
Go to the project folder:
- Open terminal with the project path and run
docker-compose up --build
- Open one more terminal and run the following:
docker exec -it nodeassignment_mysql_1 bash
mysql
CREATE DATABASE IF NOT EXISTS test;
GRANT ALL PRIVILEGES on test.*
TO 'root'@'%' IDENTIFIED BY 'manish'
WITH GRANT OPTION;
USE test;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS student
(stud_id int(11) NOT NULL AUTO_INCREMENT,
stud_email varchar(45) NOT NULL,
teach_email varchar(45) NOT NULL,
suspension tinyint(1) DEFAULT NULL,
PRIMARY KEY (stud_id)
) DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX student_teacher
ON student (stud_email, teach_email);
Here nodeassignment_mysql_1 is the mysql container, run docker ps to check the name of the container created for you.
Access through -> url: http://localhost:49160/api
- Open terminal(in the project directory) and enter
npm test