Coder Social home page Coder Social logo

bugfree-bear's Introduction

A clean start.

Most applications have access control with access to privileged material. This clean start comes with Devise for user authentication and CanCan and RoleModel for controlling access to privileged method calls and material.

Your development environment should take the following into consideration when using this repository.

  1. create GitHub account, if does not yet exist
  2. send email to request being added as collaborator to GitHub project
  3. should also receive email invite for Heroku project and create account when prompted to
  4. verify existence of or install heroku toolbelt
  5. verify existence of or install ruby 1.9.3 (Mac OSX, Mountain Lion)
  6. verify existence of or install bundler 1.2.1
  7. verify existence of or install PostgreSQL (Mac OSX)

Clone the GitHub repository:

Once your development environment is set up, you should be ready to work on dcvezzani/golden_monday.

git clone [email protected]:dcvezzani/golden_monday.git
cd golden_monday
bundle install --binstubs

Set up your PostgreSQL database.

Replace 'dbprefix' with desired database prefix value. This manually takes the place of ./bin/rake db:install.

# log in as super user
# [command line]
psql -d postgres -U davidvezzani

# create user and database
# [psql prompt]
create user dbprefix_admin with password 'admin!#13';
CREATE DATABASE dbprefix_development OWNER dbprefix_admin;
GRANT ALL ON DATABASE dbprefix_development TO dbprefix_admin; 

# create test user and test database that can run with rspec tests
# [psql prompt]
CREATE USER rails with SUPERUSER CREATEDB password 'rails.admin!#13';
CREATE DATABASE dbprefix_test OWNER rails;
GRANT ALL ON DATABASE dbprefix_test TO rails; 

# quite psql
\q

Create config/database.yml

While Heroku will create its own config/database.yml file during each deployment, you will need to set up your local development environment accordingly.

# -e renders newlines (\n)
# '!' escapes the history (!) character
# [command line]
echo -e "development:\n  adapter: postgresql\n  database: dbprefix_development\n  username: dbprefix_admin\n  password: admin"'!'"#13\n  encoding: utf8\n  pool: 5\n \ntest: \n  adapter: postgresql\n  database: dbprefix_test\n  username: rails\n  password: rails.pass13"'!'"#\n  encoding: utf8\n  pool: 5" > config/database.yml

mkdir db/migrate
bundle install --binstubs
./bin/rake db:migrate db:migrate:status

Set up convenience shell scripts

Start your server and open the home page in your browser.

Usage: ./open.sh

# open local web server home page in browser
echo -e "open http://localhost:3696" > open.sh
chmod 755 open.sh

Usage: ./start.sh

# start the web server
echo -e "#GMAIL_USERNAME=asdf GMAIL_PASSWORD=asdf RAILS_ENV=development bundle exec rails s -p 3696\nRAILS_ENV=development bundle exec rails s -p 3696" > start.sh
chmod 755 start.sh

Develop and test code

Repeat until ready to deploy

git add .
git commit -m "adds notes to indicate what work was done"
git pull
# resolve conflicts, if any, and commit again
git push

Deploy code to Heroku

Once your done writing and testing code, you are ready to deploy.

# do this the first time to connect to the right Heroku repo
# once this is executed, it should not be necessary to do it again
git remote add heroku [email protected]:young-peak-9813.git

git pull heroku master
# resolve conflicts, if any, commit
git push heroku master

# synch up with github, if necessary

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.