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.
💻 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.
npm start
to start the distributed server
📁 models folder
📁 routes folder
📁 tests folder
📃 app.ts files
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);
...
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);
...
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 });
}
};
...
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;
}
...
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();
});
});
});
...
- @types/mongoose
- @types/mongoose-unique-validator
- body-parser
- express
- mongoose
- mongoose-unique-validator
- ts-mongoose
- @types/chai
- @types/express
- @types/mocha
- @types/node
- @types/supertest
- chai-http
- chai
- mocha
- nodemon
- supertest
- ts-node
- typescript
🔍 Swagger APIs Documentation:
https://app.swaggerhub.com/apis-docs/stevejobs-academy/SjAPI/1.0.0
.