https://github.com/codemation/restaurant
https://github.com/codemation/restaurant
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codemation/restaurant
- Owner: codemation
- Created: 2020-10-15T21:01:40.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-26T21:59:39.000Z (over 5 years ago)
- Last Synced: 2025-01-14T11:16:48.847Z (about 1 year ago)
- Language: Python
- Size: 164 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# restaurant
Restaurant Simulator
## Instructions - Getting Started
Deploy a Restaurant Simulator instance
Required Env Vars:
- WS_PATH: Example '/ws/game1'
this is the path that uvicorn will allow websocket negotion with client, and where client requests to restaurant server will take place.
- MODE: Example 'mode1', 'game1'
Essentially a lable, as not tied to path, but prevents default testing WS_PATH from being used
Example Start an Instance
$ docker run -d --name rest_sim -p 8390:8190 -e WS_PATH='/game1' -e MODE='game1' joshjamison/restaurant_simulator:latest
### Deploy the instance
Example:
$ git clone https://github.com/codemation/restaurant.git
$ cd restaurant;
(python37env)$ python test_restaurant.py 192.168.122.100 8390 /game1
..
....
test_run results: Score: 20 / 31
## Stack
- uvicorn - ASGI Server
- FastAPI - Python Framework for quickly creating websocket / api endpoints
- aiopyql - database ORM providing cache layer for database access and reducing / eliminating access to data when possibe.
- sqlite - no network persistent database, to satisfy the basic schema requiremnts, and storming required persistent data.
## Scaling
The application can be scaled by simply creating new instances in front of a load-balancer(nginx). Databases will be stored in the ephemeral container storage as game data does not need to persist beyond runtime.