https://github.com/udamir/magx-examples
Basic examples of how to use magx, mosx and magx-client
https://github.com/udamir/magx-examples
examples magx mosx
Last synced: 11 months ago
JSON representation
Basic examples of how to use magx, mosx and magx-client
- Host: GitHub
- URL: https://github.com/udamir/magx-examples
- Owner: udamir
- Created: 2020-08-29T08:29:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-03T13:39:22.000Z (about 4 years ago)
- Last Synced: 2025-01-14T06:47:51.626Z (12 months ago)
- Topics: examples, magx, mosx
- Language: HTML
- Homepage: magx-examples.vercel.app
- Size: 194 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Magx examples project
On this repository you can find basic and advanced examples of how to use [magx](https://github.com/udamir/magx/), [mosx](https://github.com/udamir/mosx/) and [magx-client](https://github.com/udamir/magx-client/).
## How to run
```
git clone https://github.com/udamir/magx-examples.git
cd magx-examples
npm install
npm start
```
Open http://localhost:3001 in your browser.
## Examples overview
While running the server following examples are avaliable:
### Basic examples
[Chat](http://localhost:3001/basic/chat.html) - Example of simple without state
[Mosx-state](http://localhost:3001/basic/mosx-state.html) - Example shows how to use [Mosx](https://github.com/udamir/mosx/) as your room's state
[Reconnection](http://localhost:3001/basic/reconnection.html) - This example shows how to enable client's reconnection
[Lobby room](http://localhost:3001/basic/lobby.html) - This example shows how to use LobbyRoom
[Relay room](http://localhost:3001/basic/relay.html) - This example shows how to create relay server
### Advanced examples
[Snake game](http://localhost:3001/advanced/snake.html) - Example of simple game (snake)
[Magx chat](http://localhost:3001/advanced/mosx-chat/index.html) - One room chat with private messages. This example shows how to create and manage private objects in Mosx state
[Open world](http://localhost:3001/advanced/mosx-open-world.html) - This example shows how Magx and Mosx can be used for open world games.
### Tools
[Monitoring](http://localhost:3001/magx/monitor) - Monitoring console to view rooms and state of your server
### Scalability
Examples project can be run in cluster mode:
```
npm run cluster
```
or via pm2 (redis and mongodb required):
```
npm run pm2
```
## License
MIT