Voyager is a Node and SQL based web application framework that provides everything you need to produce robust, scalable, database-driven web apps, including:
- Built-in user authentication (opt-in)
- Simplistic database migrations (Knex)
- Easy-to-use ORM (Sequelize)
- Clean, full-featured layout templating (Handlebars)
- Robust front-end build system (Webpack)
- Modern ES6 syntax
Built on top of Express, and modeled after Rails and Laravel, Voyager provides a complete solution to getting up and running with a user-based app as quickly as possible.
-
Download the Voyager command line interface (CLI) with NPM:
npm install -g voyager-cli
-
Create a new Voyager project, with or without auth:
voyager new newApp
or
voyager new newApp --auth
Notice: You must run the built-in Knex migrations and add a .env file with valid credentials for the auth version to work. Further auth related instructions can be found under Auth Setup below.
-
Change directory to
newApp
and start the Voyager server:cd newApp npm run dev
-
Your app should open up automatically at
http://localhost:3001
and you should see the Voyager start up page.
To get started with Voyager's built-in authentication, you must follow a few steps required to connect your app to a database and utilize key functionalities such as email confirmations and password resets.
-
Create a file called
.env
in the root of your newly generated Voyager project -
Copy the contents of
.env.example
and paste inside of the newly created.env
file:DB_HOST= DB_USER= DB_PASSWORD= DB_NAME= MAILGUN_KEY= MAILGUN_DOMAIN=
-
Create a MySQL database for your app, grab a Mailgun API key, and insert the corresponding values into the
.env
file. A finished version will look something like this for a local server:DB_HOST=localhost DB_USER=root DB_PASSWORD=root DB_NAME=newApp MAILGUN_KEY=key-kfvud83k3kf3vbn22k223222 MAILGUN_DOMAIN=mailgun.yourdomain.com
-
Install knex if you haven't already:
npm install knex -g
-
Run knex migrations:
knex migrate:latest
-
Restart the Voyager server:
npm run dev
You should now have a fully functioning app with auth features such as user registration, user login, email confirmation, and password reset functionality. For more information and instruction regarding Voyager auth, check the Chris Courses YouTube channel for Voyager tutorials and more.
Run Migrations: knex migrate:latest
Rollback Last Migrations: knex migrate:rollback
Voyager is an open-source framework licensed under the MIT License.