Giter Club home page Giter Club logo

store_demo's Introduction

StoreEngine

Requirements

We'll use SQLite3 in development.

Setup

Clone the repository, then run:

bundle install &&
cp db/monster_demo db/monster_development &&
bundle exec rake db:test:prepare &&
bundle exec rails s

Provisioning Heroku

You need to create an application on Heroku.

First, you'll need a heroku account. Sign up for one if you don't have one.

You'll also need to add your public key to your heroku account. Go to the account page and look for the section called SSH keys.

For more on this, check out the Managing Your SSH Keys section of the heroku documentation.

Then, from within the project directory:

heroku create && git push heroku master

Updating Config

Open the store_config.rb in the root project directory and:

  • Change the production URL to match the URL of your heroku deployment
  • Change your email address to the one you used to register for this session

Loading Data

Let's get all our base data running on Heroku:

heroku addons:add pgbackups
heroku pgbackups:restore DATABASE
'https://raw.github.com/JumpstartLab/store_demo/master/db/monster_development.pgdump'

Install phantom.js

You'll need phantom.js to run the test suite locally:

brew install phantomjs

You're ready to go!

Performance

After getting your Heroku app up and running, fork this repo and set up a remote for it:

git remote rm origin
git remote add upstream git://github.com/JumpstartLab/store_demo.git
git remote add origin [email protected]:YOURNAME/store_demo.git

Then visit https://travis-ci.org. From there:

In your app, open store_config.rb, and change the values of production_url and email_address to your Heroku app URL and your email address:

  def self.production_url
    "http://my-demo-store.herokuapp.com"
  end

  def self.email_address
    "[email protected]"
  end

Push the updated store_config.rb to GitHub, and Travis will automatically run a set of timed tests against the specified URL. Once complete, you'll see a line at the bottom of your Travis logs that looks like this:

Runtime of 53.319523 submitted for [email protected]

This number gets sent off to Jumpstart Lab for scoring. Here's our performance goals for the night:

  • Baseline performance: 50 seconds
  • Bronze Performance: 42 seconds
  • Silver Performance: 30 seconds
  • Gold Performance: 15 seconds

Go for the gold!

Appendix

Using PostgreSQL

First edit the Gemfile to uncomment the pg line, and comment out the sqlite3 line.

bundle install
cp config/database.postgresql.yml config/database.yml
createuser -sdR monster
createdb -O monster monster_development
psql -U monster -d monster_development -f db/monster_development.pgdump
bundle exec rake db:test:prepare
bundle exec rails s

View the website at localhost:8080.

Optional Poltergeist Setup

brew update
brew install phantomjs

Welcome to Frank's Monsterporium, a faux online store

Frank's Monsterporium has the best selection, nay, the ONLY selection of Frank's awesome creations on the web.

This project was created for the gSchool StoreEngine Project. The background for this project can be found at: http://tutorials.jumpstartlab.com/projects/store_engine.html

store_demo's People

Contributors

catsby avatar diasporism avatar dominic avatar eotero avatar jcasimir avatar kytrinyx avatar mattyoho avatar peterchapman avatar raphweiner avatar thesteady 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.