diff --git a/docker-compose.yml b/docker-compose.yml index 1f5f4de..5df9497 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,9 +6,7 @@ services: context: ./backend dockerfile: Dockerfile container_name: aura-quant-backend - restart: unless-stopped - ports: - - "8085:8085" + restart: always environment: - ENVIRONMENT=production - PORT=8085 @@ -17,22 +15,37 @@ services: - MAX_DAILY_DRAWDOWN_PERCENT=2.5 - MAX_SPREAD_PIPS=25.0 - MIN_CONFLUENCE_SCORE=85 - - EXNESS_ACCOUNT_ID=${EXNESS_ACCOUNT_ID:-0} + - EXNESS_ACCOUNT_ID=${EXNESS_ACCOUNT_ID:-425437997} - EXNESS_PASSWORD=${EXNESS_PASSWORD:-} - - EXNESS_SERVER=${EXNESS_SERVER:-Exness-MT5Trial} + - EXNESS_SERVER=${EXNESS_SERVER:-Exness-MT5Real15} + - ADMIN_PIN=${ADMIN_PIN:-2671} + - ADMIN_TOKEN=${ADMIN_TOKEN:-AuraTrade-Master-Secret-2671$} - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-8622249634:AAFyJk4eaH3txNVIJ36m-48z8ib4mCUJjfg} - TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID:-7107005438} networks: - - aura-network + - coolify + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.gzip.compress=true" + - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + - "traefik.http.routers.http-trade-be.entryPoints=http" + - "traefik.http.routers.http-trade-be.rule=Host(`trade.auraajenticai.cloud`) && (PathPrefix(`/api`) || PathPrefix(`/ws`) || PathPrefix(`/docs`) || PathPrefix(`/openapi.json`))" + - "traefik.http.routers.http-trade-be.priority=100" + - "traefik.http.routers.http-trade-be.middlewares=redirect-to-https" + - "traefik.http.routers.https-trade-be.entryPoints=https" + - "traefik.http.routers.https-trade-be.rule=Host(`trade.auraajenticai.cloud`) && (PathPrefix(`/api`) || PathPrefix(`/ws`) || PathPrefix(`/docs`) || PathPrefix(`/openapi.json`))" + - "traefik.http.routers.https-trade-be.priority=100" + - "traefik.http.routers.https-trade-be.service=https-trade-be" + - "traefik.http.routers.https-trade-be.tls=true" + - "traefik.http.routers.https-trade-be.tls.certresolver=letsencrypt" + - "traefik.http.services.https-trade-be.loadbalancer.server.port=8085" aura-quant-frontend: build: context: ./frontend dockerfile: Dockerfile container_name: aura-quant-frontend - restart: unless-stopped - ports: - - "3000:3000" + restart: always environment: - NODE_ENV=production - NEXT_PUBLIC_API_URL=https://trade.auraajenticai.cloud @@ -40,8 +53,23 @@ services: depends_on: - aura-quant-backend networks: - - aura-network + - coolify + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.gzip.compress=true" + - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + - "traefik.http.routers.http-trade-fe.entryPoints=http" + - "traefik.http.routers.http-trade-fe.rule=Host(`trade.auraajenticai.cloud`)" + - "traefik.http.routers.http-trade-fe.priority=10" + - "traefik.http.routers.http-trade-fe.middlewares=redirect-to-https" + - "traefik.http.routers.https-trade-fe.entryPoints=https" + - "traefik.http.routers.https-trade-fe.rule=Host(`trade.auraajenticai.cloud`)" + - "traefik.http.routers.https-trade-fe.priority=10" + - "traefik.http.routers.https-trade-fe.service=https-trade-fe" + - "traefik.http.routers.https-trade-fe.tls=true" + - "traefik.http.routers.https-trade-fe.tls.certresolver=letsencrypt" + - "traefik.http.services.https-trade-fe.loadbalancer.server.port=3000" networks: - aura-network: - driver: bridge + coolify: + external: true diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs new file mode 100644 index 0000000..4923433 --- /dev/null +++ b/frontend/next.config.mjs @@ -0,0 +1,12 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: false, + typescript: { + ignoreBuildErrors: true, + }, + eslint: { + ignoreDuringBuilds: true, + }, +}; + +export default nextConfig; diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 3012b22..5bac0c9 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -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([]); @@ -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);