Admin Resources
Resources are the core entities managed through the admin panel. Each resource has List, Show, Create, and Edit views.
Resource Structure
Each resource follows this pattern:
src/components/resources/[Resource]/
├── index.ts # Resource export
├── List.tsx # List view
├── Show.tsx # Detail view
├── Create.tsx # Create form (optional)
├── Edit.tsx # Edit form (optional)
├── Form.tsx # Shared form fields
├── filters.tsx # List filters
└── Icon.tsx # Resource iconUser Resource
Path: src/components/resources/User/
Operations: List, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | User ID |
| String | Email address | |
| username | String | Display name |
| avatar | String | Avatar URL |
| cup | Number | Ranking points |
| exp | Number | Experience points |
| createdAt | DateTime | Registration date |
Filters
- Search by email/username
- Filter by date range
Game Resource
Path: src/components/resources/Game/
Operations: List, Create, Edit, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | Game ID |
| title | String | Challenge name |
| description | String | Description |
| isActive | Boolean | Active status |
| duration | Duration | Match duration |
| minPlayers | Number | Minimum participants |
| maxPlayers | Number | Maximum participants |
| maxPositions | Number | Max positions per player |
| startVBalance | Number | Starting virtual balance |
| entryFee | Number | Entry fee amount |
| cup | Number | Cup points at stake |
| winExp | Number | Winner XP |
| loseExp | Number | Loser XP |
| rewardPrice | Number | Prize pool |
| currency | Enum | USDT/SOL/BT |
| cover | String | Cover image URL |
Form Sections
- Basic Info: Title, description, cover
- Players: Min/max players, max positions
- Economy: Entry fee, reward, currency
- Progression: Cup, XP (win/lose)
- Settings: Duration, starting balance
GameMatch Resource
Path: src/components/resources/GameMatch/
Operations: List, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | Match ID |
| gameId | UUID | Parent game |
| status | Enum | open/pending/closed |
| startTime | DateTime | Match start |
| endTime | DateTime | Match end |
| winnerId | UUID | Winner user ID |
Relationships
game: Parent Gameparticipants: GameMatchParticipant[]positions: GameMatchPosition[]winner: User
GameMatchPosition Resource
Path: src/components/resources/GameMatchPosition/
Operations: List, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | Position ID |
| baseToken | String | Trading pair (e.g., BTCUSDT) |
| entryPrice | Number | Entry price |
| closePrice | Number | Close price |
| margin | Number | Margin amount |
| leverage | Number | Leverage used |
| side | Enum | buy/sell |
| type | Enum | market/limit |
| status | Enum | open/pending/closed/liquidated/canceled |
| stopLoss | Number | Stop loss price |
| targetPoint | Number | Take profit price |
| size | Number | Position size |
| profit | Number | Realized profit |
| liquidationPrice | Number | Liquidation price |
Wallet Resource
Path: src/components/resources/Wallet/
Operations: List, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | Wallet ID |
| userId | UUID | Owner user |
| balance | Number | Current balance |
| locked | Number | Locked funds |
| currency | Enum | USDT/SOL/BT |
| address | String | Blockchain address |
Relationships
user: Usertransactions: Transaction[]
Transaction Resource
Path: src/components/resources/Transaction/
Operations: List, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | Transaction ID |
| walletId | UUID | Related wallet |
| amount | Number | Amount |
| type | Enum | deposit/withdraw |
| status | Enum | pending/completed/failed/canceled |
| description | String | Description |
| ref | String | Reference ID |
| balanceAfterTransaction | Number | Balance after |
| createdAt | DateTime | Created at |
Achievement Resource
Path: src/components/resources/Achievement/
Operations: List, Create, Edit, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | Achievement ID |
| name | String | Achievement name |
| description | String | Description |
| icon | String | Icon URL |
| rules | JSON | Achievement rules |
Consumable Resource
Path: src/components/resources/Consumable/
Operations: List, Create, Edit, Show
Fields
| Field | Type | Description |
|---|---|---|
| id | UUID | Consumable ID |
| name | String | Item name |
| description | String | Description |
| image | String | Image URL |
| type | Enum | Item type |
| value | Number | Item value |
Data Provider
All resources use a custom GraphQL data provider:
Path: src/data/provider.ts
Operations
| Operation | Description |
|---|---|
| getList | Paginated list query |
| getOne | Single entity query |
| getMany | Multiple entities by IDs |
| getManyReference | Related entities |
| create | Create mutation |
| update | Update mutation |
| delete | Delete mutation |
| deleteMany | Bulk delete |
| updateMany | Bulk update |