/stupid-happy

Primary LanguageRubyMIT LicenseMIT

Swoonatra - Sinatra Template for Web Apps

A Sinatra template for spinning up Heroku-ready Sinatra web applications.

New to the Sinatra DSL // Ruby Web Framework?
Check out the website HERE and GitHub Repo.

At a high level, this template comes with the following features:

  • A modular Sinatra app using Ruby 2.1.0 built in to get you started fast.
  • Local development using SQLite3 and production using PostgreSQL on Heroku.
  • Support for ActiveRecord model inheritance and database migrations.
  • Authentication Support for API, OAuth Keys, or any sensitive information.
  • Debugging tools like Better Errors, Pry Debugger, and Sinatra Reloader.
  • RSpec Integration for testing your application, models, and concerns.

I've written in comments to explain all parts of the code base for you.
This template does not come with any UI in place. That's for you to decide!


This project is made with <3 and uses a collection of tips and tricks.
Let me know if you have any suggestions via comments / pull request!

Information and Resources

Here are a few sections on how you can get started with this template.

> Up and Running

In order to use this template:

  1. Clone the repository via: git clone git@github.com:CarlosPlusPlus/swoonatra.git.
  2. cd into the repository and remove the .git folder: rm -rf .git folder.
  3. Perform a git init folder, or set as a remote to a respository already on GitHub.
  4. Ensure you have PostgreSQL installed on your machine.
    • If not installed and on a MAC, use Homebrew via Terminal: brew install postgresql
  5. Run a bundle install to install all gem dependencies.
  6. Run rackup to start your local server.
  7. Visit localhost:9292 in your favorite browswer.

All set and good to go!

> Database Setup

The SQLite3 development database will be generated when you first run rackup, and the SQLite3 database will be created when you first run rspec.

In order to customize your local databases:
In the config folder: cp database.example.yml database.yml

> Security and Authentication

In order to use API Keys, OAuth Keys, or sensitive information:

  • Rename config/authentication.example.rb to config/authentication.rb
  • Add your API and authentication tokens etc. to config/authentication.rb

This will allow you to access them everywhere via the ENV hash.

> Gemfile

Here are the gems included with this template:

Framework


Debug


Test


Development


Production

Code Status

Build Status
Code Climate
Dependency Status