Skip to content

Latest commit

 

History

History
127 lines (85 loc) · 3.33 KB

README.md

File metadata and controls

127 lines (85 loc) · 3.33 KB

Badman

dev

We greatly improved the development of the badman.

You now only need docker installed.

1. Environment values

  • copy .env.example to .env
  • And fill in the values

2. Install dependencies

run: npm install

3. Start database/redis cache (if needed)

run: npm run dev:up

4. Start client and server

  • run: npm start for the client
  • run: npm start api for the api

4.a First time running:

  • run the migration and seeding npx --yes sequelize-cli db:migrate && npx --yes sequelize-cli db:seed:all
  • open: http://localhost:3000/player/admin
  • login with your badman credentials
  • Claim the admin account

4. Profit

Badman should be availible @ http://localhost:3000

Debugging

Add the following to your launch.json

{
  "name": "Server",
  "type": "node",
  "request": "attach",
  "port": 9229,
  "address": "localhost",
  "localRoot": "${workspaceFolder}/code",
  "remoteRoot": "/usr/src",
  "restart": true
}

for debugging the workers use following ports:

  • worker-sync: 9230
  • worker-ranking: 9231

Generate pwa assets

https://github.com/elegantapp/pwa-asset-generator

splash

npx pwa-asset-generator "./apps/badman/src/assets/logo.svg" "./apps/badman/src/assets/icons" -i "./apps/badman/src/index.html" -m "./apps/badman/src/manifest.json" --dark-mode --opaque false --background "#303030"

npx pwa-asset-generator "./apps/badman/src/assets/logo.svg" "./apps/badman/src/assets/icons" -i "./apps/badman/src/index.html" -m "./apps/badman/src/manifest.json" --icon-only --favicon --dark-mode --opaque false --background "rgba(0, 0, 0, 0)"

npx pwa-asset-generator "./apps/badman/src/assets/logo.svg" "./apps/badman/src/assets/icons" -i "./apps/badman/src/index.html" -m "./apps/badman/src/manifest.json" --icon-only --dark-mode --opaque false --background "rgba(0, 0, 0, 1)"

speedtest

https://github.com/rakyll/hey hey -n 256 -c 8 -z 30s http://localhost:5001/api/v1/ > results.txt

Upgrade to latest packages

  1. NX_MIGRATE_USE_LOCAL=true nx migrate latest
  2. npm i
  3. NX_MIGRATE_USE_LOCAL=true nx migrate --run-migrations

Database

Restoring Database

  • download .sql.gz file
  • go into psql
  • \i path_to_sql_file

Importing / Exporting data from dev to prod

  • COPY (select * from "ranking"."RankingSystems" where "id" = '7c5cb68a-a0bf-4728-95fe-94191c5ee32a') TO '/home/backup/rankingSystems_v7.csv' DELIMITER ',' CSV;
  • Import / Export data > select the file

docker build and run

  • docker build -t badman . -f apps/api/Dockerfile
  • docker run badman --env-file .env -p 5001:5001

todo

  • Rename club: plumpjes ternat -> Carpe Pluma Ternat
  • Rename club: psv Brugge -> Koninklijke Badmintonclub PSV Brugge
  • Rename club: De valkaart -> DE VALKAART BC
  • Rename club: Hamse BC (L) -> Hamse BC (L)
  • Rename club: Very Bad'Lobbes -> Lob'Bad
  • create new club: Badminton Club Moorsel
  • create new club: Asbl Les Rollingchairs
  • create new club: The power to smash
  • create new club: Shuttle Badminton
  • create new club: Badmintonclub Aalter
  • create new club: Fun Team Leuven
  • remove memberships:
DELETE FROM "ClubPlayerMemberships"
WHERE
	"playerId" IN (
		'3028b2fc-68df-445d-a699-f6388f76303e',
		'38386ba2-34fb-45ad-ab8a-f0774bcb19da',
		'85e9bc2e-6a42-455a-b91f-958ca3bc4a16'
	)
	AND "end" = NULL