bric a brac is a 2 player variant of the atari classic breakout built using Hathora.
To run locally:
- Have node installed
- Get a Hathora
appIdandappSecretvia https://console.hathora.dev/ - Get a Hathora developer token (see https://hathora.dev/docs/guides/generate-developer-token)
- Create a .env file at the root with
HATHORA_APP_ID=<appId>
HATHORA_APP_SECRET=<appSecret>
DEVELOPER_TOKEN=<appToken>
- Start server: inside
serverdirectory runnpm start(remember tonpm installfirst) - Start client: inside
clientdirectory runnpm start(remember tonpm installfirst)
Server:
- Run
hathora-cloud deploy --appId <appId> --roomsPerProcess 1 --planName tiny --transportType tls --containerPort 4000 --env '[{"name": "DEVELOPER_TOKEN", "value": "<appToken>"}]'
Client:
- cd to
commonand runnpm install && npx tsc - Then cd to
clientandnpm run build - Now you can deploy
distto any CDN like Vercel or Netlify