Skip to content

playliga/application

Repository files navigation

LIGA Esports Manager

Discord

An immersive CS:GO Esports Simulator.

APIs and Technologies

  • Node v20.9.x.
  • Electron v29.x.
  • Electron Forge v6.x.
  • SQLite v5.x.

Getting Started

Important

On windows, npm start must be run from CMD.exe, Powershell, or WSL2. More Info.

npm install
npm start

Resetting the Database

Important

A Pandascore Access Token is required.

LIGA uses Prisma ORM to manage its database interactions.

A unique Prisma Client is generated from the schema defined in source control which sometimes may need to be regenerated along with the database for troubleshooting purposes.

npm run db:reset

After resetting the database the teams and players data will be repopulated using PandaScore API. A token must be provided in the .env file in order for this to work.

Development CLI

Provides convenience wrappers and business logic for common development tasks.

npm run cli help

Building

Generate platform specific distributables.

More Info.

npm run make

Publishing

Important

A Github Access Token is required.

The publish command will build the application and publish it to Github as a draft release.

export GITHUB_TOKEN="<...>"
npm run publish

Generating Changelog

Currently, the changelog is generated ad-hoc and manually added to the release notes body.

This is because Github's changelog generation feature only picks up PRs and not individual commits (community/discussions/31628).

npx conventional-changelog-cli -p conventionalcommits

Updating Application Icon

The installers only accept an .ico file so it must be manually converted from the base assets/icon.png image.

More Info.

npm run gen:icon

Miscellaneous

Marketing

The resolution used for games and the app should be set to 1280x960.

The game being demoed should also be running in window mode so that the transition between app and game is seamless when taking videos.

Transcoding Videos

.webm format should be used for videos such as the one used in the landing page because .mp4 has stuttering and performance issues.

VP9 prefers to encode in two passes so the first pass compiles a log file with statistics about the video file which is then used in the second pass to make the video.

ffmpeg -i landing.mp4 -b:v 0 -crf 30 -pass 1 -an -f webm -y /dev/null
ffmpeg -i landing.mp4 -b:v 0 -crf 30 -pass 2 landing.webm

For VP9, the CRF can range from 0 (best quality) to 63 (smallest file size). It is set to 30 above for roughly, medium quality.

Converting PNG to SVG

SVGs are great for responsive apps so if it's feasible, consider converting that PNG to an SVG using ImageMagick and AutoTrace.

convert autotrace:src/assets/logo.png src/icons/logo.svg

Troubleshooting

Error: Cannot find module 'undefinedbuild/Release/node_sqlite3.node'

This is caused by editing files while the app is transpiling.