Welcome to the Simple User Register Web-App! This project is a web application built with Node.js, Express, and MongoDB, designed to manage user information. The application allows users to register, view, update, and delete their details, including uploading and displaying profile images.
This web application provides a straightforward system for managing user data. It leverages Node.js and Express for the backend and MongoDB with Mongoose for database management. The frontend is designed with EJS for templating. Users can register with their name, email, phone number, and profile picture. The app supports CRUD operations and includes search, sorting, and pagination features.
- User Registration: Add new users with their details and profile pictures.
- User Listing: View a list of registered users with their information and images.
- User Updates: Edit existing user details and update their profile pictures.
- User Deletion: Remove users from the system.
- Search and Sort: Search users by name and sort the list by different criteria.
- Pagination: Navigate through large sets of user data with pagination controls.
Here's an overview of the project directory structure:
./
├── models/
│ └── users.ejs # EJS template for user model (if applicable)
├── node_modules/ # Node.js modules
├── routes/
│ └── routes.ejs # EJS template for routes (if applicable)
├── uploads/ # Directory for uploaded images
├── views/
│ ├── index.ejs # EJS template for the home page
│ ├── about.ejs # EJS template for the about page
│ ├── contact.ejs # EJS template for the contact page
│ ├── add_users.ejs # EJS template for adding users
│ ├── edit_users.ejs # EJS template for editing users
│ └── layout/
│ ├── header.ejs # EJS template for the header layout
│ └── footer.ejs # EJS template for the footer layout
├── main.ejs # Main EJS template (if applicable)
├── .env # Environment variables
├── README.md # Project documentation
├── package.json # Node.js package descriptor
└── package-lock.json # Locked dependencies versions
To get started with this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/coderooz/simple-nodejs-mongodb-user-register-web-app.git
-
Navigate to the project directory:
cd simple-nodejs-mongodb-user-register-web-app -
Install dependencies:
npm install dotenv ejs express express-session mongoose multer
-
Set up environment variables:
Create a
.envfile in the root directory and add the following variables:MONGODB_URI=<your-mongodb-uri> PORT=5000
-
Start the development server:
npm start
The backend server will run on
http://localhost:5000and serve the frontend application.
-
Access the Application: Open your web browser and go to
http://localhost:5000to view the application. -
Register a New User: Use the registration form to add new users with their name, email, phone number, and profile picture.
-
View Users: Navigate to the user list page to view all registered users with their details and images.
-
Update User Details: Click on the edit button next to a user to modify their information and profile picture.
-
Delete Users: Click on the delete button next to a user to remove them from the system.
-
Search and Sort: Use the search form to find users by name and use the sorting links to order the list by different criteria.
This project was created based on a tutorial by DCodeMania on YouTube. Their guidance was invaluable in understanding and implementing the features of this web application.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Make your changes and commit them (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/YourFeature). - Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Thanks to all the contributors who have helped build this project!
For any questions or feedback, please contact:
Thank you for checking out the Simple User Register Web-App!