Skip to content

Latest commit

 

History

History
92 lines (65 loc) · 3 KB

BATTLESTAX.md

File metadata and controls

92 lines (65 loc) · 3 KB

BattleStax

BattleStax is a stateful JAMStack game that is wholesome fun for the entire crew.

Actions Status

Netlify Status

Open in Gitpod

Project Structure

BattleStax's folder structure is (mostly) generated from Create React App. We then add a Netlify Functions and Github Actions.

Prerequisites

  • A Github account - Github
  • A fork of the BattleStax Tutorial repository - Repository
  • NodeJS 12 - Download - Recommended alternative: Setup your local development environment with nodeenv
  • A Netlify account (it's free!) - Netlify
  • An Astra account and database (it's free!) - Astra

Using nodeenv (recommended)

Using nodeenv allows you to keep your NodeJS version and dependencies isolated for the project you're working on. To get started using it for BattleStax, install it using homebrew or easy_install.

# install using homebrew
brew install nodeenv

# install using easy_install
sudo easy_install nodeenv

Once nodeenv is installed, setup a virtualenv in the project folder, and then activate it.

# setup a nodeenv in the venv folder using NodeJS 12
nodeenv venv --node=12.18.4

# activate the nodeenv
. venv/bin/activate

Working with BattleStax

Create a .env file and fill it with values from the .env.example file.

Make sure the package dependencies are installed

# install dependencies
npm install

Then, start the app in dev mode. Changes in the src or functions directories will trigger reloads.

# start battlestax in dev mode
npm run dev

UI Storybook

To run storybook, make sure you have some {ComponentName}.stories.js files and then:

# start storybook
npm run storybook

Client Testing

Test your react/redux client

# run the client tests
npm test

Netlify Function Testing

Test your netlify functions

# run the function tests
npm run test:functions