Code Monkey home page Code Monkey logo

nodejs-starter's Introduction

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": "[email protected]",
    "password": "demo"
}

Signup: /api/users/signup

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

{
    "email": "[email protected]",
    "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

nodejs-starter's People

Contributors

app-generator avatar sengayire avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.