Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a NBA Player Stock Market Trading Simulation built as a monorepo with:
# Install all dependencies npm run install:all # Start both backend and frontend concurrently npm run dev # Individual services npm run backend:dev # Backend with nodemon on port 3001 npm run frontend:start # Expo dev server # Additional workspace commands from root npm run clean # Remove all node_modules npm run build:backend # Build backend only npm run start:backend # Start production backend npm run test:backend # Backend tests only npm run test:frontend # Frontend tests only
# Backend cd backend npm run dev # Development with nodemon npm run build # TypeScript compilation npm run start # Production build npm test # Jest tests # Frontend cd frontend npm start # Expo dev server npm run android # Open Android emulator npm run ios # Open iOS simulator npm run web # Open web browser npm test # Jest tests # Shared Types cd shared npm run build # Compile TypeScript types npm run dev # Watch mode compilation
Backend requires
.env file (see backend/.env.example):
Frontend configuration in
app.json sets API URLs to localhost:3002, but backend runs on 3001 by default. Verify port consistency between backend/.env and frontend app.json.
├── backend/ # Node.js Express + Socket.IO server │ ├── src/routes/ # REST API endpoints (/api/*) │ ├── src/socket/ # Real-time handlers & game simulation │ ├── src/data/ # Mock data & price engine integration │ ├── src/services/ # Auth, database services │ └── src/utils/ # PriceEngine class ├── frontend/ # React Native Expo app │ ├── src/screens/ # Main app screens (4 tabs) │ ├── src/context/ # React Context providers │ ├── src/services/ # API client │ └── src/theme/ # React Native Paper theming └── shared/ # Shared TypeScript types └── src/types.ts # Player, Portfolio, Trade interfaces
PriceEngine (
backend/src/utils/priceEngine.ts):
Socket.IO Integration (
backend/src/socket/):
React Context Architecture (
frontend/src/context/):
SocketContext: WebSocket connection managementPortfolioContext: User portfolio stateGameContext: Live game state and tradingAPI Structure (
backend/src/routes/):
/api/players - Player data and price history/api/portfolio - User holdings and performance/api/trades - Trading execution and history/api/leaderboard - Rankings and statistics/api/game - Live game status and simulationCore types in
shared/src/types.ts:
Player: NBA player with stats, price history, volatilityPortfolio: Season/live holdings with P&L trackingTrade: Market orders with execution detailsLiveGame: Game simulation state and events@/*, @components/*, etc.)shared/src/types.ts, run cd shared && npm run build to recompile before testingimport { Player, Portfolio, Trade } from '@player-stock-market/shared'Both frontend and backend have Jest configured:
npm test in respective directoriesfrontend/src/theme/theme.ts