Giter Club home page Giter Club logo

GolfyMcG's Template

This is a template that I continue to update for getting started on a any cool new web apps I'm looking to build.

Tech Stack

  • Back-end
  • Ruby 2.2.1
  • Rails 4.2.0
  • Unicorn
  • PostgreSQL
  • Ubuntu (Depends on hosting provider... but probably Heroku)
  • Front-End
  • Styling: SCSS
  • JavaScript: JQuery and Underscore
  • Framework: Bourbon with Bitter and Neat

Getting Started

This is a brief guide to getting this template started.

Dependencies

Capybara Webkit/qt

# Max OS X
$ brew install qt

# Ubuntu
$ sudo aptitude install qt

PostgreSQL

# Mac OS X
$ brew install postgresql

# Ubuntu
$ sudo aptitude install postgresql

NodeJS/NPM

Install from NodeJS.org.

Application Setup

Rename Application

This app was started prior to Rails 4.2 so we have to update the name of the application manually. Hopefully, I'll make this unncessary sometime in the future. You can also install the rename gem if you wish. Start by replacing all instances of the Template class with the name of your app:

#config/application.rb:9
module [app_name]

#config/environments/production.rb:1
#config/environments/development.rb:1
#config/environments/test.rb:1
[app_name]::Application.configure do

#config/initializers/secret_token.rb:1
[app_name]::Application.config.secret_key_base = "..."

#config/initializers/session_store.rb:3
Rails.application.config.session_store :cookie_store, key: '_[app_name]_session'

#package.json
#This one is a little more manual - just give it a read.

#README.md

Grunt and grunt-cli

$ npm install -g grunt-cli # the local node modules aren't in the $PATH, hence the global installation.
$ npm install

Foreman and .env

Don't forget to copy the .env.example file to just .env and setup your development environment variables.

$ mv .env.example .env

You should not commit your secret_key_base to version control. Use .env and your production environment variables to store that value. Also, this has been set up to allow for easily adding a gmail address to send emails while in development.

Database Name

Rename the database to something unique to the app.

#config/database.yml
...
default:
  ...
  database: [app_name]_development
test:
  ...
  database: [app_name]_test

Testing

In order to confirm that the setup is working, just run rake. I've overwritten the default task so that it will run all linting and tests including JSHint, Rubocop, and RSpec.

$ rake

Other App Setup

These are some of the basic steps needed for most web applications.

Authenticating Users

In order to generate a devise user model, start by running:

rails generate devise user
rake db:migrate

Optionally, you can then generate the views and controllers to allow for customization. The below will generate shared views for all models, but you can also pass in the specific model you would like to customize.

rails generate devise views
rails generate devise controllers

Alex Villa's Projects

chewy icon chewy

High-level Elasticsearch ruby framework based on official elasticsearch-ruby client

foxhall2 icon foxhall2

Another attempt at redesigning Foxhall Homes!

froots icon froots

My first real app to manage Froots

geocodio icon geocodio

A ruby client for the http://geocod.io/ API

mit_classes icon mit_classes

These are the files related to my work on all of my MIT Open Courseware Classes

rbattlenet icon rbattlenet

A wrapper gem for the Blizzard's Battle.net API

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.