Commit Graph

117 Commits

Author SHA1 Message Date
soroush.asadi 2d2352dfe8 Add in-app + real-time notifications (SignalR/mock, Iran-friendly)
- AppNotification + OnlineService.onNotification (hub event + mock periodic) —
  no FCM/APNs (blocked in Iran); uses the existing realtime channel
- notification-store + pushNotification(); 🔔 bell with unread badge in TopBar,
  notifications screen, global toaster (plays notify sfx)
- Wired events: daily reward, post-match achievements, friend requests
- Closed-app push (Pushe/Najva/Chabok) noted as a later step (needs provider keys)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 15:52:06 +03:30
soroush.asadi e02d976dda Add Abrha as a Maven Central fallback mirror (Myket stays primary)
- Myket (root) proxies Central + Google/AGP; Abrha
  (mirror.abrha.net/repository/maven/) is Central-only → used as fallback
- build.gradle + gradle-mirror.init template list both; APK rebuilds clean

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 15:26:57 +03:30
soroush.asadi 84ccbea56a Build Android APK via Myket maven mirror (verified)
- Myket mirror serves maven2 layout at root https://maven.myket.ir (proxies
  Maven Central + Google/AGP); android/build.gradle uses it
- gradle-mirror.init.gradle template injects the mirror into all modules and
  pins build-tools 36 + Java 17 (this env lacks build-tools 35 / JDK 21)
- ANDROID.md updated with the exact working build command
- Produces app-debug.apk (~4.5 MB)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 15:22:34 +03:30
soroush.asadi 38691154c8 Add Capacitor Android packaging (APK) for Cafe Bazaar / Myket
- Next static export (output: export) wrapped by Capacitor; appId
  com.bargevasat.app, appName «برگ وسط»
- android/ native project + @capacitor/app; hardware back handled by
  CapacitorBack (back a screen, exit at home)
- npm scripts (cap:sync, android:open, android:apk), ANDROID.md
- Gradle Maven-mirror init-script template (dl.google.com/Maven Central are
  blocked in Iran — same reason NuGet is mirrored)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 14:31:14 +03:30
soroush.asadi d04605d118 Brand the app as «برگ وسط» / Barg-e Vasat
- Name + tagline («بازی حکم آنلاین») across i18n (app.title/subtitle),
  layout metadata, PWA manifest, app icon, package name, server health
- Gameplay term «حکم» unchanged; repo/folder stay hokm/HokmPlay

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 14:01:14 +03:30
soroush.asadi 292dedd843 Show live online-players count on the home screen
- OnlineService.getOnlineCount(); mock random-walks a believable number,
  SignalrService reads GET /api/stats/online (server tracks hub connections)
- Home screen badge with pulsing dot, polls every 8s, localized digits

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 13:20:51 +03:30
soroush.asadi ceccf70de7 Wire client SignalrService to the live .NET backend
- @microsoft/signalr client implementing OnlineService: REST auth, hub
  matchmaking, server-driven game state (onState), play/trump, reactions;
  delegates not-yet-server-backed features (profile/friends/shop/chat/rooms)
  to the mock. Selected via NEXT_PUBLIC_USE_SERVER=1 (NEXT_PUBLIC_SERVER_URL)
- game-store live mode: enterServerMatch + applyServerState (maps server DTO,
  hides opponent hands, tally + SFX), inputs route to the hub; no local engine
