Coder Social home page Coder Social logo

dresosh / nem-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from steveblue/nem-server

1.0 2.0 0.0 328 KB

A boilerplate RESTful API for projects using Node, Express, and MongoDB.

License: GNU General Public License v2.0

CSS 13.12% HTML 38.97% JavaScript 47.91%

nem-server's Introduction

#Node Express Mongoose Boilerplate

##API Boilerplate v0.0.2

This repo is a boilerplate for creating new RESTful APIs with Node.js. Out of the box, the API offers user authentication by username and password. Some endpoints are protected and require user authentication. Create a new user, login, and begin making requests. Reference the provided templates to create your own Controllers and Routes. Users are saved in MongoDB using Mongoose. Authorization is provided by Passport, Sessions created with express-session and a cookie set on the user's browser.

Authors: Steve Belovarich

###Prequisites

  • node
  • npm
  • gulp
  • mongodb database

###Installation

NOTE: If you do not have npm or gulp you will need to install them globally.

brew install node

npm install --global gulp

  1. Clone the repo into a local folder or install via bower ```bower install nem-boilerplate``.
  2. cd into project folder
  3. run npm install

###Local Development Environment

server.js depends on a configuration file not included in the repo.

Create config.js in the root folder and add the following content to the file.

var nemConfig = {
  origin: 'localhost',
  originPort: 4444,
  mongo: 'localhost',
  mongoPort: 27017,
  key: 'thesessionkey'
};


module.exports = nemConfig;

You can use config files like this to deploy the nem server to multiple environments.

To start the express server, run gulp dev or node server in the root folder.

Changes to .js files will update the server and restart it when using gulp.

Here is a simple front end SPA example that uses XMLHttpRequest to login, logout and signup a User.

###TODO

  • Add user image and image handling example.
  • Create better error reporting for login and signup.
  • Create endpoints for password recovery.
  • Integrate package for emailing notifications to Users.
  • Integrate package for texting notifications to Users.
  • Expand the Strategies used with passport to offer login with Facebook, Twitter, Github, and more.
  • Update gulp tasks to build for multiple environments.
  • Settle on doc solution, probably doxx.
  • Implement tests.

nem-server's People

Contributors

steveblue avatar

Stargazers

Andre Soschinski avatar

Watchers

James Cloos avatar Andre Soschinski 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.