Skip to content

eugene-matvejev/react-battleship

Repository files navigation

master heroku
tests tests tests
coverage coverage coverage

battleship GUI

THIS IS SPARE TIME PROJECT, WORK IN PROGRESS!

software requirements

if you're using make commands, local node.js and npm aren't required

used technologies

used services

how to install

  • if you're using make commands and have docker and docker-compose installed, then no steps required
  • otherwise you need node.js installed, and execute $ npm i

how to run tests

  • 'cypress' integration tests $ make cypress or $ npm test inside ./cypress directory
  • 'jest' unit and functional tests $ make test or $ npm test
    • optional 'jest' CLI params
      • to generate coverage report --coverage, example: $ npm test -- --coverage, report will be located in ./coverage directory
      • to run tests only in specific file, example: $ npm test src/validation/rules.test.js

how to run in 'development' mode

  • $ make or $ npm start

how to run in 'production' mode

  • $ make serve, there is no npm only analogue
    • to run on non-default port you can overwrite PORT variable, example $ make serve PORT=18080
  • if you need only generate static assets
    • $ make build or $ npm run build - generated assets will be located in ./build directory

gitflow

  • master -> most upto date production version
  • proxy branch heroku -> master is not deployed to heroku with every push, because of limiations of 'free account'
  • other branches -> 'feature branches' get merged into master CI build is mandatory check for every PR into master/heroku branches

used environment variables

variable default value used as
PORT 8080 number
REACT_APP_GAME-MIN-SIZE 5 number
REACT_APP_GAME-MAX-SIZE 10 number
REACT_APP_GAME-MIN-OPPONENTS 1 number
REACT_APP_GAME-MAX-OPPONENTS 3 number
REACT_APP_API_PROTOCOL http string
REACT_APP_API_HOST localhost string
REACT_APP_API_PORT 8081 number
REACT_APP_WEBSITE_NAME Battleship string