childerx / DCIT-205-Min-Projs

Home Page:https://dcit-205-min-projs.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

School Management System

This is mainly a backend program designed with NodeJs. The two main functionalities injected into this project are:
  • Getting students details by ID
  • Registring new students by supping students details

Getting students details by ID

This is handled by the express app which is being required in the index.js since it is a package/dependency. This was done via the GET request handler. The app.get route and the router.get routes were also used in this project. A callback function is passed right after these parameters to be able to interact with the request and response parameters to render our EJS files on the browser. IDs were automatically generated by the database application(MONGODB).During the retrieval of any of the documents from the database, the id is being passed a parameter to the browser, and hence search through the database to display the extra details of the particular ID(document).

Registring new students by supping students details

A web form was created in a register.ejs file as part of the project. Throught this form, we take detailed(value) of a student pass it as data and save it to the database and return a template which adds the data passed into the form earlier in addition to the existing data if there is any. This is done by the POST request handler. This is also similarly handled by the app created from the express framer. An object model was created using the mongoose and in conjuction with the mongodb. During the post request, a path is passed as a parameter which directs users to the root of the site(/students). The second argument passed to this fuction is a callback function which takes in the request and response arguments. Within this callback function, an instance of the object is created thus const student = new Student(req.body) and then grabs the values with was passed from the forms and saves it to the database(The student.save() is used for this action).

Dependencies and Packages

  • EJS
  • Express
  • Mongoose
  • morgan
  • NodeMon

Below is an interface of the home page:

Screenshot from 2023-02-20 17-38-51

About

https://dcit-205-min-projs.vercel.app


Languages

Language:EJS 51.1%Language:CSS 24.6%Language:JavaScript 24.3%