VOOZH about

URL: https://www.geeksforgeeks.org/node-js/student-management-system-using-express-js-and-ejs-templating-engine/

⇱ Student Management System using Express.js and EJS Templating Engine - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Student Management System using Express.js and EJS Templating Engine

Last Updated : 23 Jul, 2025

In this article, we build a student management student which will have features like adding students to a record, removing students, and updating students. We will be using popular web tools NodeJS, Express JS, and MongoDB for the backend. We will use HTML, CSS, and JavaScript for the front end. We'll go through every step to create this application.

Output Preview: Let us have a look at how the final output will look like

👁 Screenshot-2024-02-28-220508

Prerequisites:

Approaches To Create Student Management System:

  • allStudents.ejs: Displays all student records.
  • add-student-form.ejs: Form for adding a new student.
  • modify-student-form.ejs: Form for updating student information.
  • deleteStudent.ejs: Form for deleting a student.
  • Navigation bar with links for viewing all students, adding, removing, and updating student information.
  • Routes for displaying, adding, modifying, and deleting students.
  • MongoDB integration using Mongoose to perform CRUD operations.
  • Error handling for cases like no matching documents found.
  • Connects to MongoDB using Mongoose.
  • Defines a students_collection schema for student records.
  • CRUD operations using the Student model.
  • Forms for user input when adding, updating, or deleting students.
  • Displays an error message if no matching documents are found.

Steps to Create Student Management System using ExpressJS and NodeJS:

Step 1: Create a server using the following command in your terminal.

npm init -y

Step 2: Install the necessary package in your application using the following command.

npm install express mongoose ejs

Step 3: Open MongoDB Atlas, and get the connection string using which we will connect our NodeJS application with MongoDB and perform CRUD operations. To get the connection string, go to Database in MongoDB atlas dashboard, then click on connect.

Project Structure:

👁 Screenshot-2024-02-28-215410

The updated dependencies in package.json file will look like:

"dependencies": {
"express": "^4.18.2",
"ejs": "^3.1.9",
}

Example: Below is an example of Student management system using ExpressJS and NodeJS.

Start your application using the following command.

node server.js

Output:

Comment

Explore