Skip to content

Aloosli/torn-dashboard

Repository files navigation

Lizrd's Torn Dashboard

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

Setup

Prerequisites

  • Node.js 18 or higher
  • Torn API key
  • (Optional) Pushover account for notifications

Development

  1. Install dependencies:
npm install
  1. 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"
  1. 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
  1. Open http://localhost:5173 in your browser

Production Build

  1. Build the frontend:
npm run build
  1. Start the production server:
npm start
  1. Open http://localhost:3000 in your browser

Docker

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

Features

Stock Tracking

  • Real-time stock prices for all Torn stocks
  • Historical price charts (24h, 7d, 30d)
  • Stock benefits information
  • Server-side 24/7 data collection

Xanax Tracker

  • Automatic cooldown monitoring
  • Daily consumption goal tracking (3/day)
  • Browser and Pushover notifications
  • Historical consumption stats

Item Trading

  • 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

API Key

You can provide your Torn API key in two ways:

  1. Set TORN_API_KEY environment variable (server-side, for 24/7 tracking)
  2. Enter it in the web UI (browser-only, stored in localStorage)

For 24/7 automatic tracking, use the environment variable.

Database

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

Architecture

  • Frontend: React with Vite (production build)
  • Backend: Express.js with better-sqlite3
  • Scheduling: node-cron for periodic tasks
  • Notifications: Pushover (optional)

Project Structure

├── 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

Recent Changes (v2.0)

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages