GithubHelp home page GithubHelp logo

wolfpool's Introduction

WolfPool

Live version - https://wolfpool.us-east-2.elasticbeanstalk.com . Sample username - [email protected], password - Santhosh@123

UberPOOL and LyftLine are very efficient and affordable for travelling short distances. However, for suburban areas and a majority of metropolitan cities this option is not available. This is mainly due to low number of people travelling on the same route. The connectivity and frequency of public transportation is limited in these areas. In addition to these issues, there are a lot of difficulties to communicate and plan the rides using social media platforms such as Facebook and Whatsapp. To tackle the problems mentioned above, we have devised WolfPool as a service that specifically targets to enhance communication and convenience in planning of rides.

Getting Started

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

Prerequisites

What things you need to install the software and how to install them. This software/system works best with Linux/MacOS. The only difference with Windows based systems is the steps involved in installation might be a bit different.

Node.js MongoDB Basic text editor like Atom, Notepad++ or even VIM/EMACS if you are into those :P

Installing

This is a step by step series about how to get a development env running

STEP 1: Download and install Node.js from here. Once you complete the installation open a terminal window (Command Prompt for windows) and type the command 'node'. If you have successfully installed you will see a prompt like this.

NodeJS working

STEP 2: Download and install MongoDB from here and install it like any other software package. Once you are done with the installation, open a terminal and type the command 'mongo'. If you have successfully installed you will see a prompt like this.

MongoDB working

STEP 3: [Optional] If you are the kinda guy who doest not like to manage a database using a terminal or command prompt you can install Studio 3T

STEP 4: Clone the repository in appropriate directory and change the current working directory to 'wolfpool' (the repository folder)

git clone https://github.com/CJ8664/wolfpool.git
cd wolfpool

STEP 5: [NOTE: Please be patient] Now we have to install all the dependencies that are mentioned in the package.json file. If you are not sure what a package.json file please check this url. Understanding this is important because unless all the dependencies mentioned in this are resolved the web application will not start.

Command to install the dependencies [Works both on a terminal or cmd prompt]

npm install --save

STEP 6: With this the basic website is setup, ironically nothing will work because of the two APIs (Google Maps API and Mailjet API) and other code changes.

  • Google Maps API - Please setup a Google Cloud account and get an API key following the neat documentation provided here. Replace this key in the file views/partials/head.handlebars, line 17. This should enable Google Maps and its functionalities on localhost for development and debugging.

    NOTE: Once you deploy the app on any online platform, please restrict the access to the Google services by limiting key access, more information here

  • Mailjet - This is a third party service that allows us to send emails, which is used heavily in this application. Please create an account from this site. Once the account is verified you can get the keys from this page. Export or set the environment variables for the API. For windows follow (this)[https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt], for linux/MacOS run the bellow commands before running STEP 5.

export MJ_PUBLIC_KEY="Your Public key"
export MJ_PRIVATE_KEY="Your Private key"
  • Open the file controllers/UserController.js and modify the hostname in line 31 that forms the hostname part of the verification link.
  • Open the file views/partials/head.handlebars and comment line 12 that redirects the traffic to HTTPS for the web application to work on localhost.

STEP 6: If all the above steps are completed successfully then you can start the bare minimum web application host [Few of the essential features on work online when hosted on a cloud service provider like Amazon Web Services]

  • Run the following Command and open localhost on a browser
node app.js
>>> Output on console will be
'Express started on http://localhost:3000 press Ctrl-C to terminate'

Now you can register as a new user and start using the web application. Once you get the

HTTPS Certificate installation [Free][Not Needed for Localhost]

You can get an SSL Certificate for your web application from https://www.sslforfree.com/. This will enable make all the data transfer on your website secure. More importantly the web application uses native HTML5 geolocation API, which works fine on localhost but fails to work once hosted on AWS or other hosting. The part to install this certificate on AWS will be covered in upcoming sections. In manual verification, your website should be able to handle the get request "yourdomain/.well-known/acme-challenge/. following code can be added to app.js -

  1. var serveIndex = require('serve-index');
  2. app.use('/.well-known', express.static('.well-known'), serveIndex('.well-known'));

related dependencies can be added in package.json if not present.

NOTE: This step is one of the step in AWS deployment but mentioned as separate step so that can be used in any other project.

Google Analytics Setup [Optional]

Please follow the step mentioned in the Google reference doc here. Once you get the analytics code you can replace it in the file views/partials/head.handlebars, lines 22 through 28. Google Analytics is a brilliant tool to understand and track Daily user activities and other details.

Amazon Web Services Deployment

  • Installing Node.js on Elasticbeanstalk: If you dont know what Elasticbeanstalk is please watch this short video (recommended) before you start. The instructions are explained clearly and exhaustively in this link

  • Installing MongoDB in the EC2 instance of the Elasticbeanstalk application: Once you have SSH access to the EC2 instance that is being used for your application, please use Putty or Terminal to remotely login into the server. Once you are looged in follow the steps mentioned in the link to install MongoDB service which can be connected locally by the Node.js service.

Reference - https://www.journaldev.com/3849/install-mongodb-linux

  • Installing SSL certificate: It has two steps, first is to get a certificate [instructions mentioned in previous section]. This certificate then needs to be registered on your AWS account. Please follow the instruction in the link to import the certificate. Next use this configured certificate in your elasticbeanstalk application. The instructions are mentioned in this link

Developer tools

  • Setting up mongo DB on server: If you wanted to set up mongo db on a server and use the machine as the db server, you can simply execute the script on the server. Script can be found in scripts folder.

Extended from WolfPool

https://github.com/CJ8664/wolfpool -> https://wpool-dev.us-east-1.elasticbeanstalk.com/

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

More about the research, references and inspiration for the project

wolfpool's People

Contributors

harshakanamanapalli avatar saiharsha1994 avatar santhoshdharmagadi avatar shyamkatta avatar

Watchers

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