Phase 0 foundation: - Docker Compose with PostgreSQL, Redis, Hardhat node - RPSArena.sol commit-reveal smart contract with tests - Node.js + Socket.io server with matchmaking and match state machine - Next.js + Phaser 3 frontend with Boot, Lobby, Arena, Result scenes - Nginx Proxy Manager integration planned for jeu.cosmolan.fr Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
39 lines
903 B
Text
39 lines
903 B
Text
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Player {
|
|
id String @id @default(cuid())
|
|
address String @unique
|
|
name String
|
|
avatar String?
|
|
rating Int @default(1000)
|
|
wins Int @default(0)
|
|
losses Int @default(0)
|
|
draws Int @default(0)
|
|
profit String @default("0")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
histories History[]
|
|
}
|
|
|
|
model History {
|
|
id String @id @default(cuid())
|
|
matchId String
|
|
player1Address String
|
|
player2Address String
|
|
player1Choice Int
|
|
player2Choice Int
|
|
winnerAddress String?
|
|
betAmount String
|
|
txHash String
|
|
createdAt DateTime @default(now())
|
|
|
|
player Player? @relation(fields: [player1Address], references: [address])
|
|
}
|