Fooboard is a bare-bones app to track foosball scores. It's split between a web client written in React and an API server written in Python using Flask.
To start the Foosboard app locally, you will need to create a postgres database and migrate it.
createdb foosboard
python manage.py db upgrade
Now that the database is ready, you'll need to set the DATABASE_URL
and APP_SETTINGS
environment variables. To do so, simply run:
source server/.env.dev
Note that you may need to adjust the DATABASE_URL
in .env.dev
if your postgres user is different from your user name.
Install dependencies with:
pip install -r requirements.txt
Now, the server is ready to go. To start it, run:
cd server
python server.py
Next, we will need to start the web client.
We'll need to set an environment variable to tell the client where to find the API server.
source client/.env.dev
With the environment set up correctly, we'll now install all necessary dependencies.
npm install
Next, within the client
directory, launch the local Webpack development server:
grunt serve
This will open up the client on localhost:9000
.
Both the server and the client have a test suite. The server expects a foosboard_test
database to exist. If necessary, create the test database with:
createdb foosboard_test
Next, within the server
directory, run all tests with:
FLASK_ENV=test nosetests