nice update

This commit is contained in:
gpatruno
2026-07-16 20:23:58 +02:00
parent a0d7163464
commit 9106c8b873
47 changed files with 5183 additions and 1732 deletions
+33 -9
View File
@@ -1,11 +1,11 @@
# CaseForge
CS-style case opening site with virtual credits, inventory, leaderboard, and an admin panel for cases / drops / rates.
CS-style case opening site with virtual credits, inventory, multiplayer item betting, shop, leaderboard, and an admin panel for cases / drops / rates.
## Stack
- **Server**: Node.js, Express, Prisma, SQLite, express-session
- **Client**: React (Vite), React Router
- **Server**: Node.js, Express, Prisma, SQLite, express-session, Socket.IO
- **Client**: React (Vite), React Router, Socket.IO client
## Setup
@@ -18,6 +18,20 @@ npm run dev
- App: http://localhost:5173
- API: http://localhost:3001
- LAN: http://\<your-lan-ip\>:5173 (Vite binds to `0.0.0.0`)
Create `server/.env` if missing:
```
DATABASE_URL="file:./dev.db"
PORT=3001
CLIENT_ORIGIN=http://localhost:5173
SESSION_SECRET=dev-secret
STARTING_BALANCE=10000
STARTING_OSU=100
JACKPOT_ROUND_SECONDS=60
JACKPOT_MAX_ITEMS=3
```
## Demo accounts
@@ -26,18 +40,28 @@ npm run dev
| Admin | `admin` | `admin123` |
| Player| `player` | `player123`|
New registrations receive **100.00** starting credits (`STARTING_BALANCE` in `server/.env`, stored in cents).
New registrations receive **100.00** starting credits and **100 osu** (`STARTING_BALANCE` / `STARTING_OSU` in `server/.env`; credits stored in cents).
## Features
- Login / register (username + password)
- Dashboard: inventory + available cases
- Case page with CS-style reel open animation (result rolled server-side)
- Inventory: sort by recent or value, multi-select and sell at market value
- **Feed Drop**: toggle in nav — live left column of latest case unboxes + player
- Cases page: browse and open crates (CS-style reel, result rolled server-side)
- **Bet Item** hub:
- **MultiPlayers Case** — live shared pot, up to 3 items, win chance by value, Socket.IO sync
- **1vX Case** — custom rooms (player/item limits, min value), spectate in-progress
- **Coinflip** — stub (coming soon)
- **Shop**: spend osu on credit packs; watch an ad every 1 min for 100.00200.00 cr
- Profile (via username in the nav): avatar, bio, password, stats
- Leaderboard: richest players (balance + inventory market value)
- Admin: manage cases, items, drop weights, enable/disable cases
- Admin: manage cases, items, images (URL or upload), drop weights, enable/disable cases
## Notes
- Balances and prices are integers in **cents**
- `Transaction` types include `open_case` and `seed_credit` (stubs for future `deposit` / `withdrawal`)
- Balances and prices are integers in **cents**; **osu** is a separate demo currency for the shop
- Inventory items locked while deposited in a bet; unlocked or transferred on resolve
- `Transaction` types include `open_case`, `seed_credit`, `seed_osu`, `sell_item`, `shop_purchase`, `ad_reward`, `jackpot_bet`, `jackpot_win`, `duel_bet`, `duel_win`
- Avatars stored under `server/uploads/` and served at `/uploads`
- Real-time state via Socket.IO (`jackpot`, `duel:{id}`, `duels` rooms)
- Swap `DATABASE_URL` to PostgreSQL later without changing app logic