Skip to content

galopeian1/ror-blog

 
 

Repository files navigation

What is this?

This repo contains a sample blog built with Ruby on Rails. There are instructions below to get the app working in both development and production environments.

Requirements

  1. Articles
  • Unauthenticated users can view articles
  • Admins can create, edit, delete, and view articles
  • Article resources has title, blurb (summary of main content), body, tags, and comments
  1. Tags
  • Tags have many-to-many relationship with articles
  • Can display list of tags
  • Can display list of articles for a given tag
  1. Comments
  • Unauthenticated users can create and view comments
  • Admins can create, view, and delete comments
  • Comments are limited to five per article to avoid spamming
  1. Data
  • Article and tag data can be seeded using a database seeder
  1. Assets
  • SASS is compiled into CSS and serverd to the user
  • Coffee script is compiled into JS and served to the user
  1. Production
  • The code can run in a production environment using Nginx, Unicorn, and Linux
  • Code can be deployed via Capistrano
  • All routes are sent via SSL

Development Server

To get a development version of the app running follow the steps below:

  1. Clone the repository
  2. Run "rails server"
  3. Run "rake db:seed"

Production Server

To get a development version of the app running follow the steps below:

  1. Log onto Digital ocean and spin up a server with Ubuntu 14.04 x 64
  2. Install Ruby and rbenv according to this tutorial
  3. Configure the server with Unicorn and Nginx according to this tutorial
  • The only divergence from the tutorial is that you need to point the root in your Nginx configuration to "/public/current" instead of "/public" for Capistrano
  1. Follow this tutorial to get SSL working with LetsEncrypt
  2. Make sure that you have SECRET_KEY_BASE set and RAILS_ENV=production in your .rbenv-vars file in the root of the app
  3. Change the server settings in the "/config/deploy/production.rb" file to your server's IP and a user with sudo capability
  4. Run "bundle exec cap production deploy:inital"
  5. SSH into your server and run "rake db:seed"
  6. Navigate to your server's IP in the browser to use the blog app!

About

Sample blog built with Ruby on Rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 64.0%
  • HTML 24.2%
  • SCSS 9.6%
  • CoffeeScript 1.1%
  • JavaScript 1.1%