diff --git a/README.md b/README.md index e13fa0c..706acae 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Edit `settings.py` and customize application. make run ``` -By default, JFK runs on port **8010**. To run on other port, start `uvicorn` directly: +By default, FairHopper runs on port **8010**. To run FairHopper on different port, start `uvicorn` directly: ```sh poetry run uvicorn main:app --host 0.0.0.0 --port 8010 --workers=1 ``` @@ -63,6 +63,14 @@ To activate virtual environment: poetry shell ``` +### Starting WebSockets Server + +```sh +make run-ws +``` + +WebSockets server runs on port **8011**. To run WS Server on different port, edit `settings.py` configuration. + ## System overview @@ -74,31 +82,31 @@ actor "Player 2" as P2 actor "Player 3" as P3 package Masterpiece { - usecase JFK as "JFK Game Server" + usecase Game as "FairHopper Game Server" usecase WS as "WS Server" usecase Vis as "Visualisation\nService" } -P1 -left-> JFK: REST API -P2 -left-> JFK: REST API -P3 -left-> JFK: REST API -JFK --> WS: WebSockets +P1 -left-> Game: REST API +P2 -left-> Game: REST API +P3 -left-> Game: REST API +Game --> WS: WebSockets WS --> Vis: WebSockets ``` ### WebSockets ```plantuml - participant JFK as "JFK Game Server" + participant Game as "FairHopper Game Server" participant WS as "WS Server" participant Client1 as "Visualisation\nClient 1" participant Client2 as "Visualisation\nClient 2" - JFK ->o WS: Server Connect + Game ->o WS: Server Connect activate WS #coral - WS -> JFK: Get game state - activate JFK #yellow - JFK -> WS: Game state + WS -> Game: Get game state + activate Game #yellow + Game -> WS: Game state deactivate deactivate @@ -113,7 +121,7 @@ WS --> Vis: WebSockets deactivate loop #lightyellow On game state change - JFK ->o WS: Game state + Game ->o WS: Game state activate WS #coral WS o-> Client1: Game state WS o-> Client2: Game state diff --git a/main.py b/main.py index e97d62e..6306c98 100644 --- a/main.py +++ b/main.py @@ -10,7 +10,7 @@ logging.basicConfig( level=settings.log_level, format="%(asctime)s %(levelname)s - %(message)s", ) -logging.info("JFK Game server started.") +logging.info("FairHopper Game Server started.") app = FastAPI() app.include_router(router, tags=["Game API"])