- MatchmakingScreen auto-enters the live match when the server signals ready
- Verified end-to-end via scripts/live-test.mjs (auth -> hub -> match -> state)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 13:13:48 +03:30
soroush.asadi a3b797c8a3 Add History API routing so browser/Android back navigates screens
- ui-store syncs screens to history (push on go/goGame, hash URLs like #/profile),
  back() = history.back(), initHistory anchors a home base + restores deep links
- page.tsx listens to popstate; resolveScreen() guards transient screens
  (game/room/chat/matchmaking fall back to home when their state is gone)
- ScreenHeader + ChatScreen back buttons use history back; chat cleans up on unmount

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 12:56:14 +03:30
soroush.asadi 0a3ffa6314 Fix: in-game mute button now mutes background music too
HUD mute is a master toggle (sound effects + music) via sound-store.toggleAll;
icon reflects fully-muted state.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 12:46:51 +03:30
soroush.asadi aaf66b921f Phase G: scaffold .NET 10 + SignalR backend (engine port + hub + auth)
- server/ monorepo: Hokm.Engine (C# port of TS engine+AI, validated by sim),
  Hokm.Server (SignalR GameHub, in-memory matchmaking/rooms, server-side turn
  timers + bot fill + disconnect handling, per-seat state broadcast), Hokm.Sim
- JWT dev auth (OTP 1234 + email); CORS for the Next client; /hub/game
- NuGet restored from mirrors (Soroush Nexus + Liara); NuGetAudit off
- README + .NET .gitignore; static class Engine renamed Rules (namespace clash)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 12:42:15 +03:30
soroush.asadi ae239f4c51 Split card design into front+back, add sound effects & background music
Card design:
- Separate cardFront + cardBack (each own/equip independently)
- Fronts: classic (free), ivory/rosegold (buy), parchment/mint (earned)
- Backs: classic (free), sapphire/emerald (buy), ruby/royal (earned)
- PlayingCard `front` prop; table applies front to all faces, back to opponents
- Profile has front + back pickers; shop has both sections

Audio:
- Web Audio synth engine (no asset files): SFX for card/deal/trump/trick,
  win/lose, message, notify, award, levelup, purchase, kot + ambient music
- Toggles in profile (Audio) + mute button in game HUD; prefs persisted
- Wired across game-store, rewards, daily, shop, chat

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 11:49:19 +03:30
soroush.asadi db4eade619 Add designed sticker packs (SVG art) to the reactions system
- 15 hand-designed inline-SVG stickers (faces, Hokm: حکم/کُت/crown/ace,
  Persian: chai/آفرین/rose, taunts: clown/zzz/ضعیف) in components/online/Sticker.tsx
- Sticker packs: faces (free), hokm (earned @rating 1300), persian & taunt (buy)
- In-game tray now tabbed Emoji | Stickers; stickers broadcast as "sticker:<id>"
  and render as large animated bubbles per seat
- Shop sells sticker packs; profile.ownedStickerPacks; gamification helpers
  ownedStickers/ownedStickerPackIds; mock opponents send stickers too

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 11:15:28 +03:30
soroush.asadi f9425dea01 Add reactions (Sheklak), fix hakem card visibility during trump choice
- Reactions/emotes in-game: tray of owned emojis + animated per-seat bubbles
  (feature named "شکلک / Sheklak"). Packs: starter (free), champion/legend
  (earned by rating/wins), emotions/taunt (purchasable in shop)
- OnlineService.sendReaction/onReaction; mock echoes you + random opponents
- Fix: human hakem's 5 cards were blurred behind the trump-chooser overlay —
  raise hand to z-50 during choosing-trump so cards stay readable

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 11:02:25 +03:30
soroush.asadi 13ec0d4300 Turn timer + auto-play, disconnect/reconnect, cosmetics, queue & paid plan
- Turn timer (20s) for play/trump; system auto-plays a smart move on timeout
- Disconnect handling (mock): wait-for-return countdown, system covers turns
- Cosmetics: titles, card-back styles, custom profile-image upload, badges;
  pickers in Profile; shop sells card styles; reward modal shows new titles
- Paid plan (pro): free players queue when server busy, pro skips; upgrade flow
- OnlineService extended (upgradePlan, richer profile patch); mock implements
  queue + plans; gamification adds TITLES + CARD_STYLES

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:49:54 +03:30
soroush.asadi 5776036d78 Add friend chat; replace betting wording (شرط) with entry coins
- Friend-to-friend chat outside the game (ChatScreen) with mock replies,
  per-friend history, unread tracking; chat button on each friend row
- OnlineService + mock + online-store extended with chat (list/get/send/markRead)
- Reframe gambling term: "شرط"/"Stake" -> "سکه ورودی"/"Entry coins";
  free entry labeled رایگان/Free

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:21:44 +03:30
soroush.asadi e2d0a602b6 Build Hokm card game: offline vs-AI + online social/gamification (mock backend)
- Pure-TS Hokm engine (deal, hakem, trump, tricks, scoring, Kot) + AI bots
- Persian-luxury RTL UI (Next 16 / React 19 / Tailwind v4 / Framer Motion / Zustand)
- Online platform behind OnlineService seam (mock now, .NET SignalR later):
  auth (phone OTP + email/Google), profiles, friends, private rooms with
  partner pick, ranked matchmaking, leaderboard, shop
- Gamification: ranks/leagues, coins, XP/levels, daily rewards, achievements
- i18n fa/en, PWA manifest, engine + gamification sims

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:11:00 +03:30
soroush.asadi dff1a34f95 Initial commit from Create Next App 2026-06-04 06:09:11 +03:30