Giter VIP home page Giter VIP logo

bgg-companion's Introduction

BGG-Companion

BGG Image

Overview

BGG-Companion is a companion application for board games using the BoardGameGeek API. Using information from a BoardGameGeek user the application can help generate a random game from collection based on number of players, download the user's board game collection as a spreadsheet, and more!

BGG-Companion is hosted via Digital Ocean here https://bgg-companion-ieqgm.ondigitalocean.app/home

Contributing

Interested in making code changes or suggesting improvements? All changes follow a pull request and approval based flow. To contribute to the project you can either :

Instructions for local development setup can be found in the wiki here.

Alias commands used for development can be found in the wiki here.

Errors

Running into issues using BGG Companion? Seeing unexpected error from commands? Is something unclear?

Feel free to create a Github issue detailing the problem!

CURRENTLY IN DEVELOPMENT AND STILL A WORK IN PROGRESS

bgg-companion's People

Contributors

aleksandrgorbach avatar halo123u avatar jdgiardino avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

bgg-companion's Issues

Enabling CORS for local development

When running a front end application in a different port than the backend, the application must allow cross origin resource sharing. This allows the front end and back end to talk to each other if they are running on diff ports. I tried using flask-CORS but I was having issues when I tried to allow specific domains (localhost:3000). Although it's easy to allow all domains to hit any endpoint. I think BGG should restrict it to only certain domains for security and to prevent unauthorized domains from retrieving data.

Board Game Geek authentication

I wonder if instead of passing in a username from a field, I could have users sign in with their board game geek account and get their user that way?

[Bug] Cache implementation on BE isn't working as expected

I got the proxy to work in react and now i am able to hit the /random_game endpoint but the create react app is setup so that when you save the file, it automatically refreshes the page. For some reason I got this long message from the BE :

HTTPSConnectionPool(host='boardgamegeek.com', port=443): Max retries exceeded with url: /xmlapi2/collection?username=JDGiardino (Caused by ResponseError('too many 429 error responses'))

Write tests for Order Games module

The OrderBoardGames class in the bgg_companaion_order_games.py module currently has no test coverage. This story is to track adding tests for it as part of the CI/Python tests.

Cleanup random_game and re-organize responsibilities

When trying to write tests for the random_game function on bgg_companion_api I realized it was pretty challenging. It made me reconsider where the logic for certain things live like where random.choice on a board game list is actually called. Is this more business logic and maybe should live within app.py where the endpoint is called? Should there be more of a contract that says give me a user and get back a list of board games? Maybe a layer inbetween app.py and bgg_companion_api? These are just things to think about for organizing the code. Here are further chicken scratch notes :
Screen Shot 2022-06-08 at 5 30 52 PM
Screen Shot 2022-06-08 at 5 31 42 PM

Don't return actual exception message for all unhandled exceptions

As Nicholas pointed out, it's probably not best to be displaying the actual exception message to users. Not only would a user not have context to the error but it could leak some unwanted information about the application and exposing some issue.

The change for this is small: Instead of return abort(Response(response=str(exc), status=500)) return a static string. But we want to hold off on this for now because the exceptions being displayed have been useful for development. Once logging has been implemented and we can rely on that, this change can be pushed out

From a collection show top rated games for a given amount of players

User Story :
As a User, I would like to be able to see from a game collection the top rated games for the given amount of players I have. For example, Aeons End can play up to 4 players but it actually has a higher rating for playing with 2 players.

Technical Details :
A more complex one might be showing games that was voted by the community the be best played with 2 players for example. Using Aeons end again as an example clicking Community: 1-4 - Best: 2 here https://boardgamegeek.com/boardgame/191189/aeons-end it shows some voting stats :
Screen Shot 2022-04-09 at 9 16 43 AM
which is also available in the API https://api.geekdo.com/xmlapi2/thing?id=191189. So doing best value divided by the total of votes for a number of players we can get the percentage. Aeons End for 2 players that would be the best (292) divided by the total (375) to get 77.9% rating for best played with 2 players.

