diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a88874d..5e652d1 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -1,4 +1,4 @@ -name: Python package +name: WHOT Tests on: push: diff --git a/examples/whot-web/.env-example b/examples/whot-web/.env-example new file mode 100644 index 0000000..5d37aa5 --- /dev/null +++ b/examples/whot-web/.env-example @@ -0,0 +1,3 @@ +ADDRESS=127.0.0.1 +PORT=8080 +WEBSOCKET_PORT=8765 diff --git a/examples/whot-web/README.md b/examples/whot-web/README.md new file mode 100644 index 0000000..d2a28e5 --- /dev/null +++ b/examples/whot-web/README.md @@ -0,0 +1,78 @@ +# Web Whot + +A web-based implementation of **Whot**. With Web Whot, you can play the game over any network. Just create a game and share the link with another player. + +> Currently supports **two players per game**. + +## Technologies Used + +This project is built using simple, lightweight technologies: + +**Client:** + +* HTML +* Vanilla JavaScript +* CSS + +**Communication:** + +* HTTP +* WebSocket (for real-time updates) + +**Server:** + +* [aiohttp](https://github.com/aio-libs/aiohttp) – HTTP framework for Python +* [whot](https://github.com/EteimZ/whot) – Whot engine that powers the logic + +## Getting Started + +### 1. Clone the Game Engine + +Start by cloning the [`whot`](https://github.com/EteimZ/whot) repository: + +```bash +git clone https://github.com/EteimZ/whot.git +cd whot/examples/whot-web +``` + +### 2. Set Up Your Environment + +Make sure you have **Python 3.11+** installed. + +(Optional) Create and activate a virtual environment: + +```bash +python -m venv env +source env/bin/activate +``` + +### 3. Install Dependencies + +```bash +pip install -r requirements.txt +``` + +### 4. Configure Environment Variables + +Create a `.env` file in the root of the project and define the following variables: + +```dotenv +ADDRESS=127.0.0.1 +PORT=8080 +WEBSOCKET_PORT=8765 +``` + +`ADDRESS` should be your local or network IP address. +`PORT` is for the HTTP server. +`WEBSOCKET_PORT` is for WebSocket communication. + +## Running the App + +Start the application with: + +```bash +python main.py +``` + +Visit `http://
:
+
+ Play Whot with your friends by starting or joining a game using a link
+Current Player:
-Player ID:
- -
-
-