Git Product home page Git Product logo

sinatra-heroku-boilerplate's Introduction

Sinatra / Heroku / HTML5 Boilerplate / 960 Grid System starter app

A very basic Sinatra application skeleton for deployment to Heroku using HTML5 Boilerplate and the 960 Grid System in the view.

The skeleton is designed as a starting point for rapid prototyping, with the intention of providing something that you can hack on and deploy to Heroku very quickly. I have included the tools that I use for these purposes. I would not necessarily use this as a starting point for a production-ready application, although there is no reason why you couldn't.

Installation and usage

These instructions have been written for OS X.

Pre-requisites

  • Ruby 1.8.7 or 1.9. Use RVM to manage your Ruby installations. It's good.
  • Rubygems
  • Git
  • The Bundler gem. Install with 'gem install bundler'.

Download

Use the zip / tarball link above, or:

$ git clone git://github.com/froots/sinatra-heroku-boilerplate.git
$ mv sinatra-heroku-boilerplate [your-app-name]
$ cd [your-app-name]

Initialise Git

You do not need to initialise git if you used git to download the project. If you used the zip / tarball method, then you will need to initialise git for your project. In your project directory:

$ git init
$ git add .
$ git commit -m "Initial commit"

Install dependencies

Use Bundler to install project dependencies for you:

$ bundle install

This will install gems for Sinatra, HAML/SASS, DataMapper, and various other dependencies if not already on your system. It will also create a Gemfile.lock file which will ensure that dependencies do not change on Heroku unless you explicitly rerun bundle install again.

Run locally

Bundler will have installed the latest version of Shotgun, an application-reloading version of rackup designed for local development.

To run the application:

$ shotgun

The app will be viewable at http://localhost:9393

Heroku setup

Install the Heroku gem

$ gem install heroku

Sign up for Heroku if you don't have an account.

Setup your SSH keys to allow access to Heroku if you have not already done so. Details of how to do this can be found on the Heroku website.

Create the application:

$ heroku create [app-name]

Creating [app-name].... done
Created http://[app-name].heroku.com/ | [email protected]:[app-name].git
Git remote heroku added

Deploy

To deploy the app, commit all changes and:

$ git push heroku master

Heroku will install gem dependencies specified in Gemfile and start the app.

Development

Views are created in HAML and must be created in the /views directory. CSS is written in SASS and must be created in the /views/css directory. These will be accessible at /css/[sheet].css. JavaScripts, images and other static files are kept in the /public directory.

sinatra-heroku-boilerplate's People

Contributors

froots avatar latentflip avatar

Stargazers

Arturo Escartin avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

kevinold

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.