Skip to content
プロジェクト

bradtraversy/node_passport_login

GitHubで見る

bradtraversy/node_passport_login has 1,749 GitHub stars and 1,271 forks. GitHot measured -1 stars in 24 hours, -1 in 7 days, and -1 in 15 days. Last checked 2026-11-21 08:56 UTC. Last push 2026-07-28.

この数値の測り方

計測したスター増加

24時間
-1
7日間
-1
15日間
-1
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

概要

Node.js login, registration and access control using Express and Passport

開発ツール

Node Passport Login

A simple Node.js authentication starter built with Express, Passport, MongoDB, Mongoose, EJS, and Bootstrap.

This project demonstrates:

  • Local authentication with Passport
  • User registration and login
  • Password hashing with bcryptjs
  • Protected dashboard route
  • Flash messages for validation and auth feedback
  • EJS views with a Bootstrap-powered UI

Version

2.0.0

Requirements

  • Node.js 22 or newer recommended
  • npm
  • MongoDB Atlas or a local MongoDB database

Installation

npm install

MongoDB Setup

Open config/keys.js and replace the placeholder MongoDB URI with your own local or Atlas connection string.

Example local URI:

const dbPassword = 'mongodb://127.0.0.1:27017/node_passport_login';

module.exports = {
  mongoURI: dbPassword
};

For MongoDB Atlas, use the connection string from your Atlas dashboard and make sure your database username, password, and network access settings are correct.

Do not commit real database credentials to GitHub.

Running the App

npm start

For development with automatic restarts:

npm run dev

Then visit:

http://localhost:5000

Routes

  • GET / - welcome page
  • GET /users/register - register page
  • POST /users/register - create a user
  • GET /users/login - login page
  • POST /users/login - authenticate a user
  • GET /dashboard - protected dashboard
  • GET /users/logout - logout

Scripts

npm start
npm run dev

Dependencies

This project uses current major versions of the main packages, including Express 5, EJS 5, Mongoose 9, Passport 0.7, and Bootstrap 5.