diff --git a/README.md b/README.md index 081da87..93269bd 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,89 @@ A browser application to play Go in real time. [The project in it's current state](https://play-node-go.herokuapp.com/) [Client only prototype](https://sorrelbri.github.io/browser-go-proto/) +## Setup +### Local Repo +```sh +$ git clone https://github.com/sorrelbri/node-go.git +``` + +### Install Deps +```sh +$ npm run bootstrap +``` +Runs lerna `bootstrap` command installing dependencies for project, development and package dependencies + +### Initialize Database +#### Download PostgreSQL +To verify PostgreSQL installation: +```sh +$ psql -V +``` +Node Go API was built with version 11.4. +[See documentation for Postgres download.](https://www.postgresql.org/download/) + +#### Create Databases +```sh +$ psql +# psql(11.4) +``` +```sql +CREATE DATABASE node-go; +CREATE DATABASE node-go-test; # testing database +``` + +### Configure Environment +```sh +$ touch packages/server/.env +``` + +``` +# .env +NODE_ENV=development +PORT=# set development port for API +REACT_ADDRESS=http://localhost:3000 # default +PG_CONNECTION_STRING=postgresql://localhost:5432/node-go +PG_CONNECTION_STRING_TEST=postgresql://localhost:5432/node-go-test +JWT_SECRET=# generate a secret key for JWT signing algorithm +TEST_SECRET=# same as above, for test environment +SALT_ROUNDS=# set number of salt rounds for bcrypt hashing function +DOMAIN=localhost +USER_ONE_PASSWORD=# credentials for testing with +USER_ONE_EMAIL=# same as above +``` + +### Smoke test +```sh +$ lerna run test +``` + +### Run Database Migrations +```sh +$ cd packages/server; npm run migrate; npm run seed +``` + +### Running in development +```sh +$ cd packages/server +$ npm start # or if you have nodemon +$ nodemon +``` +```sh +$ cd packages/play-node-go +$ npm start +``` + +## Known Bugs +- server side move validation not complete, full game logic not implemented +- no authorization for game moves +- websocket connections may remain open, pooling prevents runaway leaks, but tests may hang + +## Roadmap 4/20 +1. Game logic module +2. Game in progress caching +3. Auth for games +4. Game request creation + ## Features - [ ] Realtime communications - [ ] Multiple game settings diff --git a/deployment.md b/deployment.md deleted file mode 100644 index 71a4cb6..0000000 --- a/deployment.md +++ /dev/null @@ -1,8 +0,0 @@ -`hk-api=https://git.heroku.com/node-go-api.git` -`hk-play=https://git.heroku.com/play-node-go.git` - -### Server -`$ git subtree push --prefix packages/server hk-api master` - -### React -`$ git subtree push --prefix packages/play-node-go hk-play master` diff --git a/packages/play-node-go/Procfile b/packages/play-node-go/Procfile deleted file mode 100644 index e69de29..0000000 diff --git a/packages/play-node-go/src/logo.svg b/packages/play-node-go/src/logo.svg deleted file mode 100644 index 6b60c10..0000000 --- a/packages/play-node-go/src/logo.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -