Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
88e80c3
ref(`ports`): split `user_views` (#22)
emptybutton Jul 22, 2025
d6afd36
ref(`ports`): remove "render" (#22)
emptybutton Jul 22, 2025
8f3e2af
Merge pull request #25 from emptybutton/split-view-ports
emptybutton Jul 22, 2025
0c54d93
ref(`application`): make one usecase for `game` (#23)
emptybutton Jul 23, 2025
9f64fdb
ref: fix inconsistent naming (#24)
emptybutton Jul 23, 2025
17a8242
ref(`application`): use `game_starting_queue` instead of `matchmaking…
emptybutton Jul 23, 2025
09a17f6
fix(`infrastructure`): use `select for update` (#26)
emptybutton Jul 23, 2025
6891b3c
fix(`main`): close bot (#21)
emptybutton Jul 23, 2025
bbc12d7
ref(`tables`): use domain model (#20)
emptybutton Jul 24, 2025
4141acb
fix(`stars_purchase`): remove `complete_stars_purchase_payment` versi…
emptybutton Jul 24, 2025
0960c17
Merge pull request #35 from emptybutton/use-model-in-tables
emptybutton Jul 24, 2025
5039644
Merge pull request #33 from emptybutton/close-client-sessions
emptybutton Jul 24, 2025
d6af20e
Merge pull request #32 from emptybutton/use-select-for-update
emptybutton Jul 24, 2025
dcf9139
Merge pull request #29 from emptybutton/fix-inconsistent-naming
emptybutton Jul 24, 2025
4cbac0f
ref(application): make one usecase for game (#23)
emptybutton Jul 24, 2025
b7ab6c9
Merge pull request #27 from emptybutton/make-one-usecase-for-game
emptybutton Jul 24, 2025
9a01931
ref(`user`): split `common` `ports` (#34)
emptybutton Jul 24, 2025
244d451
fix(`InPostgresGames`): load game in two stmts
emptybutton Jul 24, 2025
151317e
ref: don't use `chat_id` (#36)
emptybutton Jul 25, 2025
ac9c09f
ref(`tables`): don't store `chat_id` (#36)
emptybutton Jul 25, 2025
32db7e3
fix(`test_core`): create `UserGameLocation` without `chat_id`
emptybutton Jul 25, 2025
c1e4ecf
fix(`InconsistentMatrixError`): make not frozen
emptybutton Jul 25, 2025
87ec35d
feat: store last games (#5)
emptybutton Jul 25, 2025
a0b0e20
feat(`entities` & `infrastructure`): add `elo_rating` (#5)
emptybutton Jul 26, 2025
39a1c72
feat: do `IO` for elo rating (#5)
emptybutton Jul 26, 2025
76ce8ff
style(`game`): ignore `ruff` errors (#5)
emptybutton Jul 27, 2025
cb342b9
ref(`DecidedGameResult`): use `loss` word instead of `lose` (#5)
emptybutton Jul 27, 2025
b243198
fix(`tables`): fix mapping (#5)
emptybutton Jul 27, 2025
4f46c4f
feat(`aiogram`): present rating (#5)
emptybutton Jul 27, 2025
671e61d
fix(`test_core`): use rating and new game results (#5)
emptybutton Jul 27, 2025
05d58b4
feat(`completed_game_messages`): present rating vector (#5)
emptybutton Jul 27, 2025
124bca2
ref(`sqlalchemy`): split `tables` into package
emptybutton Jul 28, 2025
66d46ea
feat: add main menu with not working shop and emojis (#28)
emptybutton Jul 28, 2025
1a9117b
feat: add emoji menu base (#28)
emptybutton Jul 29, 2025
d87dbc9
ref(`application`): split fsm `ports` (#28)
emptybutton Aug 7, 2025
d6477dd
feat(`aiogram`): add base parts of `aiogram-dialog` (#28)
emptybutton Aug 8, 2025
b316524
fix(`aiogram`): fix a part of `mypy` errors (#28)
emptybutton Aug 9, 2025
7b44ef4
feat(`aiogram`): complete emoji menu (#28)
emptybutton Aug 10, 2025
ad7f9fb
feat(`aiogram`): complete profile menu (#28)
emptybutton Aug 10, 2025
ba20bac
feat(`aiogram`): complete main menu (#28)
emptybutton Aug 11, 2025
63852d1
feat(`aiogram`): start game windows (#28)
emptybutton Aug 11, 2025
0102be9
ref(`aiogram`): move `views` to `dialogs` (#28)
emptybutton Aug 12, 2025
fb2ee3a
feat(`aiogram`): remake active game view in `dialogs` (#28)
emptybutton Aug 12, 2025
ab64dd2
ref(`aiogram`): use only one container (#28)
emptybutton Aug 13, 2025
c215b75
feat(`aiogram`): make it better, faster, stronger (#28)
emptybutton Aug 13, 2025
d461eb2
feat(`aiogram`): complete game windows with bugs (#28)
emptybutton Aug 13, 2025
e4c008c
fix(`aiogram`): don't read data on game completion (#28)
emptybutton Aug 17, 2025
af0dcd0
feat(`aiogram`): add stars shop window (#28)
emptybutton Aug 17, 2025
95819b3
feat(`aiogram`): add emoji shop window (#28)
emptybutton Aug 18, 2025
d2d74be
style: fix `ruff` errors (#28)
emptybutton Aug 18, 2025
81e30dd
feat(`aiogram`): view completed game in `game_window` (#28)
emptybutton Aug 18, 2025
c822ed6
ref: remove unused code (#28)
emptybutton Aug 18, 2025
4f5e3e3
ref(`presentation`): extract `aiogram_dialog` from `dialogs` (#28)
emptybutton Aug 18, 2025
b18a138
chore(`prod`): remove `grafana` stack
emptybutton Aug 20, 2025
5256b21
fix: init `sentry`
emptybutton Aug 20, 2025
e06ba53
chore(`pyproject`): use version
emptybutton Aug 20, 2025
1ff29bd
fix(`start`): remove `assert False`
emptybutton Aug 20, 2025
96f25d5
Merge pull request #38 from emptybutton/dev
emptybutton Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions deploy/dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ services:

volumes:
backend-data:
name: "ttt-dev-postgres-backend-data"
name: "ttt-dev-backend-data"
postgres-data:
name: "ttt-dev-postgres-postgres-data"
name: "ttt-dev-postgres-data"
redis-data:
name: "ttt-dev-postgres-redis-data"
name: "ttt-dev-redis-data"
nats-data:
name: "ttt-dev-postgres-nats-data"
name: "ttt-dev-nats-data"

secrets:
secrets:
Expand Down
2 changes: 0 additions & 2 deletions deploy/prod/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ POSTGRES_REPLICA_PASSWORD=replica
NATS_TOKEN=nats

GEMINI_URL=https://my-gemini.vercel.app

GRAFANA_ADMIN_PASSWORD=grafana
47 changes: 0 additions & 47 deletions deploy/prod/alloy/config.alloy

This file was deleted.

56 changes: 0 additions & 56 deletions deploy/prod/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,57 +155,6 @@ services:
entrypoint: [""]
command: ["bash", "/mnt/add_streams.sh"]

alloy:
image: grafana/alloy:v1.10.0
container_name: ttt-alloy
volumes:
- ./alloy/config.alloy:/etc/alloy/config.alloy
- /var/run/docker.sock:/var/run/docker.sock
networks:
- loki
command: run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
depends_on:
- loki

loki:
image: grafana/loki:3.4.5
container_name: ttt-loki
environment:
TZ: ${SYSTEM_TIMEZONE:-Europe/Moscow}
volumes:
- loki-data:/loki
- ./loki/loki-config.yaml:/etc/loki/local-config.yaml
networks:
- loki
command: -config.file=/etc/loki/local-config.yaml

grafana:
image: grafana/grafana:12.0.2-ubuntu
container_name: ttt-grafana
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_FEATURE_TOGGLES_ENABLE=grafanaManagedRecordingRules

- GF_AUTH_ANONYMOUS_ENABLED=false
- GF_AUTH_BASIC_ENABLED=true

- GF_SECURITY_FORCE_PASSWORD_CHANGE=true
- GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION=false
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
- GF_SECURITY_MIN_PASSWORD_LENGTH=4

- GF_USERS_ALLOW_SIGN_UP=false

- TZ=${SYSTEM_TIMEZONE:-Europe/Moscow}
ports:
- 3000:3000
volumes:
- grafana-data:/var/lib/grafana
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
networks:
- loki

volumes:
postgres-replica1-data:
name: "ttt-prod-postgres-replica1-data"
Expand All @@ -215,16 +164,11 @@ volumes:
name: "ttt-prod-redis-data"
nats-data:
name: "ttt-prod-nats-data"
loki-data:
name: "ttt-prod-loki-data"
grafana-data:
name: "ttt-prod-grafana-data"

networks:
postgres: null
redis: null
nats: null
loki: null

secrets:
secrets:
Expand Down
11 changes: 0 additions & 11 deletions deploy/prod/grafana/provisioning/datasources/loki.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions deploy/prod/loki/loki-config.yaml

This file was deleted.

9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ttt"
version = "0.1.1"
version = "0.3.0"
description = "Tic-Tac-Toe Telegram Bot"
authors = [
{name = "Alexander Smolin", email = "88573504+emptybutton@users.noreply.github.com"}
Expand All @@ -20,6 +20,7 @@ dependencies = [
"pydantic==2.10.6",
"pydantic-settings[yaml]==2.9.1",
"aiogram==3.20.0.post0",
"aiogram-dialog==2.4.0",
"nats-py[nkeys]==2.10.0",
"openai==1.97.0",
"structlog==25.4.0",
Expand Down Expand Up @@ -48,8 +49,8 @@ build-backend = "hatchling.build"
packages = ["src/ttt"]

[project.scripts]
ttt = "ttt.main.aiogram_slim.__main__:main"
ttt-dev = "ttt.main.aiogram_dev.__main__:main"
ttt = "ttt.main.tg_bot_prod.__main__:main"
ttt-dev = "ttt.main.tg_bot_dev.__main__:main"

[tool.uv]
add-bounds = "exact"
Expand Down Expand Up @@ -106,9 +107,11 @@ ignore = [
"TC006",
"EM101",
"N807",
"FURB118",
]

[tool.ruff.lint.per-file-ignores]
"src/ttt/infrastructure/sqlalchemy/tables/__init__.py" = ["F401"]
"src/ttt/infrastructure/adapters/*" = ["ARG002"]
"src/ttt/presentation/adapters/*" = ["ARG002"]
"src/ttt/presentation/*" = ["RUF001"]
Expand Down
15 changes: 15 additions & 0 deletions src/ttt/application/common/ports/fsm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from abc import ABC, abstractmethod


class InvalidFsmStateError(Exception): ...


class Fsm[StateT](ABC):
@abstractmethod
async def state(self, type_: type[StateT]) -> None:
"""
:raises ttt.application.common.ports.InvalidFsmStateError:
"""

@abstractmethod
async def set(self, state: StateT | None) -> None: ...
90 changes: 0 additions & 90 deletions src/ttt/application/game/common/ports/game_views.py

This file was deleted.

Loading