3.1 KiB

๐Ÿš€ ONE-COMMAND STARTUP

โšก FASTEST WAY TO RUN BETFUN ARENA

cd /Users/arhansubasi/betfun-arena/betfun-arena && npm run dev

That's it! This will start all 4 services in one terminal with color-coded output.


๐Ÿ“Š WHAT YOU'LL SEE

The command will start all services with colored prefixes:

[WEB]   โ–ถ Next.js starting on port 3000...
[API]   โ–ถ Express API starting on port 3001...
[WS]    โ–ถ WebSocket server starting on port 3002...
[INDEX] โ–ถ Solana indexer starting...

๐ŸŒ SERVICES RUNNING

Service Port URL
Frontend 3000 http://localhost:3000
API 3001 http://localhost:3001
WebSocket 3002 http://localhost:3002
Indexer - Background

๐ŸŽฏ WHAT TO DO NEXT

  1. Wait for all services to start (usually 10-30 seconds)
  2. Open your browser: http://localhost:3000
  3. Explore all pages:

๐Ÿ›‘ TO STOP ALL SERVICES

Press Ctrl+C in the terminal where you ran npm run dev.

This will automatically kill all 4 services at once.


๐Ÿ”„ ALTERNATIVE COMMANDS

Production Build:

npm run build
npm run start:all

Individual Services:

npm run dev:web      # Frontend only
npm run dev:api      # API only
npm run dev:ws       # WebSocket only
npm run dev:indexer  # Indexer only

๐Ÿ†˜ TROUBLESHOOTING

Port Already in Use:

# Find and kill processes
lsof -i :3000,3001,3002
kill -9 <PID>

Module Not Found:

# Reinstall dependencies
npm install
cd apps/web && npm install
cd ../.. && npm run dev

Clear Everything:

# Clean and reinstall
npm run clean
npm install
npm run dev

โœจ FEATURES

When running, you get:

  • โœ… Hot reload on code changes
  • โœ… Color-coded console output
  • โœ… All services in one terminal
  • โœ… Auto-restart on crashes
  • โœ… Ctrl+C kills everything

๐Ÿ“ PROJECT STRUCTURE

betfun-arena/
โ”œโ”€โ”€ apps/
โ”‚   โ””โ”€โ”€ web/              โ†’ Frontend (Port 3000)
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ api/              โ†’ REST API (Port 3001)
โ”‚   โ”œโ”€โ”€ websocket/        โ†’ WebSocket (Port 3002)
โ”‚   โ”œโ”€โ”€ indexer/          โ†’ Blockchain Indexer
โ”‚   โ”œโ”€โ”€ anchor/           โ†’ Smart Contracts
โ”‚   โ””โ”€โ”€ sdk/              โ†’ TypeScript SDK
โ””โ”€โ”€ package.json          โ†’ Root scripts

๐ŸŽ‰ YOU'RE READY!

Just run:

npm run dev

And visit http://localhost:3000 ๐Ÿš€โš”๏ธ๐Ÿ†


๐Ÿ’ก PRO TIPS

  1. Keep this terminal open - all logs appear here
  2. Watch for errors - color-coded by service
  3. Auto-reload works - save files to see changes
  4. One Ctrl+C stops all - clean shutdown

Status: ๐ŸŸข All Services Configured
Command: npm run dev
URL: http://localhost:3000

Happy Coding! ๐ŸŽฏ