/voyager-auth

The Voyager app development framework with user auth built in.

Primary LanguageCSS

About Voyager

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 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.

Getting Started

  1. Download the Voyager command line interface (CLI) with NPM:

     npm install -g voyager-cli
    
  2. 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.

  3. Change directory to newApp and start the Voyager server:

     cd newApp
     npm run dev
    
  4. Your app should open up automatically at http://localhost:3001 and you should see the Voyager start up page.

Auth Setup

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.

  1. Create a file called .env in the root of your newly generated Voyager project

  2. 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=
    
  3. 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
    
  4. Install knex if you haven't already:

     npm install knex -g
    
  5. Run knex migrations:

     knex migrate:latest
    
  6. 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.

Quick Docs

Knex Migration API

Run Migrations: knex migrate:latest

Rollback Last Migrations: knex migrate:rollback

License

Voyager is an open-source framework licensed under the MIT License.