Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

game_store

This package implements an API for the game data store.

Structure

api.py has the backend of the database, deployment has the files necessary for deployment (used by the dockerfile in ../../dockerfiles, client/db.py has the database client (which is used by other services/components), and frontend has the React of the database frontend (for the administrators to use).

Usage Example

To run the api with test data with debug mode:

$ python -m ooogame.database.api --test --debug

Test data will be done using sqlite, so you don't need to set up a DB or anything.

To run against a production database and listen on port 1234:

$ SQLALCHEMY_DATABASE_URI=${db_uri} python -m ooogame.database.api --port 1234

For more information, run python -m ooogame.database.api --help.

Developing frontend

The README in the frontend is long, here's the short version:

  1. Install npm.

  2. Install all the npm packages. In the frontend directory do:

$ npm install
  1. Run the test database api using the defaults in one terminal:
$ python -m ooogame.database.api --test --debug
  1. Run the amazing (no joke) react dev environment (this will compile the react app, load a web server, auto-watch the react files, rebuild when there's a change, and auto-refresh your browser) by doing this in another terminal from the frontend directory:
$ yarn start

Migrations

This is kept for legacy reasons. We dont'

migrations directory contains the info for the migrations.

$ SQLALCHEMY_DATABASE_URI=${db_uri} flask db migrate
$ SQLALCHEMY_DATABASE_URI=${db_uri} flask db upgrade

Deployment

TODO