feat: XP foundation + waves + featured game + profile + leaderboard by total_xp

- services/xp.py: award_xp, level_for, RANKS (48), featured_game
- services/waves.py: wave_plan, grid_size_for, wave_medal
- routers/featured.py: GET /featured (игра дня ×1.5)
- routers/users.py: POST /set-nickname, POST /set-avatar
- routers/app_auth.py: /auth/me с XP-полями (level, rank_key, rank_name, xp)
- routers/game.py: award_xp + 3 штрафа + POST /game/next (волны)
- routers/wordquiz.py: award_xp + серии в choose_progress
- routers/bubblewords.py: award_xp + 4 штрафа
- routers/sentences.py: award_xp по длине предложения
- routers/leaderboard.py: сортировка по total_xp, XP-поля в ответе
- database.py: миграции user_profile, xp_log, choose_progress, user_seen_levels, user_game_progress, wave_results, bubble_levels, user_word_stats
- main.py: подключение routers/featured

Проверено:
- /auth/me отдаёт level=1, rank_00, xp_in_level
- /featured отдаёт wordsearch + seconds_left
- /game/complete-level начисляет XP через award_xp
- xp_log, user_profile заполняются
- /game/next выдаёт уровень по волнам
- /leaderboard сортирует по total_xp
This commit is contained in:
2026-10-09 08:12:19 +00:00
parent a3f7d9521f
commit 84927b063f
13 changed files with 1800 additions and 278 deletions
+2
View File
@@ -15,6 +15,7 @@ from routers import users, game, hints, leaderboard, sentences, achievements, wo
from routers import lectures, admin_auth, admin_wordsearch, admin_users
from routers import admin_ai # 🔧 НОВОЕ
from routers import app_auth # 🆕 Pleily auth
from routers import featured as featured_router # 🔧 НОВОЕ (08.10.2026)
from routers.sentences import init_sentences
from routers.achievements import init_achievements
from routers.learning_data import init_learning_data
@@ -375,6 +376,7 @@ app.include_router(admin_wordsearch.router)
app.include_router(admin_users.router)
app.include_router(admin_ai.router) # 🔧 НОВОЕ
app.include_router(app_auth.router) # 🆕 Pleily
app.include_router(featured_router.router) # 🔧 НОВОЕ (08.10.2026)
# ============ Базовые эндпоинты ============