Data Report Form
Relevant source files
The following files were used as context for generating this wiki page:
The Data Report Form is a public-facing web interface provided by TrackerBot to facilitate the reporting of inaccuracies within TarkovTracker datasets, such as quest data, item stats, or maps. It serves as a bridge between end-users and the project's development workflow by automatically converting form submissions into GitHub issues.
This system is part of the webserver.js service, which runs alongside the Discord bot to provide a public bug-intake portal. Reports submitted through this specific form are routed directly to the repository defined in the REPO_DATA_REPORT environment variable.
Sources: README.md:12-16, web/data/index.html:15-20, AGENTS.md:10-12
System Architecture and Data Flow
The Data Report Form utilizes a client-server architecture where a static HTML frontend communicates with an Express.js backend. The backend acts as a proxy, validating and sanitizing the data before using the GitHub REST API to create an issue.
Submission Pipeline
The following diagram illustrates the lifecycle of a data report from user input to GitHub issue creation.
The process begins with the frontend collecting user input and sending a POST request to the /data endpoint. The server performs security checks (rate limiting, origin validation, and honeypot detection) before formatting the data into a GitHub-compatible issue body.
Sources: webserver.js:145-180, web/data/index.html:105-125
Frontend Components
The frontend is a single-page interface located at /data/index.html. It includes logic to pre-fill fields via URL parameters and handles the asynchronous submission to the backend.
Form Fields and Validation
The form requires several specific pieces of information to ensure reports are actionable:
| Field | Element Type | Purpose | Requirements |
|---|---|---|---|
| Title | Input (Text) | Short summary of the issue | Required; Max 200 chars |
| Discord | Input (Text) | User's Discord handle for follow-up | Required; Max 64 chars |
| Category | Select | Impacted area (e.g., Quests, Maps) | Required; Max 64 chars |
| Reference | Input (Text) | Links to sources or screenshots | Optional; Max 500 chars |
| Description | Textarea | Detailed explanation of the error | Required; Max 8000 chars |
| Company | Input (Hidden) | Honeypot field for anti-spam | Must be empty |
Sources: web/data/index.html:31-64, webserver.js:52-57
URL Parameter Integration
The frontend script automatically parses URL search parameters to pre-populate the form. This allows external tools or the main TarkovTracker website to link directly to a specific reporting context (e.g., a specific quest name).
Sources: web/data/index.html:84-100
Backend Implementation
The backend is managed by webserver.js using the Express framework. It implements several layers of security and data handling logic.
Security Middleware
- Rate Limiting: Each IP is limited to 5 submissions per minute to prevent spam.
- Origin Validation: Requests are checked against an
ALLOWED_ORIGINSallowlist defined in environment variables. - Honeypot: A hidden "company" field is used to detect automated bots. If this field is filled, the server returns a fake success response without creating a GitHub issue.
- Sanitized Logging: Error logs specifically strip the Axios error object to prevent accidental leakage of the
GITHUB_TOKEN.
Sources: webserver.js:65-71, webserver.js:86-103, webserver.js:122-124, webserver.js:201-206
Data Sanitization Logic
Before the data is sent to GitHub, the sanitizeReportFields function truncates all strings to their maximum allowed lengths to ensure compatibility with API limits and prevent database bloat.
function sanitizeReportFields({ title, discord, category, description, reference }) {
return {
title: truncate(title, MAX_TITLE),
discord: truncate(discord, MAX_DISCORD),
category: truncate(category, MAX_CATEGORY),
description: truncate(description, MAX_DESCRIPTION),
reference: reference ? truncate(reference, MAX_REFERENCE) : ""
};
}
Sources: webserver.js:126-134
GitHub API Integration
The server uses axios to communicate with the GitHub API. It uses a GITHUB_TOKEN with repository permissions. The issue title is prefixed with the category (e.g., [Overlay - Quests] Quest Name), and the body is constructed as a Markdown-formatted string containing the Discord handle and reference links.
Sources: webserver.js:160-174, webserver.js:45-49
Configuration
The Data Report Form requires specific environment variables to be set in the .env file for the webserver to start successfully.
| Variable | Description |
|---|---|
GITHUB_TOKEN | A PAT with repo or issues:write scope. |
REPO_DATA_REPORT | The GitHub repository (owner/repo) where data issues are sent. |
ALLOWED_ORIGINS | Comma-separated list of domains allowed to submit reports. |
PORT | The port the Express server listens on (default: 3000). |
Sources: webserver.js:19-24, README.md:44-55
Summary
The Data Report Form provides a streamlined, secure method for the community to contribute to TarkovTracker's data accuracy. By combining a user-friendly frontend with a robust Express backend, the system automates the issue-tracking process while protecting the project from spam and unauthorized submissions.