Skip to content
This repository has been archived by the owner on Jun 26, 2019. It is now read-only.

leesander1/hearmenow-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hearmenow Server App

dependencies Status Build Status devDependency Status Open Source Love

Get the Electron App: hearmenow-electron

Heroku: hearmenow-development hearmenow-production

Never use a work phone again. Hearmenow is a open source application that allows you to take and make phone calls from your computer. This repository is the backend to our app.

Getting Started

These instructions will provide information on the overall design and project structure. They will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Design Architecture

Client-Server

  • Client renders views dynamically & limits requests to server
  • Client only makes requests to server as needed
  • Client Stores states
  • Server handles requests & returns json
  • Server middleware handles user auth, sessions, cookies and DB
  • Server handles twilio api requests from user & returns auth token to the user from the api

Object Model

Prerequisites

MongoDB

  • Run mongo --version and should get a response if installed correctly.

Node.js

Nodemon

  • (Helpful but not required)
  • Run npm install -g nodemon to install.
  • Can now edit package.json or simply run nodemon server.js

Developers

To get involved with this project, you'll need to do a few things:

  1. Download Node.js.
  2. Clone this repository by running git clone https://github.com/leesander1/hearmenow-server.git in the location of your choice.
  3. Download the dependencies by running npm install when you're in the project directory.
  4. Create new '.env' file following the example.env and input your api keys and environmental variables accordingly.
  5. To start run npm start or nodemon server.js
  6. The server should be accessible at localhost:3000
  7. Get the electron app link
  8. Deploy server.

Running the tests

Tests are run using mocha

Create Tests

Add new .js file to /tests folder.

Run Test

npm test

Project structure

Name Description / Purpose
server.js The main application file and entrypoint.
config/passport.js Passport strategies and middleware to manage login.
models/User.js Mongoose schema and model for User.
public/ Static assets (fonts, css, js, img).
controllers/api.js Controller for /api route and to manage twilio requests.
controllers/home.js Controller for home.
controllers/user.js Controller for user account management.
test/ Folder containing all our unit tests for mocha.
example.env Your API keys, tokens, passwords and database URI.
package.json npm package dependencies & node config
.travis.yml Contains travis ci configuration settings

Tools Used

  • Time/Date - moments
  • User Management/Sessions - passport
  • DB - mongodb / mongoose mlab
  • CI - travis ci
  • Hosting - heroku
  • Dependency Management - david
  • Tasks - cron
  • Voice / SMS - twillio
  • Email - sendGrid
  • Notifications - google cloud messaging (polymer component)
  • Front-end / Templating - electron / polymer & handlebars
  • Package Manager - npm / yarn

Packages

(See package.json) but at a glance, the following packages are / will be used.

  • async
  • bcrypt
  • chalk
  • compression
  • connect-mongo
  • dotenv
  • express
  • errorhandler
  • lodash
  • passport-local
  • moments
  • supertest
  • sinon
  • eslint
  • express-session
  • body-parser
  • express-validator
  • serve-favicon
  • mongoose
  • mocha
  • nodemailer
  • passport
  • passport-google-oauth
  • request
  • twilio
  • validator

Contributing

  1. Clone repo. We work off the development branch.
  2. Create new branch for your feature.
  3. Submit pull request for your branch into development.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Changelog

1.0.1 (Feb 27, 2017)

  • Updated dependencies

1.0.0 (Feb 22, 2017)

  • Initial Setup

Authors

See also the list of contributors who participated in this project.

License

MIT

Acknowledgements