Some checks failed
Release / release (push) Has been cancelled
Full-stack dashboard for controlling, automating, and analyzing Artifacts MMO characters via the game's HTTP API. Backend (FastAPI): - Async Artifacts API client with rate limiting and retry - 6 automation strategies (combat, gathering, crafting, trading, task, leveling) - Automation engine with runner, manager, cooldown tracker, pathfinder - WebSocket relay (game server -> frontend) - Game data cache, character snapshots, price history, analytics - 9 API routers, 7 database tables, 3 Alembic migrations - 108 unit tests Frontend (Next.js 15 + shadcn/ui): - Live character dashboard with HP/XP bars and cooldowns - Character detail with stats, equipment, inventory, skills, manual actions - Automation management with live log streaming - Interactive canvas map with content-type coloring and zoom/pan - Bank management, Grand Exchange with price charts - Events, logs, analytics pages with Recharts - WebSocket auto-reconnect with query cache invalidation - Settings page, error boundaries, dark theme Infrastructure: - Docker Compose (dev + prod) - GitHub Actions CI/CD - Documentation (Architecture, Automation, Deployment, API)
54 lines
1.6 KiB
Python
54 lines
1.6 KiB
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import DateTime, Integer, JSON, String, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class EventLog(Base):
|
|
"""Logged game events for historical tracking and analytics."""
|
|
|
|
__tablename__ = "event_log"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
event_type: Mapped[str] = mapped_column(
|
|
String(100),
|
|
nullable=False,
|
|
index=True,
|
|
comment="Type of event (e.g. 'combat', 'gathering', 'trade', 'level_up')",
|
|
)
|
|
event_data: Mapped[dict] = mapped_column(
|
|
JSON,
|
|
nullable=False,
|
|
default=dict,
|
|
comment="Arbitrary JSON payload with event details",
|
|
)
|
|
character_name: Mapped[str | None] = mapped_column(
|
|
String(100),
|
|
nullable=True,
|
|
index=True,
|
|
comment="Character associated with the event (if applicable)",
|
|
)
|
|
map_x: Mapped[int | None] = mapped_column(
|
|
Integer,
|
|
nullable=True,
|
|
comment="X coordinate where the event occurred",
|
|
)
|
|
map_y: Mapped[int | None] = mapped_column(
|
|
Integer,
|
|
nullable=True,
|
|
comment="Y coordinate where the event occurred",
|
|
)
|
|
created_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True),
|
|
server_default=func.now(),
|
|
nullable=False,
|
|
index=True,
|
|
)
|
|
|
|
def __repr__(self) -> str:
|
|
return (
|
|
f"<EventLog(id={self.id}, type={self.event_type!r}, "
|
|
f"character={self.character_name!r})>"
|
|
)
|