-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from GabrielCTroia/enhance-docs
Enhance docs
- Loading branch information
Showing
26 changed files
with
240 additions
and
215 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
apps/movex-docs/pages/roadmap.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,5 @@ | ||
# About Movex | ||
|
||
Movex is an open-source framework designed to simplify multiplayer communication and state synchronization for web games and multi-peer applications. Born from the need to streamline backend logic across projects like Chessroulette, Movex allows developers to seamlessly run game logic on both the client and server without getting bogged down in complex networking protocols. With built-in real-time synchronization and an authoritative server model, Movex is built to handle multiplayer functionality so developers can focus on what they do best—creating engaging experiences. | ||
|
||
## Origins | ||
Movex is the legacy of [chessroulette.live](https://gabrielctroia.medium.com/meet-chessroulette-org-a-quarantine-project-e4108f05db39) (now defunct but up for a comeback built on movex soon). | ||
|
||
import Image from 'next/image'; | ||
|
||
<Image src="/static/chessroulette_screenshot.png" alt="Chessroulette Screenshot" width="720" height="560" className="pt-4"/> | ||
|
||
|
||
## Idea iteration | ||
|
||
The idea for Movex came while attempting to port the backend code from Chessroulette (everything from the network logic & protocols, servers, redis to matchmaking), into another turn based chess-like game server to make it multiplayer (that we are launching soon), and realizing that I actually have to copy and paste most of that code with very slight changes. | ||
|
||
The initial idea was simply to take that code, wrap it in a backend service of its own, complete with an api, socket + a (redis) store, and use it for my game as well as opening it up for other game developers that don't handle all that multyplayer logc on their own. | ||
|
||
But then, while working on that version, I realized I can in fact go a few steps further, and offer a solution for the client, where the actual game or app logic happens. So the idea of combining functional code (i.e. functions), to have them run both on the client and the server (seamlessly), could be an appealing solution for other game developers who don't won't to get out of their Game bubble, where to be honest, the fun happens. | ||
|
||
Combine that with an Authoritative Server that seamlessly just works, Realtime Synchronization and Deterministic Propagation and I think we have something here. | ||
|
||
But of course, only time will tell! | ||
Movex is a **[Moves That Matter](https://github.com/movesthatmatter)** project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Changelog | ||
# Movex Changelog | ||
|
||
## v0.1.6 (Sep 26 2024) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"frontend_only": "Frontend Only", | ||
"serverless": "Serverless", | ||
"server_authoritative": "Authoritative Server", | ||
"realtime": "Realtime State Sync", | ||
"secret_state": "Secret State", | ||
"private_state": "Private State", | ||
"functional": "Typesafe Functional Programming" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Private State | ||
|
||
Sometimes, some parts of the state need not be known by every peer subscribed to it right away. This is called `Private State` or `Private State Fragments`. | ||
|
||
Think about a game of Poker for example, where each player gets a hand of cards that are meant to be kept _secret_ until the end of the round when every remaining player will reveal their cards. In a naive implementation of a Shared State setup, all of the hands would be kept somewhere in the global state and thus easily accessible by anyone who knows where to look (e.g. at the network traffic) – and thus a bad actor would be able to read their values even if the UI might not actually display them. | ||
|
||
Movex makes it very easy to keep these 100% private, by allowing the developer to decide which part of the state remains public and which private for each client (_peer_). See more more on how that works [here](/docs/how/private_state). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Real-Time State Sync | ||
# Realtime State Sync | ||
|
||
Movex uses the Obervable Pattern under the hood to listen to changes coming from the Master State (i.e. Server) accross all the peers (clients) subscribed to any Movex Resources. This means that as soon as a Resource State gets updated, all the subscribed peers will get notified, and the next client state will automatically get re-processed. | ||
Movex employs the Observable Pattern under the hood to monitor changes in the Master State (i.e., the Server) across all clients subscribed (i.e. peers) to Movex Resources. This means that as soon as a Resource State is updated, all peers receive immediate notifications, triggering an automatic reprocessing of their local state. | ||
|
||
Dive deeper into how it works [here](/docs/how/state_sync). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Authoritative Server | ||
|
||
It's important to keep the app logic outside the reach of potential bad actors, which is why it gets processed on an actual server run by movex. But there is no need for you to code, maintain or worry about that. | ||
**Keeping your app logic secure is crucial**, which is why Movex processes it on a secure server, safe from potential bad actors. The best part? You don’t need to write, maintain, or even worry about this back-end code—Movex handles it all for you. | ||
|
||
Movex makes use of a few concepts and strategies under the hood such as ["Deterministic Action Propagation"](/docs/features/functional#determinstic-action-propagation) as well as running the [`movex.config`](/docs/how/movex_config) logic on both the front-end and the back-end, to make this possible. | ||
Under the hood, Movex uses concepts like [Deterministic Action Propagation](/docs/features/functional#determinstic-action-propagation) and runs the [movex.config](/docs/how/movex_config) logic on both the front end and back end to ensure seamless, secure functionality. | ||
|
||
Learn more about how Movex works [here](/docs/how). | ||
Want to dive deeper into how Movex works? [Learn more here](/docs/how). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Serverless | ||
|
||
**No back-end code needed. 🥳** | ||
|
||
One of the most time-consuming aspects of building multiplayer games or apps with shared states is dealing with the back end. Networking logic, databases, state synchronization, deploying, and maintaining servers—it’s a lot to manage. After going through this process multiple times, I found it became pretty redundant since there’s significant overlap in each project. Worse yet, it took time away from the fun part—actually building the game. | ||
|
||
Enter Movex. It removes all that back-end hassle, freeing you, the developer, to focus on what you love most—building your game or app! 😍 | ||
|
||
And hey, if you do enjoy working on networking and server logic, I could use your help with Movex! Feel free to open an issue or submit a PR on GitHub: [Movex Repository](https://github.com/movesthatmatter/movex). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
# How does Movex work | ||
|
||
Movex follows the [Flux Pattern](https://redux.js.org/understanding/history-and-design/prior-art#flux) locally to respond to changes in the UI, and then uses the "Deterministic Propagation Method" to sync up the state changes with the Global State as well as with all the peers in the network. | ||
<br/> | ||
<br/> | ||
Movex follows the [Flux Pattern](https://redux.js.org/understanding/history-and-design/prior-art#flux) locally to respond to UI changes. It then employs the [Deterministic Propagation Method](/docs/features/functional#determinstic-action-propagation) to synchronize state changes with the Global State(aka Master State) and all peers in the network. | ||
|
||
**Movex Diagram** | ||
<div className="bg-slate-100 p-8 text-center"> | ||
<img alt="Movex Diagram" src="/static/diagram/diagram_d@1x_optimized.png" width="600px" className="mx-auto"/> | ||
<img alt="Movex Diagram" src="/static/diagram/diagram_d@1x_optimized.png" width="500px" className="mx-auto"/> | ||
</div> | ||
<br/> | ||
<br/> | ||
|
||
{/* Movex relies heavily on the concept of "Purity" and the "Deterministic Propagation Method", described in more detail [here](/docs/features/functional) to work under the hood. */} | ||
|
||
|
||
Each of following concepts plays a vital role in understanding and building with Movex: | ||
**Understanding and building with Movex involves several key concepts, each playing a vital role:** | ||
|
||
1. [Resources](/docs/how/resources) | ||
2. [Reducers](/docs/how/reducers) | ||
3. [Actions](/docs/how/actions) | ||
4. [State](/docs/how/state) | ||
5. [Secret State](/docs/how/secret_state) | ||
5. [Private State](/docs/how/private_state) | ||
6. [State Synchronization](/docs/how/state_synchronization). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ovex-docs/pages/docs/how/secret_state.mdx → ...vex-docs/pages/docs/how/private_state.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.