Authentication Quickstart with Express, Passport and Sequelize
This is a quick-start application that demonstrates basic authentication using Passport and Sequelize. It is built with:
I wrote a blog post Authentication Quickstart with Express, Passport and Sequelize about this quick-start.
As it is a Node application, you will need Node.js installed.
The app uses a SQL database via Sequelize ORM. It was tested with PostgreSQL, but should work with other supported databases as well.
Clone the repository and simply run
npm install from the root folder.
In order to run the application, a database connection string has to be configured. The connection string is stored in
When Sequelize is configured, you can run the setup script that creates the
users table and also adds one default user (username:
user). From the root directory run:
If you want to run the tests, it is necessary to configure Nightwatch.js using the
nightwatch.json file. Namely it is required to provide server path to selenium. For more information see the documentation.
Run the application
From the root folder of the project, you can run the application with:
You can then access the application on
- Log in on
- Sign up on
- Dashboard [requires to be logged in] on
- Log out on
Run the tests
A basic set of Nightwatch end-to-end tests is provided. To run the tests, first make sure that the application is running and then start the test suite by typing
nightwatch in the root folder. Note that you have to configure Nightwatch.js first.
Author: Petr Stříbný
License: The MIT License (MIT)