Skip to content

eugene-matvejev/node-battleship

Repository files navigation

master heroku
tests tests tests
coverage coverage coverage

battleship GraphQL backend

THIS IS SPARE TIME PROJECT, WORK IN PROGRESS!

software requirements

if you're using make commands, docker and docker-compose are required, and local node.js with npm are optional

used technologies

used services

how to install

  • with make commands no steps additional required, otherwise you need execute $ npm i

how to run tests

  • $ make test or $ npm test
    • optional 'jest' CLI params some examples:
      • to generate coverage report, example: $ npm test -- --coverage, which will be located in ./coverage directory
      • to execute tests only in specific file, example: $ npm test src/graphql/user.test.js

how to run in 'development' mode

  • $ make or $ npm start

how to run in 'production' mode

  • $ make serve, there is no npm equivalent
  • if you only need to generate static assets
    • $ make build or $ npm run build - generated assets will be located in ./build directory

gitflow

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

used environment variables

variable default value used as
PORT 8081 number
DB_HOSTNAME 127.0.0.1 string
DB_USERNAME root string
DB_PASSWORD password string
DB_PORT 3306 number
DB_NAME battleship string
DB_DIALECT mysql string
SECRET_KEY local.key string

supported databases

database version
MySQL 5.7 tested, using mysql2
PostgreSQL 11 tested, using pg
SQLite 4.0.9 tested, using sqlite3