A full-stack trip planning application that generates personalized itineraries based on your preferences, budget, and accessibility needs.
- Personalized itinerary generation based on budget and preferences
- Accessibility-aware activity recommendations
- Cuisine preferences and food recommendations
- Save and revisit past itineraries
- Secure JWT-based authentication
- Responsive design for mobile and desktop
- Docker (20.10+)
- Docker Compose (2.0+)
# Clone the repository
git clone https://github.com/Its-Tanay/trip-planner.git
cd trip-planner
# Run the automated setup script
./scripts/setup.sh
# Or use Make
make setupThe setup script will:
- Copy environment files
- Generate secure JWT secret
- Build Docker containers
- Start all services (database, backend, frontend)
- Frontend: http://localhost:3001
- Backend API: http://localhost:3000
- Health Check: http://localhost:3000/health
make db-seedThis populates the database with sample cities (Mumbai, Delhi) with activities and food options.
make dev # Start development environment
make stop # Stop all containers
make logs # View container logs
make restart # Restart all containers
make clean # Remove all containers and volumes
make help # Show all available commandsIf you prefer not to use Docker:
- Python 3.12+
- Node.js 18+
- PostgreSQL 15+
# Navigate to server directory
cd server
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment file and configure
cp ../.env.example .env
# Edit .env with your database credentials and JWT secret
# Run the server
python main.pyBackend will run on http://localhost:3000
# Navigate to client directory
cd client
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Start development server
npm startFrontend will run on http://localhost:3001
You have three options for database setup:
docker-compose up db -d# Install PostgreSQL and create database
createdb trip_planner
# Update DATABASE_URL in .env
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/trip_planner- React - UI library
- TypeScript - Type safety
- Tailwind CSS - Styling
- Shadcn UI - Component library
- Tanstack Query - Server state management
- React Router - Client-side routing
- Flask - Web framework
- SQLAlchemy - ORM
- Flask-JWT-Extended - Authentication
- PostgreSQL - Database
- Docker - Containerization
- Docker Compose - Orchestration
trip-planner/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── api/ # API client
│ │ └── lib/ # Utilities
│ ├── Dockerfile
│ └── package.json
├── server/ # Flask backend
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── database/ # Database models
│ │ └── utils/ # Utilities
│ ├── Dockerfile
│ ├── requirements.txt
│ └── main.py
├── docker-compose.yml # Development orchestration
├── Makefile # Common commands
└── scripts/
└── setup.sh # Automated setup
FLASK_ENV=development
FLASK_DEBUG=True
DATABASE_URL=postgresql://postgres:postgres@db:5432/trip_planner
JWT_SECRET_KEY=your-secret-key-hereREACT_APP_BASE_URL_DEV=http://localhost:3000/openssl rand -hex 32POST /api/auth/signup
Content-Type: application/json
{
"email": "user@example.com",
"password": "securepassword",
"name": "John Doe"
}POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "securepassword"
}Response:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"user": { "id": 1, "email": "user@example.com", "name": "John Doe" }
}POST /api/itinerary/generate
Authorization: Bearer <token>
Content-Type: application/json
{
"cityId": 1,
"days": 3,
"budget": "medium",
"accessibility": true,
"cuisinePreferences": ["Italian", "Indian"]
}GET /api/itinerary/user
Authorization: Bearer <token>DELETE /api/itinerary/:id
Authorization: Bearer <token>GET /healthResponse:
{
"status": "healthy",
"service": "trip-planner-api"
}# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/trip-planner.git
cd trip-planner
# Set up development environment
./scripts/setup.sh
# Create a feature branch
git checkout -b feature/amazing-feature
# Make your changes and test
make dev
# Commit your changes
git commit -m "Add amazing feature"
# Push to your fork
git push origin feature/amazing-feature
# Open a Pull RequestThe application follows a client-server architecture with three main components:
- Frontend (React SPA) - Single Page Application with client-side routing
- Backend (Flask API) - RESTful API with JWT authentication
- Database (PostgreSQL) - Relational database for data persistence
The schema includes:
- Users - Authentication and profile
- Cities - Destination information
- Activities - Things to do with ratings, budget, accessibility
- Food - Restaurant/food options with cuisine types
- Itineraries - Saved trip plans
- Categories - Activity categorization
- Cuisines - Food categorization
The itinerary generation algorithm:
- Filters activities and food based on user preferences (budget, accessibility, cuisine)
- Ranks options using a rating system that balances popularity with personalization
- Distributes activities across days to create a balanced itinerary
- Considers meal times and activity types for optimal scheduling
- Relational data structure with many-to-many relationships
- Data consistency is crucial for the algorithm
- Better development experience with SQLAlchemy ORM
- Lightweight and unopinionated for smaller applications
- Flexibility for custom architecture decisions
- No unnecessary overhead from features we don't need
- Structured algorithm on well-modeled data is more efficient
- Predictable, explainable results
- No dependency on expensive ML infrastructure
- Can be enhanced with ML in the future if needed
- Unidirectional data flow (top to bottom)
- Large ecosystem and community support
- Excellent TypeScript integration
- Activity Ranking - Implemented a rating system to balance popular choices with user preferences
- Schema Design - Open-ended requirements required iterative schema refinement
- Deployment - Overcame WSGI deployment issues with Gunicorn configuration
- Data Collection - Manually gathered and structured data from various sources
- Accessibility Support - Algorithm filters based on accessibility requirements
- Extensible Categories - Separate tables for categories and cuisines enable scalability
- Factory Pattern - Backend uses app factory pattern for flexible configuration
- Itinerary Collections - Past itineraries are saved and can be revisited
- Server-Driven UI - Dynamic category interpretations based on geographical location
- Admin Portal - Streamlined data entry interface
- Geocoding Integration - Shortest path sorting between activities with navigation support
- Data Pipelines - Automated data collection and modeling workflows
- ML Enhancement - Personalized recommendations based on user history
- Multi-City Trips - Support for itineraries across multiple cities
- Real-time Updates - Live activity availability and pricing
- GitHub Repository: https://github.com/Its-Tanay/trip-planner
- Report Issues: GitHub Issues
Made by Tanay Tiwari
