Git Product home page Git Product logo

catstagram's Introduction

catstagram

Simple Cat version of Instragram in Ruby on Rails - for Webrails class at HEIG-VD

Context and Authors

This is a Ruby on Rails project for WebRails class at HEIG-VD, Yverdon-les-Bains, Switzerland.

Authors:

Installation

As a prerequisite, you need ruby, rails, mysql and imagemagick. imagemagick may install itself if you have apt-get (linux) or brew (macosx).

You can launch in 1-click using the script or do it manually.

When you're done, you can reach the website on

localhost:3000

You can connect as an admin with

email: [email protected]
login: admin1

Or you can connect as an user with

email: [email protected] or [email protected]
login: user12

Installation using the script

Execute the given script setup.sh, that will do everything for you. It is still necessary to check database connection settings in config/database.yml if you don't run with default params.

  • install imagemagick (supported are apt-get and brew)
  • launch mysql
  • drop & create the db in mysql
  • execute the migration
  • fill the db with the fixtures
  • launch the server (type ctrl-c to escape)
  • quit mysql

Manual installation

Install imagemagick manually.

It is necessary to set up mysql with a database catstagram first, and to check database connection settings in config/database.yml (there are several example, like with mysqld or MAMP).

Then, execute the migrations

rake db:migrate

To populate the database with some example data, type:

rake db:fixtures:load

To launch, simply type :

rails s

If you need more details, check here the complete documentation, under Installation Indications section (at the end).

Final Report

The final report, with full documentation and usage manual, is available here.

Slides of the presentation

In french, available here.

A few screenshots

Main page

img

Search query result

img

Photo view

img

Cat view

img

User view

img

Hashtag view

img

Admin views

  • see reported photos

img

  • see banned users

img

Many others are described in manual, available here under Usage Manual section.

Useful commands

For the records, the commands we used, in sequential order.

rails new Catstagram -d mysql

rails g scaffold User username:string avatar_url:string biography:text banned_until:datetime
rails g scaffold Cat catname:string description:text city:string birth_time:date
rails g scaffold Photo image_url:string caption:text view_count:integer like_count:integer report_count:integer
rails g scaffold Hashtag tag:string

rails g migration CreateJoinTablePhotoCat photo cat
rails g migration CreateJoinTablePhotoHashtag photo hashtag

rails g migration AddUserToPhotos user:references
rails g migration AddUserToCats user:references

rails g uploader Image

rails generate devise:install
# to copy devise views to be customisable
rails g devise:views
# to add devise fields to existing model User
rails generate devise User

# roles
rails generate scaffold Role name:string
rails generate migration RolesUsers

# cancan
rails g cancan:ability

#to populate the db with some fixtures
rake db:fixtures:load

catstagram's People

Contributors

valentinminder avatar paranoodle avatar

Watchers

James Cloos avatar  avatar  avatar

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.