freezone/portal/QUICK_START.md
2025-06-30 17:01:40 +02:00

1.9 KiB

Portal Client - Quick Start

🚀 5-Minute Setup

1. Run Setup Script

./setup.sh

2. Start Portal Server

cd ../portal-server
cargo run -- --from-env --verbose

3. Start Portal Client

cd ../portal
source .env && trunk serve

4. Open Browser

http://127.0.0.1:8080

🔧 Manual Setup

Portal Server (.env)

cd ../portal-server
cp .env.example .env
# Edit .env with your keys:
API_KEYS=dev_key_123,test_key_456
STRIPE_SECRET_KEY=sk_test_your_key
STRIPE_PUBLISHABLE_KEY=pk_test_your_key
IDENTIFY_API_KEY=your_identify_key

Portal Client (.env)

cd ../portal
# .env file (already created):
PORTAL_API_KEY=dev_key_123  # Must match server API_KEYS

🐛 Troubleshooting

401 Unauthorized?

  • Check PORTAL_API_KEY matches server API_KEYS
  • Run source .env && trunk serve (not just trunk serve)
  • Verify server is running on port 3001

Portal won't load?

  • Install: cargo install trunk
  • Add target: rustup target add wasm32-unknown-unknown
  • Build first: trunk build

Environment variables not working?

  • Use: source .env && trunk serve
  • Or: PORTAL_API_KEY=dev_key_123 trunk serve
  • Or edit index.html directly with your API key

📞 Test API Connection

# Test server is working
curl -X GET http://127.0.0.1:3001/api/health \
  -H "x-api-key: dev_key_123"

# Should return: {"status":"ok"}

🔄 Development Workflow

  1. Terminal 1: cd ../portal-server && cargo run -- --from-env --verbose
  2. Terminal 2: cd ../portal && source .env && trunk serve
  3. Browser: http://127.0.0.1:8080

📚 More Help