尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
A Node.js web application that displays real-time commodity trading data for Star Citizen, sourced from the UEX Corp API. • 📊 Real-time commodity prices from UEX Corp API • 🔄 Auto-refresh data every minute (configurable) • 💰 Profit calculations for all trading routes • 🗺️ System/terminal mapping with location codes • 📱 Touch Portal interface for custom SCU capacities • 🎨 Dark theme optimized for readability • 📝 Comprehensive logging with Winston • 🛡️ Robust error handling with retry logic • ⚡ Production-ready code with tests • Node.js 20+ (tested with v20.19.2) • npm檢視完整 README ↗
A Node.js web application that displays real-time commodity trading data for Star Citizen, sourced from the UEX Corp API.
git clone https://github.com/dodoslavn/StarCitizen_Trading.git
cd StarCitizen_Trading/StarCitizen_Trading
npm install
cp config.json.example config.json
Edit config.json with your settings (see Configuration section)
Start the server:
npm start
The server will be available at http://localhost:3000 (or your configured port).
Edit config.json to customize the application:
{
"http_server": {
"ip_listen": "127.0.0.1",
"port_listen": "3000"
},
"api": {
"base_url": "https://api.uexcorp.space/2.0",
"endpoints": {
"prices_all": "/commodities_prices_all",
"solar_systems_all": "/star_systems",
"terminals_all": "/terminals"
},
"timeout": 10000,
"retries": 3
},
"cache": {
"refresh_interval_minutes": 1
},
"logging": {
"level": "info",
"file": "trading.log",
"console": true
}
}
| Option | Description | Default |
|---|---|---|
http_server.ip_listen | IP address to bind to | 127.0.0.1 |
http_server.port_listen | Port number | 3000 |
api.timeout | API request timeout (ms) | 10000 |
api.retries | Number of retry attempts | 3 |
cache.refresh_interval_minutes | Data refresh frequency | 1 |
cache.stale_after_minutes | Age (minutes) after which a terminal's price data is grayed out as outdated | 1440 |
cache.very_stale_after_minutes | Age (minutes) after which a terminal's price data is grayed out further as very outdated | 4320 |
logging.level | Log level (error/warn/info/debug) | info |
logging.file | Log file path | trading.log |
logging.console | Enable console logging | true |
Navigate to http://localhost:3000 to see:
/): All commodities with buy/sell prices and profit calculations/about): Information about the website/touchportal/[scu]/[system]): Optimized for specific cargo capacities/refresh): Manually trigger data refresh| Endpoint | Description |
|---|---|
/ | Main trading data page |
/about | About page |
/default.css | Stylesheet |
/favicon.ico | Favicon |
/refresh | Trigger manual data refresh |
/touchportal/[scu] | Touch portal for specific SCU |
/touchportal/[scu]/[system] | Touch portal filtered by system |
npm test
npm run lint # Check for issues
npm run lint:fix # Auto-fix issues
npm run dev
The commodity table shows an estimated (or, once scanned, confirmed) max SCU capacity per terminal. Confirmed values come from a separate one-shot script that scans UEX's price history:
npm run scan-inventory
It writes max_inventory.json, which the server reads on startup. This is
run daily by the Scan max inventory GitHub Action (see
.github/workflows/scan-max-inventory.yml), which commits the updated file
back to master and thereby triggers a redeploy. The script always does a
full pass (~2-3 minutes) and exits non-zero if too many per-pair fetches
fail during the run, so an incomplete file never gets committed.
StarCitizen_Trading/
├── server.js # Main server entry point
├── scan-max-inventory.js # Standalone max-inventory history scan (see above)
├── config.js # Shared config.json loader
├── functions.js # Core business logic and HTTP handlers
├── html.js # HTML generation and rendering
├── dataCache.js # Data caching management
├── logger.js # Winston logger configuration
├── favicon.js # Base64 encoded favicon
├── config.json # Configuration (create from .example)
├── config.json.example # Example configuration
├── max_inventory.json # Output of scan-max-inventory.js
├── package.json # Dependencies and scripts
├── .eslintrc.json # ESLint configuration
└── tests/ # Unit tests
├── dataCache.test.js
└── html.test.js
Manages in-memory caching of:
Core business logic:
Rendering engine for:
This version includes major refactoring and production-ready improvements:
All trading data is sourced from the UEX Corp API, a community-driven Star Citizen resource.
See LICENSE for details.