Spaces:
Running
Running
Deploy U2INVEST To Render
This repo is now prepared to run as a single Render web service:
- Flask API
- Built React frontend
- Video assets
- Persistent storage for SQLite, Chroma, and model cache
What Is Already Prepared
Dockerfilebuilds the React frontend and serves the full app with Flask + Gunicorn.render.yamldefines a Render web service with a persistent disk and health check.- Runtime paths are configurable through environment variables.
- The knowledge base retriever now initializes lazily so the app starts faster.
What You Need To Do
- Push the latest repo state to GitHub.
- Create a Render account and connect your GitHub account.
- In Render, create a new Blueprint or Web Service from this repository.
- If you use the Blueprint flow, Render will read
render.yamlautomatically. - When prompted for secrets, set:
DEEPSEEK_API_KEY- optionally replace
FLASK_SECRET_KEYif you do not want the generated value
- Confirm the persistent disk mount path is
/app/data. - Deploy.
- After deploy finishes, open:
/api/health//app/chat
If Render Asks For A Payment Method
Use render-free.yaml instead of render.yaml.
That free option removes the persistent disk and changes the service to a free instance so you can test the full app without adding a card. See DEPLOY_RENDER_FREE.md for the exact steps.
Recommended First Production Check
Verify these items before changing the agent implementation:
- The home page loads from the Render URL.
GET /api/healthreturns"status": "ok".- The contact page works.
- The Trading Lab loads.
- U2CHAT returns a response when
DEEPSEEK_API_KEYis set.
Local Docker Test
- Copy
.env.exampleto.env. - Fill in
FLASK_SECRET_KEYandDEEPSEEK_API_KEY. - Run:
docker compose up --build
- Open:
http://localhost:5000
http://localhost:5000/api/health
After The Site Is Live
Do this next:
- Add your custom domain in Render.
- Verify DNS and HTTPS.
- Test the app again on the custom domain.
- Only after the current backend is stable, start replacing the current agent with TradingAgents behind the existing
/api/agent/*routes.
TradingAgents Migration Strategy
Keep the public API stable and swap the backend implementation in phases:
- Keep the current frontend unchanged.
- Keep
/api/agent/chat,/api/agent/sessions, and/api/agent/history. - Replace the internals of
agent_graph.pywith a TradingAgents-backed adapter. - Compare latency, token cost, and output quality before fully switching.