/Wotchd

Wotchd is a tool that helps you to track and group your hours spent on watching entertainment TV Shows during the day, week, or month. Built with Rails 6, Erb, PostgreSQL, and RSpec

Primary LanguageRuby

Wotchd - a mobile application which groups your hours spent on watching entertainment TV Shows during the day, week or the month.

Wotchd

This is the Capstone project for the Ruby on Rails Course

Contributors Forks Stargazers Issues


Microverse Logo

Wotchd Application

This project is part of the Microverse curriculum in Ruby On Rails course!
Explore the docs »

View Demo Report Bug Request Feature

Wotchd is a tracker app.
It is an application to group and track your hours spent on watching your favorite TV Shows

Additional features are :

  • User can delete a program
  • User can update a group and change its icon

Table of Contents


Application Screen Shots

Wotchd - splash screen

program interface


Sign Up

program interface


Log In

program interface


Wotchd - User Home

program interface


Wotchd - New program

program interface


Wotchd - My Programs

program interface


Wotchd - My shuffled Programs

program interface


Wotchd - New Group

program interface


Wotchd - All Groups

program interface


Wotchd - Group's Programs

program interface


Video presentation

View with Loom


About The Project

The project creates a database which holds 3 tables:

- Users : Is the table containing the users' data  
  - Fields :  
    - string:   name  
    - string:   email  
    - string:   password  
    - datetime: created_at  
    - datetime: update_at  

- Programs : is the table containing the programs' data  
  - Fields:  
    - string:   name  
    - integer:  amount  
    - integer:  author_id  
    - integer:  group_id    
    - datetime: created_at  
    - datetime: update_at  

- Groups : Is the table to groups programs  
  - Fields  
    - string: name  
    - string: icon  
    - datetime: created_at  
    - datetime: update_at  

We have 2 tables created by the ActiveStorage to store users and groups avatars as well.

- active_storage_attachments  
- active_storage_blobs  

N+1 Problem

The n+1 problem encountered in this project is the association between a user, programs and groups (retrieve all the programs associated with a group or not of a user.)

  has_many :programs, -> { includes :group }, class_name: 'Program'

Scope examples

Exemples for Program class

  scope :no_group, -> { where group_id: nil }
  scope :daily, -> { where(created_at: Time.now.beginning_of_day..Time.zone.now) }
  scope :weekly, -> { where(created_at: Time.now.prev_day(days = 7)..Time.zone.now) }
  scope :monthly, -> { where(created_at: Time.now.prev_month(months = 1)..Time.zone.now) }

ERD

ERD


Live version

You can see it working on [Heroku]

Application Instructions

  • A guest user open the app and access the splash screen which display the logo and two buttons, login and sign up
  • You need to sign in with only your name if you already have an account or sign up in order to navigate through the app
  • When logged in,
    • You can see all your programs and your shuffled programs by clicking on the appropriate buttons
    • You can create a new program and add a group or not to it
    • You can see all existing groups by clicking on the link 'All group' in the main page
    • You can create a new group of programs by clicking on the green button in the bottom of the page ('All groups page')
    • you can edit a group by clicking on the button in the top right corner of the group's show page
  • Click in the small sidebar in the user profile page to have a resume of your hours watched for the current day, the week (the last 7 days), and the month (the last 30 days)

System Requierments

  • Ruby
  • Rails
  • Yarn
  • RSpec
  • ActiveStorage

Dependencies

  • gem 'rspec-rails'
  • gem 'capybara'
  • gem 'selenium-webdriver'
  • gem 'chromedriver-helper
  • gem 'bcrypt'
  • gem 'rack-cors'
  • gem 'factory_bot_rails'
  • gem 'rails-controller-testing'
  • gem 'faker'
  • gem 'capybara'
  • gem 'guard-rspec'
  • gem 'launchy'
  • gem 'aws-sdk-s3'
  • gem 'coderay'

Configuration

  • first, clone the project Run
  git clone https://github.com/ericmbouwe/Wotchd.git
  • Install the necessary dependancies Run
  rails db:create
  rails active_storage:install
  rails db:migrate

  bundle install
  yarn install

Development

  • Clone the project
  https://github.com/ericmbouwe/Wotchd.git

Testing

In order to run tests, run this command first

rails generate rspec:install

Then run

  • For full tests
bundle exec rspec spec
  • For a specific model
 bundle exec rspec spec/models/{model_name}_spec.rb   

Unit and integration tests have been done using RSpec an Capybara

  • Location ./spec/

Built With

This project was built using these technologies.

  • Ruby version 2.6
  • Ruby On Rails version 6.0
  • rspec
  • capybara
  • ActiveStorage
  • Heroku
  • Bootstrap 4
  • AWS

Contributors

👤 Author

Eric Mbouwe


CopyRight

Thanks to Gregoire Vella

Gregoire Vella on Behance
And his ideas, for the original design

Acknowledgements