Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

corradodiba/scm-nodets-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steve Jobs: Class Management

SteveJobs

This product is a management software developed by five of Steve Jobs Academy's students, with the intent of automate all of the usual operations used by the Steve Jobs Academy regarding the managing of all the students, the teachers, the subjects and the grades.

The APIs use the RESTful approach, and the Database used is MONGODB.

NPM commands:

💻 Run npm run dev for a dev server. Navigate to http://localhost:3000/. The app will automatically reload if you change any of the source files.

🐛 Run npm test to execute the unit tests via Mocha.

🔨 Run npm run build to build the project. The build artifacts will be stored in the /build directory.

▶️ Run npm start to start the distributed server

The following list shows how we structured the file system

:notebook*with_decorative_cover: The *source_ folder (_src_)

📁 models folder

📁 routes folder

📁 tests folder

📃 app.ts files

App.ts folder

It is where all api are linked together and where the PORT is decided.

...
app.use("/teachers", teachersRoutes);
app.use("/students", studentsRoutes);
app.use("/subjects", subjectsRoutes);
...

Routes folder

It contains the APIs management that have been used for.

import express from "express";
import {
getAllStudents,
getStudentById,
deleteStudentById,
addStudent,
editStudentById,
getAllGradesByStudentId
} from "./controllers/students.controller";
const router = express.Router();
router.get("/", getAllStudents);
...

Controller folder

It contains each method used by the routes.

...
   export const getAllSubjects = async (req: Request, res: Response) => {
  try {
    const result = await getAll();
    return res.status(200).json(result);
  } catch (err) {
    return res.status(404).json({ message: err });
  }
};
...

Models folder

It is a typescript construct, and containes the model, methods and constructor of every single teacher, subject, student and grade.

   export interface Student extends Document {
  fiscalCode: string;
  name: string;
  surname: string;
  dateOfBirth: Date;
  }
  ...

Tests folder

It contains the tests that have been made to every resource.

...
const PATH = "http://localhost:3000/subjects";
let expect = chai.expect;
chai.use(chaiHttp);
describe(`Testing ${PATH} `, () => {
 describe(`GET / `, () => {
   return new Promise(async (resolve) => {
     it(" should return an array w/status code 200", async () => {
       const subject = await chai.request(PATH).get("/");
       expect(subject.error).to.be.false;
       expect(subject).to.have.status(200);
       expect(subject.body).to.be.a("array");
       resolve();
     });
   });
 });
...

List of NPM modules used for this project:

  • @types/mongoose
  • @types/mongoose-unique-validator
  • body-parser
  • express
  • mongoose
  • mongoose-unique-validator
  • ts-mongoose

DEV NPMs:

  • @types/chai
  • @types/express
  • @types/mocha
  • @types/node
  • @types/supertest
  • chai-http
  • chai
  • mocha
  • nodemon
  • supertest
  • ts-node
  • typescript

Access method to the software:

🔍 Swagger APIs Documentation:

https://app.swaggerhub.com/apis-docs/stevejobs-academy/SjAPI/1.0.0.

About

Class Management System powered by Stevejobs Academy's students: Corrado Dibattista, Gabriele Zagarella, Manuel Caruso, Gaetano Carfì.

Resources

Stars

Watchers

Forks

Packages

No packages published