Skip to content

Commit

Permalink
Yarn workspaces, dependecy upgrades, docker build (#31)
Browse files Browse the repository at this point in the history
- Moved code setup to yarn workspace packages
- Upgraded all dependencies except logux
- Create proper docker builds for db, client and server*
- Server is now bundled with webpack, too
  • Loading branch information
uncaught authored Jun 5, 2021
1 parent acf61fc commit 6f2804c
Show file tree
Hide file tree
Showing 231 changed files with 6,729 additions and 6,851 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_IMAGE=node:16.2.0-alpine3.13
DOKO_SQL_PASSWORD=sKAmqtzkQ1-QhmSdmiH2
DOKO_VERSION=0.0.0
32 changes: 7 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
yarn-cache
.pnp
.pnp.js

# testing
/coverage

/client/build
/server/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

*.sql.gz
/mysql
/packages/client/build
/packages/server/build
/.yarn-cache
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/database/lib
/database/log
/.idea/sonarlint
*.sql.gz
yarn-error.log*
5 changes: 0 additions & 5 deletions .idea/.gitignore

This file was deleted.

650 changes: 0 additions & 650 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/dataSources.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/deployment.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/doko.iml

This file was deleted.

133 changes: 0 additions & 133 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/jsLibraryMappings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/sqldialects.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

49 changes: 17 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
### Dev
- Have docker and docker-compose installed
- Install dependencies with:
```bash
./install.sh
```
- Start with `docker-compose up -d`
- Open https://localhost
- Stop with `docker-compose down`
- To delete the database, too, use `docker-compose down --volumes`
### Development Stack
- Start the proxy in background: `docker-compose up -d proxy`. This routes the websocket `/ws`-path to the server and everything else to the client.
- Start the database in background: `docker-compose up -d database`.
- If the database is not initialized, all files in `packages/database/schema` are executed.
- To fully delete the database, stop everything with `docker-compose down` and delete the `mysql` folder.
- Install dependencies: `./yarn.sh install`
- Best start server and client in separate tabs in foreground to see their output:
- Server: `docker-compose up server`
- Client: `docker-compose up client`
- Browse to https://localhost (SSL is required for using the camera)
- Until create-react-app 3.3.1 is not released, hack in [this fix for wss](https://github.com/facebook/create-react-app/pull/8079/commits/9585c26593e18296fe202bfea198130f9d0dbd34)


### Reset database
```bash
docker-compose stop -t 0 server
docker-compose rm -f server
cat xxx.sql.gz | gunzip | docker-compose exec -T database mysql doko
docker-compose up server
docker-compose restart server
```

##### SSL
- HTTPS is required for using the browser's camera
- Use an SSL-proxy like nginx, routing `/` to port 3333 and `/api` to port 3030
- Until create-react-app 3.3.1 is not released, hack in [this fix for wss](https://github.com/facebook/create-react-app/pull/8079/commits/9585c26593e18296fe202bfea198130f9d0dbd34)


### Nomenklatur
- Eine **Runde** (round) ist ein abgeschlossener Satz an Spielen, z.B. regulär 24 Spiele oder alle Spiele eines Abends.
- Ein **Durchgang** (run) sind alle Spiele bis der startende Geber wieder an der Reihe wäre. In der Regel sind das 4
Expand All @@ -31,21 +25,12 @@ Spiele, kann aber durch Pflichtsoli länger werden. Die Dauer von Bockspielen en
- Ein **Stich** (trick) ist ein Teil eines Spiels bei dem 4 Karten gespielt wurden.

### Deploy
Proper deploy process is still missing! This is more a hacky manual install/deploy
because the client build is done server-side.

- Create release tag on github and copy link to release archive (`tar.gz`)
- SSH into server and:
- Run `./publish.sh 0.0.0` with a proper version
- This will push all three images (client, db, server) to docker hub
- Push the created tag `git push --folow-tags`
- On the server, update the version for the images and then:

```bash
cd /var/www/doko
wget https://github.com/uncaught/doko/archive/v1.3.0.tar.gz
tar xf v1.3.0.tar.gz
cd doko-1.3.0
./build.sh
cd ..
./backup.sh
docker-compose down
ln -sfn doko-1.3.0 doko
docker-compose up -d
```
5 changes: 0 additions & 5 deletions build.sh

This file was deleted.

17 changes: 0 additions & 17 deletions build/api/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions build/build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions build/httpd/Dockerfile

This file was deleted.

Loading

0 comments on commit 6f2804c

Please sign in to comment.