Skip to content

About

An online multiplayer version of the classic card game Durak, built with Django and Django Channels.

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Repository files navigation

🃏 Fool's Arena Game

An online multiplayer version of the classic Russian card game Durak, built with Django and Django Channels.


Setup

1. Clone the repository

git clone https://github.com/uxabix/Django-Fools_Arena
cd Django-Fools_Arena

2. Configure environment variables

Copy .env.example to .env:

cp .env.example .env

3. Start the project

Run containers:

docker compose up --build

Available services:

4. Apply migrations and create a superuser

Run migrations:

docker compose exec web python manage.py migrate

Create a superuser (optional):

docker compose exec web python manage.py createsuperuser

5. Generate static files

docker compose exec web python manage.py collectstatic

6. Work with Django

Run migrations, tests, and management commands inside the web container (after docker compose up):

docker compose exec web python manage.py migrate
docker compose exec web python manage.py makemigrations
docker compose exec web pytest -v

If containers are not running yet, you can use a one-off container (starts dependencies per Compose file):

docker compose run --rm web python manage.py migrate
docker compose run --rm web pytest -v

Chat: API and templates

REST (session or token auth as configured for DRF):

  • GET /api/chat/chats/ — list chats for the current user
  • POST /api/chat/chats/direct/ — JSON body { "other_user_id": "<uuid>" } to open or reuse a 1:1 chat
  • GET|POST /api/chat/chats/<chat_uuid>/messages/ — list recent messages or { "content": "..." } to post

Same behaviour in server-rendered UI (login required):

  • /chat/ — inbox
  • /chat/direct/new/ — start a direct chat by username
  • /chat/<chat_uuid>/ — history, HTTP post form, optional WebSocket client block on the page

Blocking uses accounts.Block: the blocked user cannot send direct messages to the blocker; lobby chats are unchanged.

7. Stop containers

docker compose down

Documentation

Developer documentation is built with Sphinx from the docs/ directory (autodoc, Google-style docstrings via Napoleon, viewcode).

Install dependencies (includes Sphinx):

pip install -r requirements.txt

Generate HTML (either command from the repository root):

cd docs && make html
sphinx-build -b html docs docs/_build

Open docs/_build/html/index.html in a browser.

Rebuild after code or docstring changes (clean output, then build again):

cd docs && make clean html

Or remove the build directory and run sphinx-build again:

rm -rf docs/_build && sphinx-build -b html docs docs/_build

Using Docker (from the project root, with the stack running and the app image built):

docker compose exec web sphinx-build -b html docs docs/_build

The docs/_build/ directory is gitignored.


🚀 Stack

  • Django, REST, Channels
  • Redis
  • PostgreSQL
  • Docker
  • GitFlow
  • Sphinx

📌 Status

Early development stage.
See ROADMAP.md for the roadmap.


⚖️ License

No license yet. All rights reserved by the authors.

About

An online multiplayer version of the classic card game Durak, built with Django and Django Channels.

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages