3.8 KiB
3.8 KiB
Quick Start Guide - Gold Trading Simulator
Get up and running in 5 minutes!
Prerequisites Checklist
- Node.js 18+ installed (
node --version) - Python 3.11+ installed (
python --version) - Docker installed (
docker --version) - Alpha Vantage API key (get free at https://www.alphavantage.co/support/#api-key)
- OpenRouter API key (get at https://openrouter.ai/)
5-Minute Setup
1. Start Database (1 minute)
cd gold-trading-simulator
docker-compose up -d
Wait for PostgreSQL to start:
docker logs gold_trading_db
# Should see: "database system is ready to accept connections"
2. Setup Backend (2 minutes)
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
nano .env # or use your preferred editor
Edit .env and add your API keys:
ALPHA_VANTAGE_API_KEY=your_actual_key_here
OPENROUTER_API_KEY=your_actual_key_here
Initialize database:
python ../database/init_db.py
3. Setup Frontend (1 minute)
cd ../frontend
# Install dependencies
npm install
# Environment already configured in .env.example
# No changes needed unless you changed backend port
4. Start Application (1 minute)
Terminal 1 - Backend:
cd backend
source venv/bin/activate
python -m app.main
You should see:
INFO: Uvicorn running on http://0.0.0.0:8000
Terminal 2 - Frontend:
cd frontend
npm run dev
You should see:
VITE v5.x.x ready in XXX ms
➜ Local: http://localhost:3000/
5. Open Browser
Navigate to: http://localhost:3000
You should see the Gold Trading Simulator dashboard!
First Steps in the App
- Wait for data to load - The chart will populate with gold price history
- Explore the chart - Hover over candles to see price details
- Execute a trade:
- Enter quantity (e.g., 10 oz)
- Click "Buy" button
- See position appear in portfolio
- Try AI analysis:
- Click "AI Analysis" button
- Wait ~5-10 seconds
- Review recommendation
Troubleshooting
"Error loading market data"
- Check: Alpha Vantage API key in
backend/.env - Verify: Backend is running on port 8000
- Test:
curl http://localhost:8000/health
"Backend connection failed"
- Check: Backend terminal for errors
- Verify: No other service using port 8000
- Test:
curl http://localhost:8000/api/market/gold/current
"AI analysis failed"
- Check: OpenRouter API key in
backend/.env - Verify: You have credits at https://openrouter.ai/
- Check: Backend logs for detailed error
Database connection error
- Check: Docker container is running:
docker ps - Restart:
docker-compose restart - Logs:
docker logs gold_trading_db
API Key Setup Details
Alpha Vantage (Free Tier)
- Visit: https://www.alphavantage.co/support/#api-key
- Enter your email
- Get instant API key
- Limits: 500 calls/day, 5 calls/minute
- Cost: Free forever
OpenRouter
- Visit: https://openrouter.ai/
- Sign up with GitHub/Google
- Go to Keys section
- Create new key
- Add credits ($5 minimum)
- Cost: ~$0.01-0.05 per AI analysis
Next Steps
- Read README.md for full documentation
- Explore different trading strategies
- Check out the API endpoints
- Plan Phase 2 features (multiple timeframes, more indicators)
Getting Help
If you run into issues:
- Check the Troubleshooting section above
- Review backend logs in the terminal
- Check browser console for frontend errors (F12)
- Verify all environment variables are set correctly
Happy Trading! (Virtually, of course!)