Files
vyryi-back/README.md
Redsandy 5125b52583 Add spin session functionality and update game mechanics
- Introduced a new `spin_sessions` table to track user spin activities.
- Updated the API to include a new endpoint for spinning games, allowing users to place bets and specify spin counts.
- Enhanced game information structure and added validation for bets and spin counts.
- Implemented the `Forest Fortune` slot game mechanics, including payline evaluation and scatter functionality.
- Updated dependencies in `pyproject.toml` for development and added `httpx` for HTTP requests.
- Added unit tests for the new slot mechanics and API endpoints to ensure functionality and reliability.
2026-08-12 15:27:24 +03:00

48 lines
1014 B
Markdown

# Vyryi API
FastAPI backend for the Vyryi Telegram Mini App casino MVP.
## Stack
- FastAPI + SQLAlchemy 2 (`create_engine`, sync `Session`)
- SQLite locally, PostgreSQL in production (`DATABASE_URL`)
- Alembic migrations
- JWT auth (`/auth/dev-login` for local work)
- Managed with [uv](https://github.com/astral-sh/uv)
## Quick start
```bash
cd vyryi-back
copy .env.example .env
uv sync
uv run uvicorn app.main:app --reload --port 8000
```
API docs: http://127.0.0.1:8000/docs
## Main endpoints
- `POST /auth/dev-login` — local JWT login
- `POST /auth/telegram` — stub (501 until `BOT_TOKEN`)
- `GET /me`, `POST /me/agreement`
- `GET /wallet`, `POST /wallet/deposit` (amounts: 100 / 500 / 1000)
- `GET /games`, `GET /games/{slug}`
- `POST /games/{slug}/spin` — bet + spin_count (1…1000); Forest Fortune is playable
No withdrawal endpoints by design.
## Production DB
Set:
```
DATABASE_URL=postgresql+psycopg2://user:pass@host:5432/vyryi
```
Then run:
```bash
uv run alembic upgrade head
```