A comprehensive 24/7 tracking dashboard for Torn.com featuring:
- Stock price tracking with historical charts
- Xanax consumption tracker with cooldown notifications
- Item trading tracker with profit/loss calculations
- Automatic market price updates
- Pushover notifications for alerts
- Node.js 18 or higher
- Torn API key
- (Optional) Pushover account for notifications
- Install dependencies:
npm install- Set environment variables (optional):
export TORN_API_KEY="your_api_key_here"
export PUSHOVER_USER="your_pushover_user_key"
export PUSHOVER_TOKEN="your_pushover_app_token"- Start the development server:
# Run frontend and backend together
npm run start:dev
# Or run separately:
# Terminal 1: Frontend (Vite dev server on :5173)
npm run dev
# Terminal 2: Backend (Express server on :3000)
npm start- Open http://localhost:5173 in your browser
- Build the frontend:
npm run build- Start the production server:
npm start- Open http://localhost:3000 in your browser
Build and run with Docker:
docker build -t torn-stock-dashboard .
docker run -d \
-p 3000:3000 \
-e TORN_API_KEY="your_api_key" \
-e PUSHOVER_USER="your_pushover_user" \
-e PUSHOVER_TOKEN="your_pushover_token" \
-v $(pwd)/data:/app/data \
torn-stock-dashboard- Real-time stock prices for all Torn stocks
- Historical price charts (24h, 7d, 30d)
- Stock benefits information
- Server-side 24/7 data collection
- Automatic cooldown monitoring
- Daily consumption goal tracking (3/day)
- Browser and Pushover notifications
- Historical consumption stats
- Automatic purchase detection from event log
- Real-time market price updates
- Profit/loss calculations with percentages
- Position aggregation (multiple purchases of same item)
- Customizable profit thresholds per item
- Sell alerts when target profit is reached
- Trading rules configuration (max items, capital limits)
- Price alerts for buying opportunities
You can provide your Torn API key in two ways:
- Set
TORN_API_KEYenvironment variable (server-side, for 24/7 tracking) - Enter it in the web UI (browser-only, stored in localStorage)
For 24/7 automatic tracking, use the environment variable.
All data is stored in SQLite (data/stocks.db). The database includes:
- Stock price history
- Drug consumption logs
- Item purchases and sales
- Market price history
- Trading rules and preferences
- Frontend: React with Vite (production build)
- Backend: Express.js with better-sqlite3
- Scheduling: node-cron for periodic tasks
- Notifications: Pushover (optional)
├── src/ # React frontend source
│ ├── App.jsx # Main application component
│ ├── App.css # Styles
│ ├── components/ # Reusable components
│ └── main.jsx # Entry point
├── dist/ # Built frontend (generated)
├── server.js # Express backend
├── data/ # SQLite database
└── Dockerfile # Multi-stage Docker build
- Migrated from inline React to proper Vite build setup
- Fixed item trading current value not updating
- Improved market price tracking with better error handling
- Added comprehensive logging for debugging
- Multi-stage Docker build for smaller image size