As part of the Makers Academy syllabus, I was asked to produce an Instagram clone using Ruby on Rails.
My solution, instaRails, allows users to sign up/in/out, submit posts and comment/like other users' posts.
It's a Ruby project, so it's probably for the best if you you have Ruby installed. If you're on Linux or a Mac then you're probably good to go but otherwise download and install it from here.
The easiest way to get started is to install all of the requisite gems and dependencies via Bundler. If you've not used Bundler before, run the following at the command line:
gem install bundler
instaRails uses ImageMagick to magically resize images uploaded by users as posts or profile pictures. To install ImageMagick, simply enter the following at the command line:
brew install imagemagick
Firstly, download a copy of this repository by running the following command:
git clone https://github.com/bwk103/instaRails.git
Next, install the necessary gems using the following commands:
bundle update
bundle install
To create the necessary database tables, run the following command:
rails db:migrate
If you want to seed the databse with some example users (images not included in github repo), run
rails db:seed
To run instaRails on a local server run the following command and navigate to localhost + 'YOUR_PORT_NUMBER'.
rails server
By default the application will be run on localhost:3000.
Create an account, add a post and enjoy the lack of FOMO that comes with a single-person version of Instagram.
It couldn't be any simpler to run my tests. Simply enter the following command, sit back, and enjoy all the green text.
rails test
If, for some reason, you don't have the time to wait for 202 assertions to complete, you can also choose to run the model, controller and integration tests separately by running the following commands:
rails test:models
rails test:controllers
rails test:integration
-
Rails - Web framework
-
MiniTest - Testing framework
-
Bootstrap - Front end component library
-
BCrypt - Password encryption
-
jQuery - HTML document traversal
-
CarrierWave & ImageMagick - image optimisation
Ben Kielty
- Challenge set by Makers Academy
- Rails tutorials from Michael Hartl
- Landing Page background from Unsplash
- Seed profiles from Random User
- Fake bios from Silly Twitter Bio