├── .eslintignore ├── .eslintrc.cjs ├── .github ├── dependabot.yml └── workflows │ ├── avalon.yml │ ├── boggle.yml │ ├── build.yml │ ├── chat.yml │ ├── chess.yml │ ├── codenames.yml │ ├── poker.yml │ ├── pong.yml │ ├── publish.yml │ ├── rock-paper-scissor.yml │ └── uno.yml ├── .gitignore ├── .npmpackagejsonlintignore ├── .nvmrc ├── .prettierrc ├── LICENSE ├── README.md ├── docs ├── README.md ├── _sidebar.md ├── architecture.md ├── assets │ └── custom.css ├── builder │ ├── README.md │ ├── auth.md │ ├── cli.md │ ├── client.md │ ├── data-flow.md │ ├── deploy.md │ ├── hathora-yml.md │ ├── methods.md │ ├── networking.md │ ├── server.md │ ├── showcase.md │ ├── state.md │ ├── tutorial_among_us.md │ ├── tutorial_platformer.md │ ├── tutorial_uno.md │ └── type-driven-development.md ├── buildkit │ ├── README.md │ ├── tutorial_3d_platformer.md │ └── tutorial_top_down_shooter.md ├── cloud │ ├── README.md │ └── reference.md ├── glossary.md ├── index.html ├── roadmap.md └── statics │ ├── GitHub-Mark-Light-32px.png │ ├── appId-appSecret.png │ ├── arch.png │ ├── arrow-top-right-box.svg │ ├── avalon_proto_ui.png │ ├── console_upload.png │ ├── deploy-configuration.png │ ├── logo.svg │ ├── reg-logo.svg │ ├── stack.png │ ├── uno_end.png │ └── uno_start.png ├── examples ├── avalon │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json ├── boggle │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── client │ │ └── prototype-ui │ │ │ └── plugins │ │ │ └── BoggleBoard │ │ │ ├── index.tsx │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ └── tsconfig.json │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pf.d.ts │ │ └── tsconfig.json ├── chat │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json ├── chess │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── client │ │ └── prototype-ui │ │ │ └── plugins │ │ │ └── Board │ │ │ ├── index.ts │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ └── tsconfig.json │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json ├── codenames │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── client │ │ └── prototype-ui │ │ │ └── plugins │ │ │ └── Cards │ │ │ ├── index.ts │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ └── tsconfig.json │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── tsconfig.json │ │ └── words.ts ├── poker │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── client │ │ ├── prototype-ui │ │ │ └── plugins │ │ │ │ └── Card │ │ │ │ ├── index.ts │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ └── tsconfig.json │ │ └── web │ │ │ ├── .gitignore │ │ │ ├── index.html │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── postcss.config.js │ │ │ ├── src │ │ │ ├── App.tsx │ │ │ ├── assets │ │ │ │ ├── 2C.svg │ │ │ │ ├── 2D.svg │ │ │ │ ├── 2H.svg │ │ │ │ ├── 2S.svg │ │ │ │ ├── 3C.svg │ │ │ │ ├── 3D.svg │ │ │ │ ├── 3H.svg │ │ │ │ ├── 3S.svg │ │ │ │ ├── 4C.svg │ │ │ │ ├── 4D.svg │ │ │ │ ├── 4H.svg │ │ │ │ ├── 4S.svg │ │ │ │ ├── 5C.svg │ │ │ │ ├── 5D.svg │ │ │ │ ├── 5H.svg │ │ │ │ ├── 5S.svg │ │ │ │ ├── 6C.svg │ │ │ │ ├── 6D.svg │ │ │ │ ├── 6H.svg │ │ │ │ ├── 6S.svg │ │ │ │ ├── 7C.svg │ │ │ │ ├── 7D.svg │ │ │ │ ├── 7H.svg │ │ │ │ ├── 7S.svg │ │ │ │ ├── 8C.svg │ │ │ │ ├── 8D.svg │ │ │ │ ├── 8H.svg │ │ │ │ ├── 8S.svg │ │ │ │ ├── 9C.svg │ │ │ │ ├── 9D.svg │ │ │ │ ├── 9H.svg │ │ │ │ ├── 9S.svg │ │ │ │ ├── AC.svg │ │ │ │ ├── AD.svg │ │ │ │ ├── AH.svg │ │ │ │ ├── AS.svg │ │ │ │ ├── JC.svg │ │ │ │ ├── JD.svg │ │ │ │ ├── JH.svg │ │ │ │ ├── JS.svg │ │ │ │ ├── KC.svg │ │ │ │ ├── KD.svg │ │ │ │ ├── KH.svg │ │ │ │ ├── KS.svg │ │ │ │ ├── QC.svg │ │ │ │ ├── QD.svg │ │ │ │ ├── QH.svg │ │ │ │ ├── QS.svg │ │ │ │ ├── TC.svg │ │ │ │ ├── TD.svg │ │ │ │ ├── TH.svg │ │ │ │ ├── TS.svg │ │ │ │ └── hathora-hammer-logo-light.png │ │ │ ├── components │ │ │ │ ├── ActiveGame.tsx │ │ │ │ ├── ActivePot.tsx │ │ │ │ ├── CardComponent.tsx │ │ │ │ ├── Lobby.tsx │ │ │ │ └── PageLoader.tsx │ │ │ ├── constants │ │ │ │ └── rankConversion.ts │ │ │ ├── context │ │ │ │ └── GameContext.tsx │ │ │ ├── hooks │ │ │ │ └── useAutoJoinGame.ts │ │ │ ├── index.css │ │ │ ├── main.tsx │ │ │ ├── pages │ │ │ │ ├── Game.tsx │ │ │ │ └── Home.tsx │ │ │ └── vite-env.d.ts │ │ │ ├── tailwind.config.js │ │ │ ├── tsconfig.json │ │ │ ├── tsconfig.node.json │ │ │ └── vite.config.ts │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json ├── pong │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── client │ │ └── prototype-ui │ │ │ └── plugins │ │ │ └── PlayerState │ │ │ ├── index.ts │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ └── tsconfig.json │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json ├── rock-paper-scissor │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── hathora.yml │ └── server │ │ ├── impl.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json └── uno │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── client │ ├── prototype-ui │ │ └── plugins │ │ │ └── Card │ │ │ ├── index.ts │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ └── tsconfig.json │ └── web │ │ ├── .gitignore │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── postcss.config.js │ │ ├── src │ │ ├── App.tsx │ │ ├── assets │ │ │ └── hathora-hammer-logo-light.png │ │ ├── components │ │ │ ├── ActiveGame.tsx │ │ │ ├── BaseCard.ts │ │ │ ├── CardPile.tsx │ │ │ ├── GameHand.tsx │ │ │ ├── Lobby.tsx │ │ │ ├── MiniCard.tsx │ │ │ ├── OpenentHand.tsx │ │ │ ├── PlayerList.tsx │ │ │ ├── SideDownUno.tsx │ │ │ ├── UnoCard.tsx │ │ │ └── WinModal.tsx │ │ ├── context │ │ │ └── GameContext.tsx │ │ ├── index.css │ │ ├── main.tsx │ │ ├── pages │ │ │ ├── Game.tsx │ │ │ └── Home.tsx │ │ └── vite-env.d.ts │ │ ├── tailwind.config.js │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts │ ├── hathora.yml │ └── server │ ├── impl.ts │ ├── package-lock.json │ ├── package.json │ └── tsconfig.json ├── node-loader.config.mjs ├── package-lock.json ├── package.json ├── scripts ├── run-all-examples.sh └── test-example.sh ├── src ├── cli.ts ├── commands │ ├── build.ts │ ├── cloud.ts │ ├── cloud │ │ ├── deploy.ts │ │ ├── destroy.ts │ │ ├── info.ts │ │ ├── list.ts │ │ ├── login.ts │ │ └── logs.ts │ ├── create-client.ts │ ├── create-plugin.ts │ ├── dev.ts │ ├── generate.ts │ ├── init.ts │ ├── install.ts │ ├── save.ts │ └── start.ts ├── generate.ts ├── helpers.ts └── utils.ts ├── templates ├── base │ ├── Dockerfile.hbs │ ├── api │ │ ├── base.ts.hbs │ │ ├── package.json │ │ ├── tsconfig.json │ │ └── types.ts.hbs │ ├── client │ │ ├── .hathora │ │ │ ├── client.ts.hbs │ │ │ ├── failures.ts │ │ │ ├── package.json │ │ │ ├── patch.ts.hbs │ │ │ └── tsconfig.json │ │ └── prototype-ui │ │ │ ├── App.tsx.hbs │ │ │ ├── Forms.tsx.hbs │ │ │ ├── Login.tsx.hbs │ │ │ ├── State.tsx.hbs │ │ │ ├── context.ts.hbs │ │ │ ├── index.html.hbs │ │ │ ├── package.json.hbs │ │ │ ├── postcss.config.cjs │ │ │ ├── public │ │ │ ├── hathora-hammer-logo-light.png │ │ │ └── logo.png │ │ │ ├── styles.css │ │ │ ├── tailwind.config.cjs │ │ │ ├── tailwind.css │ │ │ ├── tsconfig.json │ │ │ └── vite.config.ts │ └── server │ │ └── .hathora │ │ ├── diff.ts.hbs │ │ ├── methods.ts.hbs │ │ ├── package.json │ │ ├── store.ts.hbs │ │ ├── tsconfig.json │ │ └── wrapper.ts.hbs ├── bootstrap │ ├── .gitignore.hbs │ └── server │ │ ├── impl.ts.hbs │ │ ├── package.json.hbs │ │ └── tsconfig.json ├── client │ └── phaser │ │ └── client │ │ └── {{name}} │ │ ├── index.html │ │ ├── package.json │ │ ├── src │ │ └── app.ts │ │ ├── tsconfig.json │ │ └── vite.config.ts └── plugin │ ├── lit │ └── client │ │ └── prototype-ui │ │ └── plugins │ │ └── {{val}} │ │ ├── index.ts.hbs │ │ ├── package.json │ │ └── tsconfig.json │ ├── native │ └── client │ │ └── prototype-ui │ │ └── plugins │ │ └── {{val}} │ │ ├── index.ts.hbs │ │ ├── package.json │ │ └── tsconfig.json │ └── react │ └── client │ └── prototype-ui │ └── plugins │ └── {{val}} │ ├── index.tsx.hbs │ ├── package.json │ └── tsconfig.json └── tsconfig.json /.eslintignore: -------------------------------------------------------------------------------- 1 | examples/ 2 | templates/ 3 | lib/ 4 | .eslintrc.* 5 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es2021: true, 5 | }, 6 | extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], 7 | parser: "@typescript-eslint/parser", 8 | parserOptions: { 9 | ecmaVersion: "latest", 10 | sourceType: "module", 11 | }, 12 | plugins: ["@typescript-eslint", "eslint-plugin-import", "prettier"], 13 | rules: { 14 | "prettier/prettier": ["error", { printWidth: 120 }], 15 | indent: ["error", 2], 16 | "linebreak-style": ["error", "unix"], 17 | quotes: ["error", "double"], 18 | semi: ["error", "always"], 19 | "import/order": [ 20 | "error", 21 | { 22 | groups: ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"], 23 | "newlines-between": "always", 24 | alphabetize: { 25 | order: "desc", 26 | caseInsensitive: true, 27 | }, 28 | }, 29 | ], 30 | curly: ["error"], 31 | "arrow-parens": ["error"], 32 | "arrow-spacing": ["error"], 33 | }, 34 | }; 35 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/workflows/avalon.yml: -------------------------------------------------------------------------------- 1 | name: Avalon Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/avalon/**" 8 | - .github/workflows/avalon.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/avalon 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-774cadb2-6773-4510-92ce-21aee474e4c2 --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-774cadb2-6773-4510-92ce-21aee474e4c2 ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-avalon.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | -------------------------------------------------------------------------------- /.github/workflows/boggle.yml: -------------------------------------------------------------------------------- 1 | name: Boggle Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/boggle/**" 8 | - .github/workflows/boggle.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/boggle 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-c0a30146-a018-48cb-9f30-dead988e806c --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-c0a30146-a018-48cb-9f30-dead988e806c ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-boggle.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [push] 4 | 5 | jobs: 6 | cli-all-examples: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | matrix: 10 | node-version: [16.x, 17.x, 18.x] 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Use Node.js ${{ matrix.node-version }} 14 | uses: actions/setup-node@v2 15 | with: 16 | node-version: ${{ matrix.node-version }} 17 | - run: npm ci 18 | - run: npm run lint_packagejson 19 | - name: Run linters 20 | uses: wearerequired/lint-action@v2 21 | with: 22 | eslint: true 23 | eslint_extensions: js,jsx,ts,tsx 24 | auto_fix: true 25 | - run: npm install -g ts-node 26 | # - run: npm test 27 | -------------------------------------------------------------------------------- /.github/workflows/chat.yml: -------------------------------------------------------------------------------- 1 | name: Chat Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/chat/**" 8 | - .github/workflows/chat.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/chat 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-b32ab329-614f-42fc-9e99-49ceb3b2d3f4 --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-b32ab329-614f-42fc-9e99-49ceb3b2d3f4 ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-chat.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | -------------------------------------------------------------------------------- /.github/workflows/chess.yml: -------------------------------------------------------------------------------- 1 | name: Chess Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/chess/**" 8 | - .github/workflows/chess.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/chess 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-2860a34a-ea43-452f-9b12-96d5daffc4b7 --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-2860a34a-ea43-452f-9b12-96d5daffc4b7 ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-chess.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | -------------------------------------------------------------------------------- /.github/workflows/codenames.yml: -------------------------------------------------------------------------------- 1 | name: Codenames Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/codenames/**" 8 | - .github/workflows/codenames.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/codenames 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-f932714b-707c-448a-9e36-706f8ae6d7bf --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-f932714b-707c-448a-9e36-706f8ae6d7bf ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-codenames.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | -------------------------------------------------------------------------------- /.github/workflows/poker.yml: -------------------------------------------------------------------------------- 1 | name: Poker Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/poker/**" 8 | - .github/workflows/poker.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/poker 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-c6802174-e24f-4eae-9feb-5d951ce31f78 --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-c6802174-e24f-4eae-9feb-5d951ce31f78 ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-poker.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | frontend-web: 34 | runs-on: ubuntu-latest 35 | steps: 36 | - uses: actions/checkout@v2 37 | - run: npm ci 38 | - run: npm install ts-node surge -g 39 | - run: HATHORA_APP_ID=app-c6802174-e24f-4eae-9feb-5d951ce31f78 ts-node ../../src/cli.ts build --only client 40 | - run: cp client/web/dist/index.html client/web/dist/200.html 41 | - run: surge client/web/dist screeching-chance.surge.sh 42 | env: 43 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 44 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 45 | -------------------------------------------------------------------------------- /.github/workflows/pong.yml: -------------------------------------------------------------------------------- 1 | name: Pong Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/pong/**" 8 | - .github/workflows/pong.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/pong 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-d6e4a3e0-0a18-4631-9a3a-97ee434e977c --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-d6e4a3e0-0a18-4631-9a3a-97ee434e977c ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-pong.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v1 13 | - uses: actions/setup-node@v1 14 | with: 15 | node-version: 16 16 | - run: npm ci 17 | - run: npm run build 18 | - uses: JS-DevTools/npm-publish@v1 19 | with: 20 | token: ${{ secrets.NPM_TOKEN }} 21 | -------------------------------------------------------------------------------- /.github/workflows/rock-paper-scissor.yml: -------------------------------------------------------------------------------- 1 | name: RPS Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/rock-paper-scissor/**" 8 | - .github/workflows/rock-paper-scissor.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/rock-paper-scissor 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-05d9ab33-1c37-4600-b0a1-c117e51719cb --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-05d9ab33-1c37-4600-b0a1-c117e51719cb ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-rock-paper-scissor.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | -------------------------------------------------------------------------------- /.github/workflows/uno.yml: -------------------------------------------------------------------------------- 1 | name: Uno Deploy 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | paths: 7 | - "examples/uno/**" 8 | - .github/workflows/uno.yml 9 | 10 | defaults: 11 | run: 12 | working-directory: examples/uno 13 | 14 | jobs: 15 | server: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - run: npm install -g @hathora/cli 20 | - run: hathora-cloud deploy --appId app-8be12744-50cf-44b5-94c1-82ba4c2b249a --token ${{ secrets.HATHORA_CLOUD_TOKEN }} 21 | frontend: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - run: npm ci 26 | - run: npm install ts-node surge -g 27 | - run: HATHORA_APP_ID=app-8be12744-50cf-44b5-94c1-82ba4c2b249a ts-node ../../src/cli.ts build --only client 28 | - run: cp client/prototype-ui/dist/index.html client/prototype-ui/dist/200.html 29 | - run: surge client/prototype-ui/dist hathora-uno.surge.sh 30 | env: 31 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 32 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 33 | custom-frontend: 34 | runs-on: ubuntu-latest 35 | steps: 36 | - uses: actions/checkout@v2 37 | - run: npm ci 38 | - run: npm install ts-node surge -g 39 | - run: HATHORA_APP_ID=app-8be12744-50cf-44b5-94c1-82ba4c2b249a ts-node ../../src/cli.ts build --only client 40 | - run: cp client/web/dist/index.html client/web/dist/200.html 41 | - run: surge client/web/dist material-suit.surge.sh 42 | env: 43 | SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} 44 | SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /lib/ 2 | node_modules/ 3 | .DS_Store 4 | .idea 5 | .vscode/ 6 | dist/ 7 | -------------------------------------------------------------------------------- /.npmpackagejsonlintignore: -------------------------------------------------------------------------------- 1 | examples/ 2 | templates/ 3 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v16.14 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-present Harsh Pandey and other contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | drawing 2 | 3 | > Democratizing multiplayer game development 4 | 5 | Today, Hathora consists of three major components: 6 | 7 | - [Hathora Builder](/builder/README.md): opinionated NodeJS framework for multiplayer games 8 | - [Hathora BuildKit](/buildkit/README.md): lightweight networking libraries that make it easy to write real-time client-server applications in JavaScript 9 | - [Hathora Cloud](https://hathora.dev/docs): managed hosting platform for multiplayer game servers 10 | 11 | This is how the three parts fit in: 12 | 13 | ![Hathora product stack](/statics/stack.png) 14 | 15 | # Community 16 | 17 | To stay up-to-date on latest developments and interact with others building with Hathora, join our [Discord](https://discord.com/invite/6nVdeCBffR) or drop us a line (hello@hathora.dev)! 18 | -------------------------------------------------------------------------------- /docs/_sidebar.md: -------------------------------------------------------------------------------- 1 | - [Overview](README.md) 2 | 3 | - Hathora BuildKit 4 | 5 | - [Getting Started](buildkit/README.md) 6 | - [Tutorial: Top Down Shooter](https://bullet-mania.vercel.app/) 7 | - [Tutorial: 3D Platformer](buildkit/tutorial_3d_platformer.md) 8 | 9 | - Hathora Cloud 10 | - [Get started](https://hathora.dev/docs) 11 | 12 | - Hathora Builder 13 | 14 | - [Overview](builder/README.md) 15 | - [CLI](builder/cli.md) 16 | 17 | - Getting Started 18 | 19 | - [Tutorial: Uno](builder/tutorial_uno.md) 20 | - [Tutorial: Among Us](builder/tutorial_among_us.md) 21 | - [Tutorial: Platformer](builder/tutorial_platformer.md) 22 | - [Showcase](builder/showcase.md) 23 | 24 | - Reference 25 | 26 | - [hathora.yml](builder/hathora-yml.md) 27 | - [Server](builder/server.md) 28 | - [Client](builder/client.md) 29 | - [Deploy](builder/deploy.md) 30 | 31 | - Concepts 32 | 33 | - [Data flow](builder/data-flow.md) 34 | - [Type driven development](builder/type-driven-development.md) 35 | - [State](builder/state.md) 36 | - [Methods](builder/methods.md) 37 | - [Authentication](builder/auth.md) 38 | - [Networking](builder/networking.md) 39 | 40 | 41 | - [Glossary of Terms](glossary.md) 42 | -------------------------------------------------------------------------------- /docs/builder/cli.md: -------------------------------------------------------------------------------- 1 | # Hathora Builder - Command-line interface 2 | 3 | To access all the cloud functions you can run `hathora --help` 4 | 5 | ```sh 6 | % hathora --help 7 | hathora 8 | 9 | Commands: 10 | hathora build Builds the project [aliases: b] 11 | hathora cloud Interact with Hathora Cloud 12 | [aliases: c] 13 | hathora create-client