This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.
Entrack supports Google signup/login through the backend OAuth flow:
- Frontend redirects to
GET /api/auth/google. - Google redirects back to
GET /api/auth/google/callback. - Backend creates a short-lived one-time login code.
- Frontend
/auth/oauth-callbackexchanges that code withPOST /api/auth/oauth/exchange. - Backend issues the normal Entrack access token and refresh cookie.
Required backend environment:
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=http://localhost:5000/api/auth/google/callback
FRONTEND_URL=http://localhost:5173Production example:
GOOGLE_CALLBACK_URL=https://api.entrack.in/api/auth/google/callback
FRONTEND_URL=https://entrack.in
ALLOWED_ORIGINS=https://www.entrack.in,https://entrack.in
COOKIE_SECURE=true
COOKIE_SAMESITE=noneFrontend environment:
VITE_API_URL=http://localhost:5000Google Cloud Console values:
Authorized JavaScript origins:
http://localhost:5173
https://entrack.in
https://www.entrack.in
Authorized redirect URIs:
http://localhost:5000/api/auth/google/callback
https://api.entrack.in/api/auth/google/callback
Run backend migrations before using Google login:
cd backend
npm run migrateThe VPS agent creates every user MT5 instance from a prepared MT5 template. The template is a ready MT5 environment with broker server discovery data already initialized. It is not a saved user account, and it must not contain any real user's login session.
Required agent environment:
MT5_TEMPLATE_DIR=/home/ubuntu/mt5-template
MT5_INSTANCES_DIR=/home/ubuntu/mt5-instancesMT5_TEMPLATE_DIR is preferred. If an older deployment still sets MT5_SOURCE_DIR, the agent can use it as a fallback template path, but new deployments should use MT5_TEMPLATE_DIR.
To prepare /home/ubuntu/mt5-template:
- On the VPS, create/open a dedicated Wine prefix or MT5 folder for the template.
- Install/open MT5 once manually in that template environment.
- Let MT5 initialize fully.
- Open the server login/search window.
- Search for broker servers so MT5 downloads/populates broker server discovery data.
- Confirm the server list is not limited to only
MetaQuotes-Demo. - Do not login with any real user account in the template.
- Close MT5 cleanly.
- Save this prepared folder as
/home/ubuntu/mt5-template. - Set
MT5_TEMPLATE_DIRandMT5_INSTANCES_DIRin the VPS agent environment. - Restart the VPS agent.
Supported template layouts:
/home/ubuntu/mt5-template/terminal64.exe/home/ubuntu/mt5-template/mt5/terminal64.exewith optional/home/ubuntu/mt5-template/wine/home/ubuntu/mt5-template/drive_c/Program Files/MetaTrader 5/terminal64.exeas a full Wine prefix
For each job, the agent copies the template into a unique folder under MT5_INSTANCES_DIR, applies that job's login config and EA files, launches the copied terminal64.exe, and only completes the job after verified_running=true process verification succeeds.
Test one job:
- Start with a prepared
MT5_TEMPLATE_DIR. - Submit one MT5 connection job with login ID, password, and broker server.
- Confirm a unique copied instance exists under
/home/ubuntu/mt5-instances. - Confirm logs show the template path and destination path, but no password.
- Confirm
terminal64.exelaunched from the copied instance path, not the template path. - Confirm the backend job completes only after the running process is verified.
If the copied MT5 still shows only MetaQuotes-Demo, check the VPS agent logs for:
MT5 template appears fresh/uninitializedfound MT5 prepared data candidatetemplate=... destination=...terminal64.exe missing in copied MT5 instance
Then reopen the template manually, search for broker servers again, confirm the server list is populated, close MT5 cleanly, and restart the agent.