chore: initial checkpoint - Tesla Roadtrip planner
- Proactive Grok integration (xAI API + local CLI fallback) - Real road routing via OSRM (no more bird's-eye lines) - Heavy structured logging for fast iteration - Strong sanitization + geocoding + ErrorBoundary (no black screens) - Playwright E2E tests (API diagnostic + full UI flow) - scripts/dev.sh for one-command startup - Clean .env.example + documentation This is a stable checkpoint before further prompt/UI refinement.
This commit is contained in:
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# One-command development script for Tesla Roadtrip
|
||||
# Usage: ./scripts/dev.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting Tesla Roadtrip development environment..."
|
||||
|
||||
# Load .env if it exists
|
||||
if [ -f .env ]; then
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
fi
|
||||
|
||||
# Check for XAI_API_KEY
|
||||
if [ -z "$XAI_API_KEY" ]; then
|
||||
echo ""
|
||||
echo "⚠️ XAI_API_KEY is not set."
|
||||
echo " → Real Grok (via xAI API) will NOT work."
|
||||
echo " → The app will fall back to very basic responses."
|
||||
echo ""
|
||||
echo " To fix this:"
|
||||
echo " 1. Add this line to your .env file:"
|
||||
echo " XAI_API_KEY=xai-YourKeyHere"
|
||||
echo ""
|
||||
echo " 2. Or export it before running:"
|
||||
echo " export XAI_API_KEY=xai-YourKeyHere"
|
||||
echo ""
|
||||
read -p "Continue without real Grok? (y/N) " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "✅ XAI_API_KEY found — real Grok API will be used"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Starting Backend + Frontend..."
|
||||
echo " Backend: http://localhost:3000"
|
||||
echo " Frontend: http://localhost:5173"
|
||||
echo ""
|
||||
|
||||
# Run both with nice colored labels
|
||||
npx concurrently \
|
||||
-n "BACKEND,FRONTEND" \
|
||||
-c "cyan,green" \
|
||||
--kill-others-on-fail \
|
||||
"npm run dev:server" \
|
||||
"npm --prefix client run dev"
|
||||
Reference in New Issue
Block a user