Skip to content
Nodejs Starter - Open-Source Boilerplate
Branch: master
Clone or download
Latest commit 9d1fb04 Jul 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Initial import Jul 3, 2019
models Initial import Jul 3, 2019
routes Initial import Jul 3, 2019
test Initial import Jul 3, 2019
utils Initial import Jul 3, 2019
.env Initial import Jul 3, 2019
.eslintrc.js Initial import Jul 3, 2019
.gitignore Initial import Jul 3, 2019
LICENSE Create LICENSE Jul 16, 2019
README.md Update README.md Jul 16, 2019
changelog.md Initial import Jul 3, 2019
index.js Initial import Jul 3, 2019
package-lock.json Initial import Jul 3, 2019
package.json Initial import Jul 3, 2019
yarn.lock Initial import Jul 3, 2019

README.md

Nodejs Starter

Express / Nodejs Starter with JWT authentication, SQLite database, Sequelize ORM, unit tests and basic tooling. Actively supported and versioned by AppSeed


Open-Source Nodejs Starter - Product cover image.


Requirements


Authentication

Authentication is based on json web tokens. passport-jwt strategy is used to handle the email / password authentication. After a successful login the generated token is sent to the requester.


API

Login: api/users/login

POST api/users/login
Host: localhost:3000
Content-Type: application/json

{
    "email": "demo@appseed.us",
    "password": "demo"
}

Signup: /api/users/signup

POST api/users/signup
Host: localhost:3000
Content-Type: application/json

{
    "email": "demo@appseed.us",
    "password": "demo",
    "name": "George",
    "surname": "Clooney"
}

Setting up for development

  • clone repo: git clone https://github.com/app-generator/nodejs-starter.git
  • change directory to nodejs-starter:
  • create a file named .env which should contain the following default setup:
SALT=35kj7waj3k5kja09jeoi21kn0pg13iuhlkn // used in password hashing
JWT_SECRET=secret        // used in JWT signing
SESSION_SECRET=secret    // used for session data
PORT=3000                // the port on which your server will be available on
SERVER_ADDRESS=127.0.0.1 // or 0.0.0.0 for all or other interface address you want to listen
  • users are saved in file config/users.js

Scripts

Install Modules

$ npm i
$ npm i nodemon -g 

Run

$ npm run start # classic start OR
$ npm run dev # with nodemon live update  

Runs the application with nodemon. Server is listening on Port 3000 by default. This can be overwritten by PORT constant in .env file.


Support

For issues and features request, use Github or access the support page provided by AppSeed


License

MIT @ AppSeed



Nodejs Starter provided by AppSeed

You can’t perform that action at this time.