feat: add production Traefik docker-compose, dynamic origin resolution, and next.config

This commit is contained in:
2026-10-22 23:39:17 +06:00
parent 1a73a731a1
commit f56269885a
3 changed files with 80 additions and 14 deletions
+12
View File
@@ -0,0 +1,12 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
};
export default nextConfig;
+28 -2
View File
@@ -17,7 +17,26 @@ import { soundFX } from "@/lib/soundEffects";
export default function TitanQuantTerminalPage() {
const [isUnlocked, setIsUnlocked] = useState(false);
const [authToken, setAuthToken] = useState("");
const [apiBaseUrl, setApiBaseUrl] = useState("http://localhost:8085");
const [apiBaseUrl, setApiBaseUrl] = useState(() => {
if (typeof window !== "undefined") {
if (window.location.hostname === "localhost" && window.location.port === "3000") {
return "http://localhost:8085";
}
return window.location.origin;
}
return process.env.NEXT_PUBLIC_API_URL || "http://localhost:8085";
});
const [wsUrl, setWsUrl] = useState(() => {
if (typeof window !== "undefined") {
if (window.location.hostname === "localhost" && window.location.port === "3000") {
return "ws://localhost:8085/ws/stream";
}
const proto = window.location.protocol === "https:" ? "wss:" : "ws:";
return `${proto}//${window.location.host}/ws/stream`;
}
return process.env.NEXT_PUBLIC_WS_URL || "ws://localhost:8085/ws/stream";
});
const [activeSymbol, setActiveSymbol] = useState("XAUUSD");
const [activeTimeframe, setActiveTimeframe] = useState("15m");
const [candles, setCandles] = useState<any[]>([]);
@@ -31,10 +50,17 @@ export default function TitanQuantTerminalPage() {
const [exnessServer, setExnessServer] = useState("Exness-MT5Real15");
// WebSocket Hook
const { isConnected, packet, ping } = useExnessWebSocket("ws://localhost:8085/ws/stream");
const { isConnected, packet, ping } = useExnessWebSocket(wsUrl);
// Check Existing Session & Auto-Lock on Inactivity
useEffect(() => {
if (typeof window !== "undefined") {
if (window.location.hostname !== "localhost") {
setApiBaseUrl(window.location.origin);
const proto = window.location.protocol === "https:" ? "wss:" : "ws:";
setWsUrl(`${proto}//${window.location.host}/ws/stream`);
}
}
const saved = sessionStorage.getItem("aura_trade_token");
if (saved) {
setAuthToken(saved);