► A simple and efficient user management system using Node.js, Express, Express-EJS, and MongoDB
Developed with the software and tools below.
This is a basic user management system built using Node.js, Express, Express-EJS, and MongoDB. The project allows for adding, viewing, editing, and deleting users. Additionally, it features search functionality and an about page.
Deployed Site: usermgmtsys.onrender.com
Features of the user management system include:
- Add, view, edit, and delete user information
- Search functionality to find users
- User-friendly interface with EJS templating
- Simple routing and controller setup
└── userMGMTSys/
├── README.md
├── app.js
├── package-lock.json
├── package.json
├── public
│ └── css
│ └── main.css
├── server
│ ├── config
│ │ └── db.js
│ ├── controller
│ │ └── customerController.js
│ ├── model
│ │ └── Customer.js
│ └── routes
│ └── customer.js
└── views
├── 404.ejs
├── about.ejs
├── index.ejs
├── layouts
│ └── main.ejs
├── pages
│ ├── add.ejs
│ ├── edit.ejs
│ └── view.ejs
├── partials
│ ├── header.ejs
│ └── sidebar.ejs
└── search.ejs
package.json
File | Summary |
---|---|
package.json | Contains project dependencies and scripts for running the application. |
app.js
File | Summary |
---|---|
app.js | Main entry point for the application, setting up Express server and routes. |
server.controller
File | Summary |
---|---|
customerController.js | Contains controller logic for handling user-related operations like add, edit, view, and delete. |
server.model
File | Summary |
---|---|
Customer.js | MongoDB model schema for the user data. |
server.routes
File | Summary |
---|---|
customer.js | Defines the routes for user management functionalities such as add, view, edit, and delete. |
server.config
File | Summary |
---|---|
db.js | Sets up the MongoDB connection for the application. |
public.css
File | Summary |
---|---|
main.css | Contains custom CSS for styling the application. |
views
File | Summary |
---|---|
index.ejs | Home page template displaying the list of users. |
search.ejs | Template for the search results. |
404.ejs | 404 error page template. |
about.ejs | About page template. |
views.partials
File | Summary |
---|---|
header.ejs | Partial template for the header section. |
sidebar.ejs | Partial template for the sidebar section. |
views.pages
File | Summary |
---|---|
edit.ejs | Template for editing user details. |
view.ejs | Template for viewing user details. |
add.ejs | Template for adding a new user. |
views.layouts
File | Summary |
---|---|
main.ejs | Main layout template used across different views. |
The following routes are available in the application:
Method | Route | Description |
---|---|---|
GET | / |
Home page, displays the list of users |
GET | /about |
About page |
GET | /add-user |
Page to add a new user |
POST | /add-user |
Submit a new user |
GET | /edit-user/:id |
Page to edit an existing user |
POST | /edit-user/:id |
Submit changes to an existing user |
GET | /view-user/:id |
View details of a specific user |
GET | /delete-user/:id |
Delete a specific user |
GET | /search |
Search users by name or other criteria |
-
Clone the repository:
git clone https://github.com/Rohit-Bhetal/userMGMTSys.git cd userMGMTSys
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root of the project and add the following:MONGO_URI=your_mongodb_uri
-
Start the server:
npm start
-
Visit the application in your browser:
http://localhost:3000
Planned enhancements and future features:
- Integration of user authentication
- Enhanced search capabilities
- Implementing role-based access control (RBAC)
- Deployment to a production environment
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Distributed under the MIT License. See LICENSE for more information.
This project was inspired by various online tutorials and open-source projects. Special thanks to the Node.js, Express, and MongoDB communities for their resources and support.