Files
rmtPocketWatcher/README.md
2025-12-03 18:00:10 -05:00

162 lines
3.7 KiB
Markdown

# rmtPocketWatcher
A cross-platform desktop application that tracks real-money trading (RMT) prices for Star Citizen AUEC. Provides a Bloomberg-style terminal interface displaying real-time AUEC price data from multiple vendors.
Developed by Lambda Banking Conglomerate - A Star Citizen Organization
## Features
- 🔄 Automated scraping from Eldorado and PlayerAuctions every 5 minutes
- 📊 Track all seller listings with historical data
- 💰 Real-time lowest price tracking across all vendors
- 📈 Historical price charts by seller, platform, or overall lowest
- 🔔 Client-side price alerts with native notifications
- 🌐 REST API + WebSocket for real-time updates
- 🗄️ PostgreSQL + Prisma for reliable data storage
## Quick Start
### Using Docker Compose (Recommended)
```bash
# Clone the repository
git clone <repository-url>
cd rmtPocketWatcher
# Start everything
docker-compose up -d
# View logs
docker-compose logs -f backend
# Access the API
curl http://localhost:3000/health
```
The backend will be available at `http://localhost:3000`
### Local Development
```bash
# Start database only
docker-compose up -d postgres
# Setup backend
cd backend
npm install
npm run db:generate
npm run db:push
npx playwright install chromium
# Run development server
npm run dev
# Or test scraper manually
npm run scrape
```
## Project Structure
```
rmtPocketWatcher/
├── backend/ # TypeScript backend server
│ ├── src/
│ │ ├── scrapers/ # Playwright scraping modules
│ │ ├── api/ # Fastify REST + WebSocket API
│ │ ├── database/ # Prisma client and repository
│ │ └── index.ts # Main server entry point
│ ├── prisma/ # Database schema and migrations
│ └── Dockerfile
├── electron-app/ # Electron desktop app (coming soon)
├── docker-compose.yml # Docker orchestration
└── README.md
```
## API Endpoints
### Prices
- `GET /api/prices/latest` - Get all current listings
- `GET /api/prices/lowest` - Get current lowest price
- `GET /api/prices/by-seller?seller=&platform=` - Filter by seller
- `GET /api/prices/by-platform?platform=` - Filter by platform
- `GET /api/prices/history?from=&to=&seller=&platform=` - Historical data
### Index
- `GET /api/index/history?range=7d|30d|90d|all` - Lowest price over time
- `GET /api/index/ws` - WebSocket for real-time updates
### Health
- `GET /health` - Server health check
## Configuration
Edit `.env` or set environment variables:
```env
DATABASE_URL=postgresql://rmtpw:rmtpw_password@localhost:5432/rmtpocketwatcher
PORT=3000
SCRAPE_INTERVAL_MINUTES=5
SCRAPER_HEADLESS=true
NODE_ENV=production
```
## Technology Stack
**Backend:**
- TypeScript + Node.js
- Fastify (REST API + WebSocket)
- Playwright (web scraping)
- PostgreSQL + Prisma ORM
- Node Scheduler (cron jobs)
**Frontend (Coming Soon):**
- Electron 30+
- React + TypeScript
- TailwindCSS
- Recharts/ECharts
## Development
```bash
# Run tests
npm test
# Lint and type check
npx tsc --noEmit
# Database management
npm run db:studio # Open Prisma Studio
npm run db:push # Push schema changes
npm run db:migrate # Create migration
# Manual scrape test
npm run scrape
```
## Docker Commands
```bash
# Build and start
docker-compose up --build
# Stop services
docker-compose down
# View logs
docker-compose logs -f backend
# Restart backend only
docker-compose restart backend
# Remove everything including volumes
docker-compose down -v
```
## License
MIT
## Disclaimer
This application is for informational and tracking purposes only. It does not facilitate any real-money trading transactions. Users are responsible for complying with all applicable laws and game terms of service.