A high-performance TypeScript-based ticket availability monitoring system that tracks ticket sales in real-time and sends instant notifications when tickets become available. Built with Bun runtime for optimal performance and modern web technologies for a beautiful user experience.
- Overview
- Features
- Installation
- Quick Start
- Usage
- API Reference
- Project Structure
- Architecture
- Configuration
- Development
- Troubleshooting
- Requirements
- License
- Author
Frontrow is a sophisticated ticket monitoring system designed to help users never miss ticket sales. It continuously monitors ticket availability from ticket vendors (currently supporting Biletix) and provides instant notifications when tickets change status from "Soon" to "On Sale". Additionally, it supports Queue-it tracking to monitor queue positions and wait times for high-demand events.
- ⚡ Lightning Fast: Built on Bun runtime for exceptional performance
- 🎨 Modern UI: Beautiful web interface with Shoelace design system
- 🛡️ Rate Limit Safe: Intelligent request throttling to prevent IP bans
- 🔔 Multi-Channel Notifications: System notifications and browser alerts
- 📊 Real-Time Statistics: Live performance tracking and status monitoring
- 🎟️ Queue Tracking: Monitor Queue-it queue positions and wait times
- 🔥 Hot Reload: Development mode with automatic file watching
- 📦 Version Tracking: Automatic version generation from git commits
- 🎫 Real-Time Monitoring: Continuously monitors ticket availability every 1.5 minutes (with ±15% randomization to avoid detection)
- 🔔 Smart Notifications: Instant alerts when tickets change from "Soon" to "On Sale" status
- 📊 Status Tracking: Comprehensive tracking of all performance status changes with detailed statistics
- 🖥️ System Notifications: Native macOS system notifications for ticket availability alerts
- 🌐 Browser Notifications: Web-based notifications for users accessing the web UI
- 🎟️ Queue-it Tracking: Monitor Queue-it queue positions, wait times, and queue status for high-demand events
- 🛡️ Intelligent Rate Limiting: Prevents IP bans with multiple protection mechanisms:
- Randomized delays between requests (2-5 seconds)
- Randomized check intervals (±15% variance)
- Automatic retry with exponential backoff
- Rate limit detection and handling (429 status codes)
- Increased check interval (1.5 minutes instead of 1 minute)
- Connection monitoring and timeout handling
- 🎨 Beautiful Modern UI:
- Built with Shoelace web components
- Responsive design that works on all devices
- Colored console output for better readability
- Real-time status updates
- Performance statistics dashboard
- 🔥 Hot Module Reload: Development mode with automatic file watching and reload
- 📦 Version Tracking: Automatic version generation from git commits
- 🔧 TypeScript: Full type safety with strict TypeScript configuration
- 📝 Well-Documented: Comprehensive code documentation and comments
- Bun >= 1.0.0 (Install Bun)
- Node.js >= 18.0.0 (for compatibility, though Bun is the primary runtime)
- Git (for version tracking)
-
Clone the repository
git clone <repository-url> cd frontrow
-
Install dependencies
bun install
Bun will automatically install all dependencies listed in
package.json. -
Install git hooks (optional but recommended)
bun run install-hooks
This installs the pre-push hook that automatically updates the version based on commit messages.
-
Verify installation
bun --version
Before running the application, you need to set up your API cookie:
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand add your Biletix API cookie (see Environment Variables section for instructions on how to get it)
# Start monitoring with default event ID (will prompt)
bun start
# Or specify an event ID directly
bun start 5HT02# Production mode
bun run ui
# Development mode with hot reload
bun run devThen open your browser and navigate to http://localhost:3000
Console mode provides a lightweight, terminal-based interface perfect for running in the background or on servers.
# Interactive mode (prompts for event ID)
bun start
# With event ID argument
bun start <event-id>bun start 5HT02Console Output Features:
- 🎨 Colored status indicators
- 📊 Real-time status updates
- 🔔 Notification alerts
- ⏱️ Time until next check
- 📈 Performance statistics
Press Ctrl+C to stop the monitoring process gracefully.
The web UI provides a full-featured dashboard for monitoring ticket availability.
Production Mode:
bun run uiDevelopment Mode (with hot reload):
bun run dev- Start the server using one of the commands above
- Open your browser
- Navigate to
http://localhost:3000
- 📊 Real-Time Dashboard: Live updates every 1.5 minutes
- 🎨 Modern Design: Beautiful interface built with Shoelace components
- 🔔 Browser Notifications: Desktop notifications when tickets go on sale
- 🎟️ Queue Tracking: Monitor Queue-it queue positions and wait times
- 📱 Responsive: Works perfectly on desktop, tablet, and mobile devices
- ⚡ Fast: Optimized for performance with minimal latency
- 🔄 Auto-Refresh: Automatic page updates without manual refresh
- Enter an Event ID in the input field
- Click "Start Monitoring" or press Enter
- The dashboard will display:
- Current ticket status
- Performance statistics
- Last check timestamp
- Next check countdown
- Status history
The web UI includes Queue-it tracking functionality to monitor queue positions for high-demand events:
- Configure Queue-it settings in your
.envfile (see Environment Variables) - Start the web UI server
- Use the "Queue Status" panel in the web interface
- Click "Start" to begin monitoring queue position and wait times
- The dashboard displays:
- Current queue position
- Estimated wait time
- Queue status updates
- Event start time
You can configure the application using environment variables:
| Variable | Description | Default | Required | Example |
|---|---|---|---|---|
API_COOKIE |
Biletix API cookie for authentication | - | Yes | See setup instructions below |
PORT |
Server port for web UI mode | 3000 |
No | PORT=8080 bun run ui |
NODE_ENV |
Environment mode | development |
No | NODE_ENV=production bun run ui |
QUEUE_CUSTOMER_ID |
Queue-it customer ID | - | No* | tmturkiye |
QUEUE_EVENT_ID |
Queue-it event ID | - | No* | tarkansubat |
QUEUE_ID |
Queue-it queue UUID | - | No* | af46d858-995c-4be3-8bd0-76ac18d439c8 |
QUEUE_SESSION_ID |
Queue-it session ID (seid) | - | No* | See setup instructions |
QUEUE_SETS |
Queue-it sets parameter | - | No* | See setup instructions |
QUEUE_COOKIES |
Queue-it cookies (semicolon-separated) | - | No* | See setup instructions |
QUEUE_TARGET_URL |
Target URL for queue redirect | - | No* | https://www.biletix.com/etkinlik/5HT02/TURKIYE/tr |
QUEUE_LAYOUT_NAME |
Queue layout name | - | No* | Black Tarkan |
QUEUE_LAYOUT_VERSION |
Queue layout version | 0 |
No* | 178704974934 |
* Required only if using Queue-it tracking functionality
The API_COOKIE environment variable is required for the application to work. This cookie authenticates requests to the Biletix API.
To get your API cookie:
- Open https://www.biletix.com in your browser
- Open Developer Tools (F12 or right-click → Inspect)
- Go to the Network tab
- Navigate to an event page or make a request that calls the API
- Find a request to
wbtxapi/api/v1/bxcached/event/getPerformanceList/... - Click on the request and go to Headers
- Copy the value of the
Cookieheader - Paste it into your
.envfile (see below)
Using .env file (Recommended):
-
Copy the example file:
cp .env.example .env
-
Edit
.envand add your cookie:API_COOKIE=BXID=...; SESSIONID=...; QueueITAccepted-...
Note: The .env file is gitignored and will not be committed to version control. Never commit your actual cookie value to the repository.
Unix/Linux/macOS:
PORT=8080 bun run uiWindows (PowerShell):
$env:PORT=8080; bun run uiUsing .env file:
Create a .env file in the project root:
API_COOKIE=your-cookie-value-here
PORT=8080
NODE_ENV=productionQueue-it tracking is optional and only needed if you want to monitor queue positions for events that use Queue-it.
To get your Queue-it configuration:
- Open the Queue-it page in your browser (e.g.,
https://tmturkiye.queue-it.net/...) - Open Developer Tools (F12 or right-click → Inspect)
- Go to the Network tab
- Look for requests to
/spa-api/queue/.../status - Copy the values from the request URL and headers:
- Queue ID: Found in the URL path (UUID format, e.g.,
af46d858-995c-4be3-8bd0-76ac18d439c8) - Customer ID: Found in the domain (e.g.,
tmturkiye) - Event ID: Found in the URL path (e.g.,
tarkansubat) - Session ID (seid): Found in the query parameters
- Sets: Found in the query parameters
- Cookies: Copy the
Cookieheader from the request
- Queue ID: Found in the URL path (UUID format, e.g.,
Add to .env file:
QUEUE_CUSTOMER_ID=tmturkiye
QUEUE_EVENT_ID=tarkansubat
QUEUE_ID=af46d858-995c-4be3-8bd0-76ac18d439c8
QUEUE_SESSION_ID=your-session-id-here
QUEUE_SETS=your-sets-value-here
QUEUE_COOKIES=Queue-it-tmturkiye___________tarkansubat=Qid=...&Cid=...; Queue-it-cc3c3169-121e-4c44-9258-7c2d0ca712e3=...
QUEUE_TARGET_URL=https://www.biletix.com/etkinlik/5HT02/TURKIYE/tr
QUEUE_LAYOUT_NAME=Black Tarkan
QUEUE_LAYOUT_VERSION=178704974934Note: Session ID, Sets, and Cookies values change frequently and may expire. You may need to update them periodically. The server will warn you if these values need to be refreshed.
When running in web UI mode, the following REST API endpoints are available:
GET /api/healthReturns the server health status.
Response:
{
"status": "ok",
"timestamp": 1706123456789
}GET /api/versionReturns version information including git commit details.
Response:
{
"version": "1.3.0",
"commitShort": "a1b2c3d",
"commitFull": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
"commitCount": 42,
"branch": "main",
"buildTime": "2026-01-25T12:34:56.789Z"
}GET /api/check/<event-id>Checks the ticket status for a specific event.
Parameters:
event-id(path parameter): The event ID to check (e.g.,5HT02)
Response:
{
"data": [
{
"performanceId": "12345",
"performanceCode": "004",
"performanceName": "Performance Name",
"performanceDate": "2026-02-15T20:00:00Z",
"status": "s01_onsale",
"eventName": "Event Name",
"venueCity": "Istanbul",
"venueName": "Venue Name"
}
]
}Error Response:
{
"error": "Error message here"
}Status Codes:
200 OK: Successful request400 Bad Request: Invalid event ID404 Not Found: Event not found429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server error
GET /api/queue/configReturns the Queue-it configuration from environment variables (without sensitive cookies).
Response:
{
"customerId": "tmturkiye",
"eventId": "tarkansubat",
"queueId": "af46d858-995c-4be3-8bd0-76ac18d439c8",
"sessionId": "session-id-here",
"sets": "sets-value-here",
"targetUrl": "https://www.biletix.com/etkinlik/5HT02/TURKIYE/tr",
"layoutName": "Black Tarkan",
"layoutVersion": 178704974934,
"cid": "tr-TR",
"hasCookies": true
}POST /api/queue/statusChecks the Queue-it queue status for a specific event. This endpoint acts as a proxy to the Queue-it API.
Request Body:
{
"queueId": "af46d858-995c-4be3-8bd0-76ac18d439c8",
"customerId": "tmturkiye",
"eventId": "tarkansubat",
"cid": "tr-TR",
"layoutName": "Black Tarkan",
"sessionId": "session-id-here",
"sets": "sets-value-here",
"targetUrl": "https://www.biletix.com/etkinlik/5HT02/TURKIYE/tr",
"customUrlParams": "",
"layoutVersion": 178704974934,
"isClientRedayToRedirect": null,
"isBeforeOrIdle": true,
"cookies": {
"Queue-it-tmturkiye___________tarkansubat": "Qid=...&Cid=...",
"Queue-it-cc3c3169-121e-4c44-9258-7c2d0ca712e3": "..."
}
}Note: All fields are optional if configured via environment variables. The server will use environment variable values as defaults.
Response:
{
"redirectUrl": "https://www.biletix.com/...",
"queueId": "af46d858-995c-4be3-8bd0-76ac18d439c8",
"eventStartTimeUTC": "2026-02-15T20:00:00Z",
"queueNumber": 1234,
"queueNumberText": "You are number 1234 in the queue",
"estimatedWaitTimeSeconds": 300,
"estimatedWaitTimeMinutes": 5
}Error Response:
{
"error": "Queue ID, Customer ID, and Event ID are required",
"status": 400
}Status Codes:
200 OK: Successful request400 Bad Request: Missing required parameters500 Internal Server Error: Queue API error or server error
frontrow/
├── src/ # Source code
│ ├── config/ # Configuration constants
│ │ └── constants.ts # API URLs, headers, status texts, intervals
│ ├── types/ # TypeScript type definitions
│ │ └── index.ts # Performance, ApiResponse, PerformanceStatus types
│ ├── utils/ # Utility functions
│ │ ├── colors.ts # ANSI color codes for terminal output
│ │ ├── status.ts # Status text mapping and badge formatting
│ │ ├── performance.ts # Performance-related helper functions
│ │ ├── date.ts # Date formatting utilities
│ │ ├── rateLimiter.ts # Rate limiting to prevent IP bans
│ │ ├── retry.ts # Retry logic with exponential backoff
│ │ ├── version.ts # Version information utilities
│ │ ├── cache.ts # Caching utilities
│ │ └── connection.ts # Connection monitoring utilities
│ ├── services/ # Business logic services
│ │ ├── api.ts # API fetching logic
│ │ └── crawler.ts # Main crawler service with status tracking
│ ├── ui/ # User interface components
│ │ ├── console.ts # Console output formatting
│ │ └── notifications.ts # System notifications
│ ├── index.ts # Application entry point (console mode)
│ └── server.ts # Web server for UI mode
├── public/ # Web UI assets
│ ├── index.html # Main HTML file with Shoelace components
│ ├── app.ts # Client-side TypeScript
│ └── favicon.svg # Favicon
├── scripts/ # Build and utility scripts
│ └── generate-version.ts # Version generation script
├── .githooks/ # Git hooks
│ └── pre-push # Pre-push hook for version updates
├── .gitignore # Git ignore rules
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── bun.d.ts # Bun type definitions
├── LICENSE # MIT License
└── README.md # This file
src/config/: Centralized configuration constants including API endpoints, headers, status mappings, and timing intervalssrc/types/: TypeScript type definitions ensuring type safety across the applicationsrc/utils/: Reusable utility functions for common operations (colors, dates, rate limiting, etc.)src/services/: Core business logic including API communication and crawler orchestrationsrc/ui/: User interface components for both console and web interfacespublic/: Static web assets served by the web serverscripts/: Build and maintenance scripts
The project follows a clean architecture pattern with clear separation of concerns:
- Types: Centralized type definitions for type safety across the entire application
- Config: All configuration constants in one place for easy maintenance
- Utils: Reusable utility functions that can be used across different modules
- Services: Business logic separated from UI concerns
- UI: Presentation layer for both console and web interfaces
The main service class that orchestrates the crawling process:
- Manages ticket status checking
- Handles status change detection
- Coordinates notifications
- Tracks performance statistics
Tracks performance status changes over time:
- Records status transitions
- Calculates statistics
- Provides historical data
Intelligent request throttling system:
- Randomizes delays between requests
- Prevents IP bans
- Handles rate limit responses
- Implements exponential backoff
Handles transient failures:
- Exponential backoff strategy
- Configurable retry attempts
- Jitter to prevent thundering herd
- Status code-based retry decisions
-
Console Mode:
User Input → FrontrowCrawler → API Service → Rate Limiter → API API Response → Status Tracker → Notification Service → Console Output -
Web UI Mode:
Browser → Web Server → API Endpoint → API Service → Rate Limiter → API API Response → Status Tracker → JSON Response → Browser → UI Update
All timing configurations are defined in src/config/constants.ts:
- Check Interval: 90 seconds (1.5 minutes) with ±15% randomization
- Rate Limiter Delays: 2-5 seconds between requests
- Retry Delays: Initial 2 seconds, max 2 minutes with exponential backoff
- Cache TTL: 60 seconds
The application recognizes the following ticket status codes:
| Status Code | Description |
|---|---|
s01_onsale |
On Sale |
s02_soldout |
Sold Out |
s03_soon |
Soon |
s04_canceled |
Canceled |
s05_postponed |
Postponed |
s06_boxoffice |
Box Office Only |
s12_checkbacklater |
Check Back Later |
s13_old_over |
Past Date |
s14_other_channels |
Other Channels |
s15_other_channel_list_with_boxoffice |
Other Purchase |
s16_rescheduled |
Rescheduled |
s17_venue_changed |
Venue Changed |
- Base URL:
https://www.biletix.com - API Endpoint Pattern:
/wbtxapi/api/v1/bxcached/event/getPerformanceList/{eventId}/INTERNET/tr - Channel:
INTERNET - Language:
tr(Turkish) - Country:
TURKIYE
-
Clone and install:
git clone <repository-url> cd frontrow bun install
-
Start development server:
bun run dev
-
Make changes: Edit files in
src/orpublic/ -
See changes: The server automatically reloads on file changes
| Script | Description |
|---|---|
bun start |
Run console mode (with automatic version generation) |
bun run ui |
Run web UI mode in production (with automatic version generation) |
bun run dev |
Run web UI in development mode with hot reload |
bun run version |
Generate version.json from git commits |
bun run install-hooks |
Install git hooks for automatic version updates |
The project uses automatic version generation based on git commits. The version is generated before starting the application and includes:
- Version Number: From
package.json - Git Commit Hash: Short (7 chars) and full (40 chars)
- Commit Count: Total number of commits
- Branch Name: Current git branch
- Build Timestamp: When the version was generated
The version information is available via:
- Console output when starting the application
/api/versionendpoint in web UI modeversion.jsonfile (generated automatically)
The project includes a pre-push hook that automatically updates the version based on commit messages:
- Installation:
bun run install-hooks - Location:
.githooks/pre-push - Function: Runs version generation script before pushing
- TypeScript: Strict mode enabled with comprehensive type checking
- Formatting: Follow TypeScript best practices
- Linting: Use TypeScript compiler for type checking
- Documentation: JSDoc comments for public APIs
The project uses strict TypeScript configuration:
strict: true- Enables all strict type checking optionsnoUncheckedIndexedAccess: true- Prevents unsafe index accessnoImplicitReturns: true- Ensures all code paths return a valuenoUnusedLocals: true- Prevents unused local variablesexactOptionalPropertyTypes: true- Strict optional property types
Problem: Error: Port 3000 is already in use
Solution:
# Use a different port
PORT=8080 bun run ui
# Or find and kill the process using port 3000
lsof -ti:3000 | xargs killProblem: bun: command not found
Solution:
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Or use npm/npx
npm install -g bunProblem: Version generation script fails
Solution:
- Ensure you're in a git repository
- Check that git is installed and accessible
- Verify you have at least one commit
Problem: Getting 429 errors or IP banned
Solution:
- The application automatically handles rate limiting
- If issues persist, increase delays in
src/config/constants.ts - Consider using a VPN or proxy
- Reduce check frequency
Problem: System notifications not appearing
Solution:
- macOS: Check System Preferences → Notifications → Terminal/Bun
- Browser: Ensure notification permissions are granted
- Check browser console for errors
Problem: Blank page or errors in browser
Solution:
- Check server logs for errors
- Verify port is correct
- Check browser console for JavaScript errors
- Ensure
public/index.htmlexists - Try clearing browser cache
Problem: Queue status shows errors or doesn't update
Solution:
- Verify Queue-it configuration in
.envfile - Check that
QUEUE_CUSTOMER_ID,QUEUE_EVENT_ID, andQUEUE_IDare set - Ensure
QUEUE_SESSION_IDandQUEUE_SETSare current (they expire frequently) - Verify
QUEUE_COOKIESare valid and not expired - Check server logs for Queue API errors
- Restart the server after updating
.envfile - Note: Session ID, Sets, and Cookies may need to be refreshed periodically
Enable verbose logging by checking console output. The application logs:
- API requests and responses
- Status changes
- Errors and warnings
- Rate limiting events
- Connection issues
If you encounter issues:
- Check the Troubleshooting section
- Review server logs and browser console
- Verify your configuration
- Check that all dependencies are installed
- Ensure you're using the correct Bun version
-
Bun >= 1.0.0
- Primary runtime environment
- Provides fast JavaScript/TypeScript execution
- Installation Guide
-
Node.js >= 18.0.0 (optional, for compatibility)
- Not required if using Bun
- May be needed for some tooling
- Operating System: macOS, Linux, or Windows
- Memory: Minimum 512MB RAM (recommended 1GB+)
- Network: Internet connection for API access
- Disk Space: ~50MB for installation
- Chrome/Edge: Latest 2 versions
- Firefox: Latest 2 versions
- Safari: Latest 2 versions
- Mobile Browsers: iOS Safari, Chrome Mobile
- @shoelace-style/shoelace: ^2.15.1
- Web component library for UI
- Automatically loaded via CDN in web UI
This project is licensed under the MIT License - see the LICENSE file for details.
Erbil Nas
- Email: erbil@erbilnas.com
- GitHub: @erbilnas
Made with ❤️ using TypeScript and Bun