GithubHelp home page GithubHelp logo

timothyfell / lol_champs Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 896 KB

An app with a detailed breakdown of the champions and their stats from League of Legends using the Fantasy Data's API.

Home Page: https://quiet-cliffs-36823.herokuapp.com/

License: MIT License

Ruby 36.59% JavaScript 0.71% CSS 21.59% HTML 41.12%

lol_champs's Introduction

League Of Legends Champions

travis Heroku

Description

This is a small app that allows users to read through the stats of all of the League of Legends Champions. They can also favorite the champions to view them one screen to compare some of the basic stats and keep a running list of favorites. I used the champion data from Fantasy Data API to seed my database at first and on production have a rake task that updates the database every day at midnight.

Production: Lol Champs

Setup

  1. Clone down the repo:

$ git clone [email protected]:TimothyFell/lol_champs.git blol_champs

  1. Run:

$ bundle install # Installs dependencies

  1. Setup the database:

$ rails db:{create,migrate} # Creates and builds the postgresql databases

Contributions

If you'd like to contribute to this project, fork this repository then follow the installation instructions below. Once you've finished the feature or fixes you wish to contribute, send us a pull request and one of us will review it before merging. If we have any suggestions, comments or questions we will leave them as comments on you pull request. Thank you in advance.

Testing

To run the tests locally run the following command:

$ bundle exec rspec

API Calls

The only API call I make in this project is in my rake task. If you want to duplicate the functionality you will need to visit Fantasy Data and request and API key for their LOL endpoints. Once you do, follow these steps.

  1. Install Figaro files

$ bundle exec figaro install # creates figaro files

  1. In the application.yml file that just got created, add the following:
  FANTASY_DATA_API_KEY: your_brand_new_api_key

Database Schema

This is a simple database where users and champions are joined by a favorites table to reduce data duplication.

Schema Diagram

lol_champs's People

Contributors

timothyfell avatar

Watchers

James Cloos avatar

lol_champs's Issues

Plan and Diagram Schema

  • Decide on necessary tables
  • Decide on necessary columns
  • Create schema diagram
  • Add diagram to ReadMe

User visits '/my_favorites'

As a logged-in user
When I visit '/my_favorites'
Then I see a list of champions I've favorited
And I see a list of their major stats and a stat chart
And I see links for each champion to unfavorite them

Visitor visits '/champion_name'

As a visitor
When I navigate to a champions page '/champ_name'
Then I see a landing area with the champions name, role and a background image of them
And I see a section with a detailed breakdown of their stats
And I see a link to favorite that champion

Visitor registers

As a visitor
When I visit '/register'
And I enter my email, a password, and a confirmation password
Then I am registered with the app

Visitor tries to favorite a champion

As a visitor
When I click on favorite for a champion
Then I am redirected to the registration page
And I see a flash message that I need to signup or login to favorite champions
And I can register with my google account (google oAuth)

User Un-Favorites a Champion

As a logged-in user
When I visit my favorites or a champion's show page I already favorited
Then I see a link to unfavorite them
When I click on that link
Then I am redirected to my favorites page
and I no longer see that champion in my list
and I see a flash message telling me which champion I just unfavorited

Registered User Logs Out

As a logged-in user
When I click the logout link
Then my session is ended
And I can no longer see or visit links to my favorites or logout
And I see links to login and register
And I can no longer favorite champions

User favorites a champion

As a logged-in user
When I click on a link to favorite a champion
Then I am redirected to my favorites page
And I see a flash message telling me which champion I just added

Visitor visits '/'

As a visitor
When I visit '/'
Then I should see a landing area with a search bar
And the list of Champions
And each champion has a name and title
And both are links to the champion's show page
And the navigation should contain login and register links

Visitor registers with google

As a visitor
When I visit '/register'
Then I see a button to sign up with Google
And when I click it I am taken to Google to log in
And approve the app

Visitor logs in with Google

As a visitor
When I visit '/login'
Then I see a 'Login with Google' button
And when I click on it
Then I am redirected to google to login

Visitor Logs In

As a visitor
When I visit '/login'
And enter my email and my password
Then I am logged into the app

Create Rake tast that runs once a week

This rake task will pull a fresh set of champion data from the Fantasy Data API to make sure all champion data is up to date since there are weekly updates with stat balances and occasionally new champions.

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.