Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump API #7

Open
tjg17 opened this issue Nov 20, 2015 · 14 comments
Open

Bump API #7

tjg17 opened this issue Nov 20, 2015 · 14 comments
Assignees

Comments

@tjg17
Copy link
Member

tjg17 commented Nov 20, 2015

@suyashkumar What do you want for the bumpsite API to interface with Bump explore?

@tjg17
Copy link
Member Author

tjg17 commented Nov 21, 2015

Let's wait til input but this was previous

@KaighnKevlin suyashkumar/bump-explore#3

@suyashkumar
Copy link

Sup y'all! The following API endpoints would spur the development and performance of not only bump explore but also other bump related apps:

  • GET /api/games/:user to return all game data for the given user as JSON
  • GET /api/games/compare/:p1/:p2 to get all games played between p1 and p2
  • GET /api/users list of all users currently known to system, current rank, elo
  • GET /api/games return all game data (database export essentially).

Bump Explore implements many of these functions already (for example http://bump.suyashkumar.com/api/compare/Suyash/Josh ) and I believe the above to be fundamental features for any bump API. In general this will allow bump explore to perform calls on demand instead of having to essentially cache and refresh your database on the bump explore server, meaning this (and other apps) can work in real time! I can do some of the heavy lifting for things like computing elo history and such (that would not be in real time as that would be dependent on periodic refresh of the data).

If your MySQL database can accept multiple connections, I can write a simple nodejs server running on a different port on your VM to implement this API, which may be a nice course of action. Let me know what the plan is guys!

@suyashkumar
Copy link

I should also mention that the bump explore server could be migrated to run locally on your VM on a different port if multiple mysql database connections can happen

@tjg17
Copy link
Member Author

tjg17 commented Nov 25, 2015

We are using SQLite which I believe is capable of accepting multiple connections: http://www.sqlite.org/faq.html#q5

As an aside, @KaighnKevlin was considering changing to Postgres database but not sure if that is still the case.

@tjg17
Copy link
Member Author

tjg17 commented Nov 25, 2015

@suyashkumar What do you want included in all game data? The website will now contain info about winner/loser/table/side/first ball advantage/sweep/bfg as well as who recorded the game. Elo information is not contained in the games as that depends on the game order as well as who is ranked at a given time.

@suyashkumar
Copy link

All of that information would be fantastic! Bump Explore can handle the elo calculations with single-day resolution, no worries on that front. Seeing as y'all are using sql (and I think postgres supports multiple database connections) we should talk about either moving bump explore to that server or writing an API to expose the endpoints I exposed above (either as part of your Django server [ideal] or as a small NodeJS server the will run on a different port on your server to serve the API routes--I can help with the NodeJS if that's the way this goes).

@KaighnKevlin
Copy link

Yo dudes! Added the api:

examples:
/api/games
/api/games/Kaighn
/api/games/Kaighn/Tyler
/api/players

@tjg17
Copy link
Member Author

tjg17 commented Dec 15, 2015

Very cool! Does the API update for all games played or only on Friday at 5pm when rankings are compiled?

@KaighnKevlin
Copy link

Yep, works realtime!

Sent from my iPhone

On Dec 14, 2015, at 10:16 PM, Tyler Glass notifications@github.com wrote:

Very cool! Does the API update for all games played or only on Friday at 5pm when rankings are compiled?


Reply to this email directly or view it on GitHub.

@suyashkumar
Copy link

Amazing guys, I’ll work on integration with Bump Explore! Well done!

Suyash Kumar
Biomedical Engineering and Computer Science, Duke University (2016).
Innovation Studio Technical Consultant, OIT, Duke University
http://suyashkumar.com/

On Dec 14, 2015, at 10:25 PM, Kaighn Kevlin <notifications@github.commailto:notifications@github.com> wrote:

Yep, works realtime!

Sent from my iPhone

On Dec 14, 2015, at 10:16 PM, Tyler Glass <notifications@github.commailto:notifications@github.com> wrote:

Very cool! Does the API update for all games played or only on Friday at 5pm when rankings are compiled?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-164633325.

@suyashkumar
Copy link

Sup y'all--when I see "winner": 1013, "loser": 1042 how do I resolve those into names or players? Can we get an API endpoint for this? Didn't see that info in /api/players, but maybe missed it. Or ideally if the /api/games endpoint returned player information that'd be cool!

@tjg17
Copy link
Member Author

tjg17 commented Dec 21, 2015

It looks like the "pk" field for each player on api/players has the identifier number that is listed on the games page.

@KaighnKevlin Can we switch out these pk IDs with player identifiers easily on the games Api pages?

@tjg17 tjg17 reopened this Dec 21, 2015
@tjg17
Copy link
Member Author

tjg17 commented Dec 22, 2015

@KaighnKevlin Would it be possible to make the player identifier our Primary Key in the database instead of the numeric PK we are using now? I think this would make the API more readable and likely to be used by other apps.

@tjg17
Copy link
Member Author

tjg17 commented Jan 13, 2016

@suyashkumar Let us know if you have any other questions but the API should be ready for integration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants