Skip to content

Opinionated curated list of good food available around your neighborhood.

Notifications You must be signed in to change notification settings

npkumar/food-finder

Repository files navigation

Food Finder

Opinionated curated list of good food available around your neighbourhood.

Live Application

Works best on a mobile! FoodFinder

Please use https since we use the GeoLocation API

Usage

  1. Ensure, location access is allowed on your phone or browser
Allow Location Location Settings
  1. From home screen, get recommendations on restaurants nearby. Clicking on a card, provides more details. Get directions opens up google maps if on an android phone.
Home List Detail
  1. One cannot add reviews unless signed in. Follow the signin/signup process to authenticate yourself.
Signin Signup Signin Signin success
  1. Once signed in, add review button is enabled. Add a review!
Review enabled Add review After add review

Local Development

  1. Clone this repository. App was last tested on Node v9.3.0
  2. Keys and Credentials:

2.1. Firebase for backend authentication and as database. Do get the required keys from Firebase.

Because of firebase, we don't need a schema prepared beforehand. However, the design for reviews follows a simple pattern like

your-firebase-database
--reviews
  --restaurant1
  --restaurant2
    -LongKey1
      created: "2018-03-17T21:15:00+08:00"
      restaurantId: "island-creamery-singapore"
      review: "The good stuff"
      username: "monkey"
    -LongKey2
      created: "2018-03-17T21:15:48+08:00"
      restaurantId: "island-creamery-singapore"
      review: "Rum and Beer flavours!"
      username: "getnpk"

Firebase Database Rules

{
  "rules": {
    ".read": true,
    ".write": "auth != null"
  }
}

2.2. Yelp API for nearby business based on location from Yelp Developers

  1. Populate contents of src/config.json with above data. For example:
{
  "firebase": {
    "apiKey": "apiKey",
    "authDomain": "authDomain",
    "databaseURL": "https://database-url.firebaseio.com",
    "projectId": "projectId",
    "storageBucket": "bucket.appspot.com",
    "messagingSenderId": "9999999999"
  },
  "yelp": {
    "authorization": "Bearer VeryLongKeyHere",
    "baseUrl": "https://api.yelp.com/v3/businesses/search"
  }
}
  1. Run npm run dev. Good to go!

Production Deployment on Heroku

  1. Set up Heroku toolchain Toolchain
  2. Use a git branch called heroku specifically for Heroku deployments
  3. Changes to be made on heroku branch

3.1. Remove /dist/ from .gitignore. We need this folder to be deployed

3.2. src/config.json is to be commited unlike in master branch

Build and deploy to production

  1. heroku login
  2. Set up a heroku project and point heroku to that project heroku git:remote --app <YOUR-PROJECT-NAME-HERE> For example, git remote -v now shows you:
heroku  https://git.heroku.com/food-finder-earth.git (fetch)
heroku  https://git.heroku.com/food-finder-earth.git (push)

At this stage, ensure master has all the changes you need to push to production.

  1. Checkout heroku branch with git checkout heroku

  2. Rebase heroku with master with git pull --rebase origin master

  3. Build for production with npm run build. This step will update our dist folder with latest changes.

  4. Add all changes and commit with a version

git add -A
git commit -m "Deploy version 1.0.2"
  1. Finally deploy to heroku
git push heroku heroku:master --force
  1. Done!

CI and deployment

Can consider automating above steps by a simple shell script and or using Travis-Heroku-Specific-Branch to deploy a specific branch to Heroku.

This project was built with guide and docs for vue-loader.