{"id":23975958,"url":"https://github.com/zenoo/company-manager","last_synced_at":"2026-05-16T00:02:26.502Z","repository":{"id":285597064,"uuid":"912498176","full_name":"Zenoo/company-manager","owner":"Zenoo","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-13T18:16:51.000Z","size":829,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T12:30:46.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://company-manager-zen.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zenoo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-05T18:29:53.000Z","updated_at":"2025-12-13T18:16:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"27bda2a0-0f66-4aab-8873-564193be18bc","html_url":"https://github.com/Zenoo/company-manager","commit_stats":null,"previous_names":["zenoo/company-manager"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Zenoo/company-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenoo%2Fcompany-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenoo%2Fcompany-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenoo%2Fcompany-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenoo%2Fcompany-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zenoo","download_url":"https://codeload.github.com/Zenoo/company-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenoo%2Fcompany-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33085080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-07T06:54:59.836Z","updated_at":"2026-05-16T00:02:26.466Z","avatar_url":"https://github.com/Zenoo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Company Manager\n\nThis is a Phaser 3 project that uses the Next.js framework. It includes a bridge for React to Phaser game communication, hot-reloading for quick development workflow and scripts to generate production-ready builds.\n\n### Versions\n\nThis template has been updated for:\n\n- [Phaser 3.87.0](https://github.com/phaserjs/phaser)\n- [Next.js 14.2.3](https://github.com/vercel/next.js)\n- [TypeScript 5](https://github.com/microsoft/TypeScript)\n\n![screenshot](screenshot.png)\n\n## Requirements\n\n[Node.js](https://nodejs.org) is required to install dependencies and run scripts via `npm`.\n\n## Available Commands\n\n| Command | Description |\n|---------|-------------|\n| `npm install` | Install project dependencies |\n| `npm run dev` | Launch a development web server |\n| `npm run build` | Create a production build in the `dist` folder |\n\n## Writing Code\n\nAfter cloning the repo, run `npm install` from the project directory. Then, you can start the local development server by running `npm run dev`.\n\nThe local development server runs on `http://localhost:8080` by default. Please see the Next.js documentation if you wish to change this, or add SSL support.\n\nOnce the server is running you can edit any of the files in the `src` folder. Next.js will automatically recompile your code and then reload the browser.\n\n## Project Structure\n\n- `src/pages/_document.tsx` - A basic Next.js component entry point. It is used to define the `\u003chtml\u003e` and `\u003cbody\u003e` tags and other globally shared UI.\n- `src` - Contains the Next.js client source code.\n- `src/styles/globals.css` - Some simple global CSS rules to help with page layout. You can enable Tailwind CSS here.\n- `src/page/_app.tsx` - The main Next.js component.\n- `src/App.tsx` - Midleware component used to run Phaser in client mode.\n- `src/game/PhaserGame.tsx` - The React component that initializes the Phaser Game and serve like a bridge between React and Phaser.\n- `src/game/EventBus.ts` - A simple event bus to communicate between React and Phaser.\n- `src/game` - Contains the game source code.\n- `src/game/main.tsx` - The main **game** entry point. This contains the game configuration and start the game.\n- `src/game/scenes/` - The Phaser Scenes are in this folder.\n- `public/favicon.png` - The default favicon for the project.\n- `public/assets` - Contains the static assets used by the game.\n## React Bridge\n\nThe `PhaserGame.tsx` component is the bridge between React and Phaser. It initializes the Phaser game and passes events between the two.\n\nTo communicate between React and Phaser, you can use the **EventBus.js** file. This is a simple event bus that allows you to emit and listen for events from both React and Phaser.\n\n```js\n// In React\nimport { EventBus } from './EventBus';\n\n// Emit an event\nEventBus.emit('event-name', data);\n\n// In Phaser\n// Listen for an event\nEventBus.on('event-name', (data) =\u003e {\n    // Do something with the data\n});\n```\n\nIn addition to this, the `PhaserGame` component exposes the Phaser game instance along with the most recently active Phaser Scene using React forwardRef.\n\nOnce exposed, you can access them like any regular react reference.\n\n## Phaser Scene Handling\n\nIn Phaser, the Scene is the lifeblood of your game. It is where you sprites, game logic and all of the Phaser systems live. You can also have multiple scenes running at the same time. This template provides a way to obtain the current active scene from React.\n\nYou can get the current Phaser Scene from the component event `\"current-active-scene\"`. In order to do this, you need to emit the event `\"current-scene-ready\"` from the Phaser Scene class. This event should be emitted when the scene is ready to be used. You can see this done in all of the Scenes in our template.\n\n**Important**: When you add a new Scene to your game, make sure you expose to React by emitting the `\"current-scene-ready\"` event via the `EventBus`, like this:\n\n\n```ts\nclass MyScene extends Phaser.Scene\n{\n    constructor ()\n    {\n        super('MyScene');\n    }\n\n    create ()\n    {\n        // Your Game Objects and logic here\n\n        // At the end of create method:\n        EventBus.emit('current-scene-ready', this);\n    }\n}\n```\n\nYou don't have to emit this event if you don't need to access the specific scene from React. Also, you don't have to emit it at the end of `create`, you can emit it at any point. For example, should your Scene be waiting for a network request or API call to complete, it could emit the event once that data is ready.\n\n### React Component Example\n\nHere's an example of how to access Phaser data for use in a React Component:\n\n```ts\nimport { useRef } from 'react';\nimport { IRefPhaserGame } from \"./game/PhaserGame\";\n\n// In a parent component\nconst ReactComponent = () =\u003e {\n\n    const phaserRef = useRef\u003cIRefPhaserGame\u003e(); // you can access to this ref from phaserRef.current\n\n    const onCurrentActiveScene = (scene: Phaser.Scene) =\u003e {\n    \n        // This is invoked\n\n    }\n\n    return (\n        ...\n        \u003cPhaserGame ref={phaserRef} currentActiveScene={onCurrentActiveScene} /\u003e\n        ...\n    );\n\n}\n```\n\nIn the code above, you can get a reference to the current Phaser Game instance and the current Scene by creating a reference with `useRef()` and assign to PhaserGame component.\n\nFrom this state reference, the game instance is available via `phaserRef.current.game` and the most recently active Scene via `phaserRef.current.scene`.\n\nThe `onCurrentActiveScene` callback will also be invoked whenever the the Phaser Scene changes, as long as you emit the event via the EventBus, as outlined above.\n\n## Handling Assets\n\nTo load your static games files such as audio files, images, videos, etc place them into the `public/assets` folder. Then you can use this path in the Loader calls within Phaser:\n\n```js\npreload ()\n{\n    //  This is an example of loading a static image\n    //  from the public/assets folder:\n    this.load.image('background', 'assets/bg.png');\n}\n```\n\nWhen you issue the `npm run build` command, all static assets are automatically copied to the `dist/assets` folder.\n\n## Deploying to Production\n\nAfter you run the `npm run build` command, your code will be built into a single bundle and saved to the `dist` folder, along with any other assets your project imported, or stored in the public assets folder.\n\nIn order to deploy your game, you will need to upload *all* of the contents of the `dist` folder to a public facing web server.\n\n## Customizing the project\n\n### Next.js\n\nIf you want to customize your build, such as adding plugin (i.e. for loading CSS or fonts), you can modify the `next.config.mjs` file for cross-project changes, or you can modify and/or create new configuration files and target them in specific npm tasks inside of `package.json`. Please see the [Next.js documentation](https://nextjs.org/docs) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenoo%2Fcompany-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenoo%2Fcompany-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenoo%2Fcompany-manager/lists"}