summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-04-22 10:54:15 +0200
committerSanto Cariotti <santo@dcariotti.me>2025-04-22 10:54:15 +0200
commit0f9edf2a87b068183016e8553dee5bb8b8dc4803 (patch)
tree31326b3a01f1daa02fad5bb09de066e976d8ad21
parent71520594ca2ae593b64039a765a9d908565968c8 (diff)
Add README and LICENSE
-rw-r--r--LICENSE.md28
-rw-r--r--README.md69
-rw-r--r--assets/demo.mp4bin0 -> 526181 bytes
-rw-r--r--assets/demo.pngbin115008 -> 0 bytes
4 files changed, 96 insertions, 1 deletions
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..e1e0522
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,28 @@
+BSD 3-Clause License
+
+Copyright (c) 2025, Santo Cariotti
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
index 3e574f4..e85d63e 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,70 @@
# Rahanna
-![demo](./assets/demo.png)
+A peer-to-peer (P2P) chess game with a Terminal User Interface (TUI).
+
+[video.mp4](https://raw.githubusercontent.com/boozec/rahanna/main/assets/demo.mp4)
+
+> _Disclaimer:_
+> This project is a university exercise for a Distributed Systems class. While it seems to function correctly, Rahanna is not intended for production use. The UI opens network ports that should not be exposed in secure environments.
+
+---
+
+Rahanna enables two players to play chess directly via a TCP connection — no centralized server manages the game state. Moves are sent in real time over the network, and only the final outcome is stored.
+
+- P2P gameplay over TCP.
+- TUI-based interface.
+- Lightweight REST API for user authentication and matchmaking.
+- No need to know your opponent's IP address - just the unique game name.
+
+Even though Rahanna is a P2P application, it relies on a central Rahanna API for:
+
+- User authentication and registration.
+- Match discovery.
+
+No gameplay data is stored centrally — only metadata (e.g., game outcomes).
+
+## Build
+
+Make sure you have Go 1.24+ and Git installed.
+
+```
+$ git clone github.com/boozec/rahanna.git
+$ # make all or
+$ go build -o rahanna-ui cmd/ui/main.go
+```
+
+If you want to also makes up an API server, run
+
+```
+$ go build -o rahanna-api cmd/api/main.go
+```
+
+## Run
+
+Now, you can just run the one (or two) executables you just builded after an environment setup:
+
+```
+export API_BASE="http://localhost:8080"
+```
+
+Or, if you also want to make up the API:
+
+```
+export POSTGRES_USER=postgres
+export POSTGRES_DB=rahanna
+export POSTGRES_PASSWORD=password
+export DATABASE_URL="host=localhost user=postgres password=password dbname=rahanna port=5432"
+export JWT_TOKEN="..."
+export RAHANNA_API_ADDRESS=":8080"
+export DEBUG=1
+```
+
+If you are more lazy, you just can make everything up thanks to Docker.
+
+```
+# Start the API and database
+docker compose -f docker/api/docker-compose.yml up
+
+# In another terminal, run the UI
+docker run -e API_BASE=http://0.0.0.0:8080 -it --network host rahanna-ui:latest
+```
diff --git a/assets/demo.mp4 b/assets/demo.mp4
new file mode 100644
index 0000000..995ab3e
--- /dev/null
+++ b/assets/demo.mp4
Binary files differ
diff --git a/assets/demo.png b/assets/demo.png
deleted file mode 100644
index ad55d0d..0000000
--- a/assets/demo.png
+++ /dev/null
Binary files differ