A full-stack travel planner built with React, Spring Boot, PostgreSQL, and direct LLM integration.
- Frontend: React + Vite + Tailwind CSS
- Backend: Spring Boot REST API + Spring Security JWT + JPA + direct Gemini calls
- Database: PostgreSQL
Flow:
- User logs in/registers in frontend.
- Frontend calls backend APIs.
- Backend calls Gemini directly to generate itinerary.
- Backend stores trip and returns itinerary.
- User can view history and regenerate trips.
frontend/backend/database/schema.sql
- Java 21+
- Maven 3.9+
- Node.js 18+
- PostgreSQL 14+
Create DB:
CREATE DATABASE travel_planner;Set DB and JWT values via environment variables before starting backend.
Use backend/.env.example as the template for your local .env file.
PowerShell:
$env:DB_URL="jdbc:postgresql://localhost:5432/travel_planner"
$env:DB_USERNAME="postgres"
$env:DB_PASSWORD="<your_db_password>"
$env:JWT_SECRET="<base64_256bit_secret>"Never commit real secrets to git. Keep keys only in local environment variables or your deployment secret manager.
Set Gemini key and model before running backend.
Gemini (PowerShell):
$env:GEMINI_API_KEY="<your_gemini_api_key>"
$env:GEMINI_MODEL="gemini-1.5-flash"cd backend
mvn spring-boot:runRuns on http://localhost:8080.
cd frontend
npm install
npm run devRuns on http://localhost:5173.
Auth:
POST /api/auth/registerPOST /api/auth/login
Travel:
POST /api/travel/planGET /api/travel/historyPUT /api/travel/update
- Passwords are stored using BCrypt.
- Backend auth uses JWT bearer tokens.
- Itinerary generation is fully backend-driven with real LLM API calls.