Closed mzmcbride closed 6 years ago
That is the next major step for this project.
One major hurdle I have to figure out though is how I handle the database. I don't want to open my database for everyone to use whenever they want for whatever reason, but the data is a crucial part of the program so anyone that wants to fork really needs it.
I don't know what the current database engine is or the size of the database, but https://www.sqlite.org/ might be a nice option. You could provide database snapshots with a sync script to get the latest scores. Or you could provide a script that does a full database generation and population. If I knew more about how the existing database was created, I could maybe provide additional feedback, but as it is, I'm mostly just shooting in the dark. :-)
The database is hosted on heroku, which is also hosting my site. I scraped the data from pro football reference, but I intentionally left that code out of the repo since scraping is generally frowned upon. I could look into providing a script that copies my database.
As for the size, its 1 entry per unique score (a little over 1000), plus a few extra rows for some metadata, so it's actually pretty small at the moment.
Since you've already got a working Web server and DNS set up, a really quick and simple solution might be to do a one-time database dump/export and provide it at a URL such as https://scorigami.herokuapp.com/downloads/latest.db.dump.sql. This would unblock development work while a better and more sustainable solution is planned and implemented. Then someone like me could grab this database over HTTP(S) and import it manually and/or write a nice wrapper script to do the same.
Or, this idea is somewhat loopy, but if, for example, you went unresponsive, one option I thought of was taking the JSON output available at https://scorigami.herokuapp.com/data and using that in a script as source input data to re-create the needed database. Along with the source code in this repository, doing this database schema re-creation and database population is feasible, but it's pretty silly and circuitous. Still, the underlying idea potentially has merit: having a script that creates a database by accessing https://scorigami.herokuapp.com/data might not be so crazy. You could think of it as basically poor man's replication.
It would be nice if this repository included a README file with setup instructions. Having a README file with setup instructions would make getting started on development work a bit easier.