Skip to content

Wh02m1/WebApp-NodeJS-MongoDB-login-register

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GIF Example

Node.js Web App with Login, Register, and Contact Us Form

This is a web application built using Node.js, MongoDB, and Express.js. It features user authentication with login and registration functionality, along with a contact form for users to send messages.

Prerequisites

Before running this application, make sure you have the following installed:

  • Node.js
  • MongoDB

Installation

  1. Clone this repository to your local machine or download the source code as a ZIP file.
  2. Navigate to the project's root directory.
  3. Install the dependencies by running the following command:
npm install
npm init
npm install passport
npm install express
npm install mongoose
npm install body-parser
npm install passport-local
npm install passport-local-mongoose
npm install express-session
npm install ejs
  1. Set up the MongoDB connection by replacing the MongoDB URL in App.js with your own database URL.

Database Setup

  1. Create a MongoDB database for the application.
  2. Define the required schemas in your MongoDB database based on the following models used in the application:
  • User Schema:

    • Username (String)
    • Email (String)
    • Password (String)
  • Product Schema:

    • Define the fields based on your specific product requirements.
  • Ticket Schema:

    • Name (String)
    • Email (String)
    • Message (String)

Ensure that the database and collection names used in the application match the ones you have set up in your MongoDB database.

Usage

  1. Start the application by running the following command:
node App.js
  1. Open your web browser and go to http://localhost:3000 to access the application.

Features

  • User Authentication: Users can register an account and log in using their credentials.
  • Contact Us Form: Users can send messages through the contact form.
  • Product Listing: Users can view a list of products.
  • User Management: Administrators can manage user accounts by deleting and updating email addresses.

File Structure

  • App.js: The main entry point of the application.
  • model/User.js: Defines the User model for user authentication.
  • model/Products.js: Defines the Products model for storing product information.
  • model/ticket.js: Defines the Ticket model for storing contact form messages.
  • views/: Contains the EJS templates for rendering the different pages.
  • public/: Contains static assets such as CSS stylesheets and client-side JavaScript files.

About

A repository for a web app using Node.js, MongoDB, and featuring user authentication, registration, and a contact form.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors