https://github.com/gcentauri/komi
Go game database exercising dry-rb and rom-rb
https://github.com/gcentauri/komi
Last synced: 3 months ago
JSON representation
Go game database exercising dry-rb and rom-rb
- Host: GitHub
- URL: https://github.com/gcentauri/komi
- Owner: gcentauri
- License: gpl-3.0
- Created: 2018-06-05T21:23:12.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-03-16T03:47:39.000Z (over 2 years ago)
- Last Synced: 2025-02-05T00:41:30.798Z (4 months ago)
- Language: Ruby
- Size: 54.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* komi
A web app for go players to organize clubs, store and access game records,
browse and comment on games, and...Also an attempt to document the process of building a Ruby web app in
2019 using a combination of new tools.[[http://rom-rb.org][ rom-rb]] providing persistence
and [[http://dry-rb.org][dry-rb]] providing data and functional tools, with [[http://roda.jeremyevans.net/][roda]] providing
routing. simple, powerful tools, hopefully a simple demonstration.** Developing the game tree 2018-06-14
[[./spec/sgf.org][go here]]** Initial State 2018-06-06
At the moment, you just have [[./bin/console]] to run the [[./lib/main.rb]] script
and load up the collection of games into an sqlite in-memory database.*** Repositories
If I understand the documentation, a =rom-repository= is an abstract interface
to the database relations defined in [[./lib/relations]]. You can think of it as
a place to ask for collections of structs. You can store stuff and retrieve
it too, but the stuff you're interacting with is application data, not
database relations. You ask the Repo to store a record of your stuff with
a 'command' like =Repo.create({my: struct})=. You define functions to
use relations to fill orders for structs to pick up from the repo. You won't
do something like =Model.save= to save the current object directly to the DB.A set of game records are in [[./assets]] which =main.rb= uses to populate the
database through the [[.lib/repositories/games_repo.rb][Games]] and
[[./lib/repositories/players_repo.rb][Players]] repositories.=Games.white_wins= returns an array of game structs where the
white player wins.=Games.player_wins("Fujisawa Shuko")= returns an array of game structs
where one of my favorite players is the winner=Players.names= returns array of all the unique players in this collection
=Players.all= returns array of all Player structs (includes rank and country)