Giter Club home page Giter Club logo

highfive_camera's Introduction

HEROKU

Install Heroku's Toolbelt, this will give you access to Heroku and the Foreman tool to start and stop your app. Download here, https://toolbelt.heroku.com/

USAGE

First things first

First time running the code you need to install the required modules that are defined in package.json. Navigate to the code directory in Terminal. Install all dependencies by running the following command.

npm install

You only need to run this code once, every time you update package.json.

Git init, commit

Create a git repository in your code directory

git init
git add .
git commit -am "init commit"

Create Heroku App

Create a Heroku app, we need to do this so we can get a database set up.

heroku create

MongoDB (MongoLab) Addon

FOR NEW HEROKU APPS THAT DON'T ALREADY HAVE A MONGODB DATABASE.

Add a MongoDB MongoLab database to your new Heroku app, we need this database to store the Image filenames that are uploaded

heroku addons:add mongolab:starter

Prepare your Environment Variable File

Need to store the MongoLab connection uri in .env for local development. We grab it from Heroku's config

heroku config --shell | grep MONGOLAB_URI >> .env

This will autofill your .env file.

Amazon Web Services

This app uses Amazon S3 Web Service for storage of the uploaded images. You must have an Amazon AWS account AND have your access credentials

Register with Amazon Web Services

Create an account on Amazon Web Services, you can use your Amazon account, http://aws.amazon.com/console/ Click on the Sign Up button.

Log in and create new S3 bucket

When you're registered and logged into the AWS site, visit the console, https://console.aws.amazon.com/console/home?#

In the Storage and Content Delivery section click on S3, scalable storage in the cloud, https://console.aws.amazon.com/s3/home.

Now we will create a bucket (like a directory). The bucket will be the container for your uploaded files. On the left panel of the S3 console, click 'Create Bucket'. Provide a bucket name and leave the Region to US Standard. Then click Create.

Add environment variables to .env and Heroku

Inside the AWS Console, on the top menu bar click on your name, then click SECURITY CREDENTIALS.

On the SECURITY CREDENTIALS page, you will have access to

  • ACCESS KEY ID
  • SECRET ACCESS KEY

Open your .env file and add 2 new variables for Amazon AWS

.env

AWS_ACCESS_KEY=XXXXXXXXXXXX
AWS_SECRET_KEY=XXXXXXXXXXX

Save your .env file.

Now let's push the new AWS variable to Heroku config, run the commands in Terminal

heroku config:add AWS_ACCESS_KEY_ID=XXXXXXXXXXX
heroku config:add AWS_SECRET_ACCESS_KEY=XXXXXXXXXXX 

You can confirm the AWS variables are on heroku by running the command,

heroku config

Start the server

Navigate to code directory in Terminal:

foreman start

If successful, your Terminal window will read...

Server started on port 5000

View the webpages

Open Web Browser and navigate to http://localhost:5000

Available URLs

Stopping the server (CTRL+C)

You must manually stop the NodeJS in the Terminal window that is running the script.

If the Terminal window, stop the script with CTRL+C

highfive_camera's People

Contributors

ilwonyoon avatar

Watchers

 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.