Skip to content

Commit

Permalink
A lotta work (scripts n stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariansam committed Jun 11, 2023
1 parent 69cc941 commit 747824b
Show file tree
Hide file tree
Showing 20 changed files with 627 additions and 20 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ dist-ssr
pocketbase
pb_data/
pb_migrations/

# env
.env
.env.local
.env.*

# scripts data
tymy.csv
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ GJP Cup was so great that there is GJP Cup 2 now
3. `./pocketbase serve` in one terminal
4. `npm run dev` in second terminal

# Scripts
## Fill DB
To fill the database:
1. Open the Týmy Google Sheet
2. Download it as a CSV
3. Put it to the root folder (right next to this `README.md`) as `tymy.csv`
4. Run `npm run filldb`
5. --> The db gets filled with players, teams and games (games are in a really shitty order). Including one game with teachers.
You can change credentials, db url and other stuff at `scripts/filldb.ts`.

# Good to know
## Custom `pocketbase-react`
We're using our own distribution of `pocketbase-react` (available at https://github.com/radeksoft/pocketbase-react/tree/radeksoft), installed in the `package.json` as a Github repo. The installation should still be as simple as `npm install`.
Expand All @@ -19,3 +29,11 @@ We're using our own distribution of `pocketbase-react` (available at https://git
**Caveats:**
- importing by `import { ... } from 'pocketbase-react/src';` because we can't import the package (by it's `package.json`), but we're loading the source code directly
- React StrictMode is disabled, because `pocketbase-react` is not good at unsubscribing on component unmount (caused double entries on realtime updates)

## no's
Numbering of games and teams (`games.no`, `teams.no` and `misc.currentGameNo`) starts from 0. Do +1 when presenting to final user (probably never?)

## Deploy
build with `npx vite build` (not `npm run build`, coz we have typescript errors everywhere)

deploy by sth like `rsync --info=progress2 -r dist/* [email protected]:/srv/www/gjpcup.radeksoft.cz/`
Loading

0 comments on commit 747824b

Please sign in to comment.