Acceptance Criteria :

  • User can have a game collection displayed and organized by the top rated games for the given amount of players

[BUG] First request to BGG API seems to fail

This is an actual issue that's a bug I've seen come up multiple times. Will update with evidence the next time it happens. But it seems like the first time calling the BGG API in awhile the return of that request is a "please wait" sort of message. And than calling it again works. It doesn't seem like the retry client module works for this and I think it's because a response is given from the API it's just not the real response it's like an acknowledgement of the request and a please wait pending request without actually updating it. This causes an error in the python code for that first inital request and seems to also affect the front end.

I will update this issue the next time it comes up. But there will probably have to be some research here to see what exactly is happening and is the issue.

Include filtering for Game Complexity

It would nice to also be able to randomize a game that is only up to a certain complexity. This data is already available as part of the BoardGame data class so it's simply about the HTML/Javascript part

Button that downloads user's collection

User Story :
As a User, I can click a button that will download the Board Game Geek user I specified's game collection as a csv.

Acceptance Criteria

  • A BoardGameGeek user's game collection can be downloaded as a csv through BGG Companion.

From a collection show games by overall rank

User Story :
As a User, it would be nice for me to see games in a collection organized by their overall BoardGameGeek ranking. A rank is community voted standing for a game based on the average rating for a game.

Technical Details :
It would probably be easy to just show games with overall rating for example :
Overall rating 67 for Aeons End - https://boardgamegeek.com/boardgame/191189/aeons-end
Data available in api using &stats=1 parameter - https://api.geekdo.com/xmlapi2/thing?stats=1&id=191189

Acceptance Criteria :

  • User can have a game collection displayed and organized by the overall rating of games

Include link the BGG for a particular game

Would probably be easy but nice to include a clickable link to the BGG url for a particular game. Like when one is randomly chosen or in future features. Ideally this could be embedded in the name of the game. Or even better a more fancy clickable button specifically for the BGG url.

Display Google Sheets

User Story :
As a User, it would be great as a companion app if BGG Companion could optionally accept a spreadsheet with leaderboards and embed the Google Sheet into a separate tab or page within the app.

Technical Details :
This could be a feature worked on after authentication is implemented. That way the selected Google Sheets to embed is saved as a preference for the user.

Acceptance Criteria :

  • User can input what Google Sheet they would like to be embedded into their BGG Companion instance
  • Google Sheet can be embedded into the front end.

Auto-complete user field with the last user a client provided

User Story :
As a User, it would be a nice experience if the field for providing a BoardGameGeek user was automatically populated with the last user I provided.

Technical Details :

  • This will involve a basic implementation of cookies in flask
  • A cookie will have to be set at the point in time a user is set as a argument
  • A cookie will have to be requested at the point the html is rendered

Documentation :

Acceptance Criteria :

  1. When I enter a user for a random game, when I reload the page that same user is pre-populated in the field
  2. End-user has the option to either have their username saved or not

Implementing a front end using react

It would be cool to use react for building the front end. React is heavily used in the industry and there are a lot of well tested libraries we can use to display tables or any complex features that we may need in the future. I am not entirely sure what would be the best approach for separating the front end and backend. Creating a mono repo and having a dedicated backend folder and front end folder is what I was thinking about, but open to other ideas.

Include filtering for co-op /non co-op games

I think there is some data from the BGG api response about gams being co-op or not. That might require some extra logic to include in the BoardGames data class but would be really useful to have.

This might be under genre and also include other genres we want to consider.

Include image of a generated game

For the random game endpoint and future game generation endpoints, a thumbnail of the game should be included. Which right now is available from the API and we are including in the BoardGame data class.

Games should include their released year

User Story :
As a User, I would like to have the released year of a board game next to its title similar to how BoardGameGeek displays names. This is important information for the user for board games with the same title such as Dune.

Technical Details :
The release year for a board game should be available in the https://api.geekdo.com/xmlapi2/thing?id= API endpoint

Acceptance Criteria :

  • In all places a board game title is displayed, the release year for that game will be included

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.