22 Commits

Author SHA1 Message Date
davide a3c0892fea docs: update READMEs for new features
Document SVG map, mission improvements (chips, chance bar, abandon,
loot, fine), market trend tags, leaderboard live updates, and the
new abandon API endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:12:29 +02:00
davide 48e618d543 client: nav mission badge + CSS for map, missions, market, dashboard
Layout polls active missions every 20s and on socket events; shows a
red badge on the Missioni nav tab when missions are ready to claim.
CSS additions: SVG map styles with pulse animation, chance bar,
mission type chips, lock/abandon styles, market trend tags,
quicklinks row, nav badge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:12:21 +02:00
davide 6abd115c81 client: market trend tags + leaderboard live updates via Socket.IO
Market rows show a TrendTag: 💰 affare when buyPrice < basePrice,
📈 vendi when sellPrice > basePrice. Leaderboard subscribes to
leaderboard:updated socket event to refresh without polling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:12:14 +02:00
davide 18de7fda21 client: dashboard — active missions widget and quicklinks
Home screen now loads active missions alongside player/events data.
Shows a "Missioni in corso" card with per-mission countdown and
inline Riscuoti button (with toast feedback). Quick-access buttons
to Missioni, Mercato, Classifiche replace the single leaderboard link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:12:08 +02:00
davide bdee84244f client: missions screen — narrative, chips, chance bar, loot, abandon
Available missions now show description, type chip (colored by type),
success probability bar (green/gold/red), minLevel lock with 🔒.
Reward loot item displayed in footer. Active missions show reward
loot and an Abandon button (confirm dialog, −1 rep warning).
Result modal shows loot and fine details.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:12:03 +02:00
davide bf5cfdb4ed client: travel screen — SVG Italy map with clickable city markers
Replace plain list with a styled SVG Italy outline (mainland, Sicily,
Sardinia). Cities rendered as markers: color by risk level, pulse
animation for current city,  icon for active events. Clicking a
marker or a list row opens a travel modal with city details and
confirm button. List remains as compact fallback below the map.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:11:53 +02:00
davide 25376553e7 client: API layer — types and client updates for new server fields
Add AvailableMission (extends Mission with estimatedSuccessChance,
canStart), AbandonMissionResponse type. Extend Mission with description,
minLevel, rewardItemName/Quantity; ClaimMissionResponse with moneyChange,
fine, lootItem fields; City with mapX/mapY; MarketEntry with basePrice.
Add abandonMission() API call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:11:44 +02:00
davide 123b67952e server: API — expose mapX/mapY in cities and basePrice in market
Cities endpoint now returns map coordinates for the SVG map renderer.
Market endpoint includes basePrice so the client can compute price
trend deltas relative to the item base value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:11:38 +02:00
davide 1568520533 server: missions — type configs, level gate, loot, fine on failure, abandon
Each mission type now has a typeConfig (moneyFactor, xpFactor, repFactor,
riskShift, requiredItemChance, lootChance). startMission checks minLevel.
claimMission awards loot items on success; applies a police-scaled fine
on failure. New abandonMission endpoint (POST /:id/abandon, −1 rep).
computeSuccessChance extracted for reuse between listAvailable and claim.
Narrative template pool expanded (4 templates × 4 types).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:11:33 +02:00
davide 8804dfeb22 server: schema — City map coords, Mission narrative/level/loot fields
Add mapX/mapY to City for SVG map positioning; add description,
minLevel, rewardItemId/Quantity to Mission; add named relations
MissionRequiredItem and MissionRewardItem on Item. Seed updated
with Italian city coordinates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:11:26 +02:00
davide 0f91ace43e client: screens and app routing
Add all game screens: Login, Dashboard, Market (buy/sell), Inventory,
Missions, Travel (city selection), Leaderboard; wired via react-router
in App.tsx with protected routes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:42:35 +02:00
davide 95864ce392 client: realtime socket and shared UI components
Add Socket.IO client wrapper (auto-reconnect, auth token), and
reusable components: Layout (nav bar), Toast notifications, and
Countdown timer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:42:30 +02:00
davide 9e65fe5a3c client: auth context and API layer
Add JWT-based AuthContext (login/logout, token persistence), typed
HTTP client with auth header injection, REST API functions for all
game endpoints, and shared TypeScript types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:42:22 +02:00
davide ad02b274d2 client: project config and bootstrap
Add Vite + React + TypeScript setup, package.json (react-router-dom,
socket.io-client), global CSS, app entry point and environment
config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:42:14 +02:00
davide 0cd396ac1d server: Socket.IO realtime layer
Set up authenticated Socket.IO server; broadcasts market updates,
world events, and mission notifications to connected clients in
real time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:42:09 +02:00
davide a998bb9704 server: scheduled background jobs
Add node-cron jobs for periodic market price updates, mission
generation, and world event generation; all wired through a central
scheduler module.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:42:04 +02:00
davide fb62a39dab server: game API modules — market, missions, players, inventory, leaderboard, cities, events
Add routes and services for all game domains: market buy/sell with
dynamic pricing, mission generation and completion, player stats and
travel, inventory queries, leaderboard, city list, and world events.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:41:44 +02:00
davide c792f67e2d server: auth module — register, login, JWT
Implement registration and login endpoints with bcrypt password
hashing and JWT token issuance; all game routes depend on this.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:41:39 +02:00
davide 8ad83348f4 server: core bootstrap — config, db clients, shared utilities
Add env config (zod validation), game balance constants, Prisma and
Redis client singletons, auth guard middleware, error helpers,
request validators, Fastify JWT type augmentation, and app/server
entry points.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:41:33 +02:00
davide 8a91a298a7 server: database schema, migrations and seed
Define Prisma schema (Player, City, Good, InventoryItem, Transaction,
Mission, WorldEvent), initial migration SQL, and seed script to
populate cities and goods with base game data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:41:27 +02:00
davide 34708340f1 server: project config and infrastructure setup
Add package.json (Fastify, Prisma, Redis, JWT), TypeScript config,
Dockerfile, docker-compose with Postgres and Redis services, and
.gitignore with data directory rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 23:41:21 +02:00
davide 145c7f89dc initial commit 2026-06-09 22:40:43 +02:00