FastAPI backend + React frontend for generating personalized travel itineraries using Google Gemini AI.
- Backend: FastAPI, PostgreSQL, Redis (optional), Google Gemini AI
- Frontend: React, TypeScript, Vite, Clerk Auth
- Deployment: Railway (backend), Docker optional
- Python 3.11+
- Node.js 18+
- PostgreSQL (Railway or local)
- Google Gemini API key
# Backend
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload
# Frontend (new terminal)
cd frontend
npm install
npm run devcd backend
docker compose upCreate backend/.env:
DATABASE_URL=postgresql://user:password@host:port/database
GEMINI_API_KEY=your_gemini_api_key
FRONTEND_URL=http://localhost:5173
REDIS_HOST=localhost # optional
REDIS_PORT=6379 # optional- Backend:
http://localhost:8000 - API Docs:
http://localhost:8000/docs - Frontend:
http://localhost:5173
Railway:
- Push to GitHub
- Connect repo to Railway
- Set environment variables in Railway dashboard
- Auto-deploys on push to
main
LocalLink/
├── backend/ # FastAPI app
│ ├── main.py # Entry point
│ ├── database.py # PostgreSQL config
│ ├── cache.py # Redis caching
│ ├── routers/ # API routes
│ ├── models/ # Database models
│ ├── schemas/ # Pydantic schemas
│ ├── ai/ # Gemini integration
│ └── venv/ # Virtual environment
└── frontend/ # React app
└── src/
- ✅ AI-powered itinerary generation
- ✅ User authentication (Clerk)
- ✅ PostgreSQL database
- ✅ Redis caching & rate limiting (optional)
- ✅ Shareable itinerary links
- ✅ Docker support (optional)
- ✅ Railway deployment ready
Backend won't start?
source backend/venv/bin/activate
cd backend && uvicorn main:app --reloadDatabase connection errors?
- Verify
DATABASE_URLin.env - Ensure PostgreSQL is running
Redis not connecting?
- App works without Redis (graceful fallback)
- To enable:
brew install redis && brew services start redis