GithubHelp home page GithubHelp logo

vishwas567917 / node.js-passport Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 39 KB

Node.js-Passport is an authentication project utilizing Passport.js for user authentication in Node.js applications, with views rendered using EJS. It features login, registration, and session management functionalities, providing a secure authentication solution.

JavaScript 52.50% EJS 47.50%
expressjs javascript responsive

node.js-passport's Introduction

Node.js Passport Authentication App

This is a Node.js web application that implements user authentication using Passport.js and MongoDB. It allows users to register, login, and access a protected dashboard page upon successful authentication.

Features

  • User registration with validation
  • User login with authentication
  • Flash messages for error and success notifications
  • Protected dashboard accessible only to authenticated users

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • Passport.js
  • bcrypt.js
  • EJS (Embedded JavaScript) for templating
  • Bootstrap for styling
  • Font Awesome for icons

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/nodejs-passport-authentication.git
  2. Install dependencies: cd nodejs-passport-authentication npm install 3.Configure MongoDB URI:

Replace YOUR_USERNAME_HERE, YOUR_PASSWORD_HERE, and CLUSTER_NAME_HERE in config/keys.js with your MongoDB Atlas username, password, and cluster name respectively.

  1. Run the application: npm start
  2. Visit http://localhost:5000 in your web browser.

Usage 1 Register a new account by visiting /users/register. 2 Login with your registered credentials at /users/login. 3 Access the protected dashboard at /dashboard. 4 Logout by clicking the "Logout" button on the dashboard.

Folder Structure 1 config: Contains configuration files for Passport authentication and MongoDB connection. 2 models: Defines the User model schema for MongoDB. 3 public: Contains static assets such as CSS files and client-side JavaScript. 4 routes: Defines the application routes for handling HTTP requests. 5 views: Contains EJS templates for rendering HTML pages. 6 app.js: Main entry point of the application.

Credits This project was built based on tutorials and guides available online for Node.js authentication with Passport.js.

node.js-passport's People

Contributors

vishwas567917 avatar

Stargazers

Sudhanshu Ambastha avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.