PackPal is a comprehensive travel planning web application that helps travelers create personalized packing checklists with real-time weather data, interactive maps, and travel mode suggestions.
- Multi-Destination Trip Planner: Plan trips with multiple destinations, see routes on an interactive map
- Destination Autocomplete: Real-time destination search with coordinates using OpenStreetMap Nominatim
- Weather & Temperature Overview: Live weather data for all destinations with temperature, humidity, and conditions
- Transport Options Comparison: Compare plane
βοΈ , train π, bus π, and drive π with:- Travel time estimatestion
- Cost approximations
- COβ emissions calculations
- Automatic highlighting of fastest and cheapest options
- Trip Overview Dashboard: Interactive dashboard showing:
- All destinations with weather cards
- Route connections on map
- Total travel time and cost
- COβ emissions summary
- Interactive Map View: Leaflet.js integration with:
- Multiple destination markers
- Route lines connecting destinations
- Automatic bounds fitting
- Smart Packing Lists: Auto-generated checklists based on destination, trip type, and weather
- User Authentication: Secure login and signup system
- Save Trips: Store and manage multiple trips in MongoDB
- Dark/Light Mode: Theme toggle with system preference detection
- Responsive Design: Beautiful UI that works on all devices
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Framer Motion for animations
- React Router for navigation
- Leaflet.js / React-Leaflet for interactive maps
- Axios for API calls
- Node.js with Express
- MongoDB with Mongoose
- JWT for authentication
- bcryptjs for password hashing
- OpenWeatherMap API - Weather data and forecasts
- OpenStreetMap Nominatim - Geocoding and destination search (free)
- OSRM Routing API - Route calculation and distance (free)
- Custom transport mode estimation with COβ calculations
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- MongoDB (local or Atlas cloud)
git clone <your-repo-url>
cd packpalnpm installcd server
npm install
cd ..Create a .env file in the server directory:
# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/packpal
# OR for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/packpal
# JWT Secret (generate a random string)
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
# Server Port
PORT=5000The frontend is configured to connect to the backend at http://localhost:5000. If you need to change this, update src/utils/api.ts.
- Install MongoDB Community Edition: https://www.mongodb.com/docs/manual/installation/
- Start MongoDB service:
# On macOS brew services start mongodb-community # On Linux sudo systemctl start mongod # On Windows net start MongoDB
- Your MongoDB will be running at
mongodb://localhost:27017
- Create a free account at https://www.mongodb.com/cloud/atlas
- Create a new cluster (free tier available)
- Add your IP address to the whitelist (or use
0.0.0.0/0for testing) - Create a database user with read/write permissions
- Get your connection string and update
MONGODB_URIin.env
The application will automatically create the following collections when you first use them:
{
_id: ObjectId,
name: String (required),
email: String (required, unique),
password: String (required, hashed),
createdAt: Date
}{
_id: ObjectId,
userId: ObjectId (ref: User, required),
destination: String (required),
coordinates: {
lat: Number,
lon: Number
},
tripType: String (enum: ["business", "leisure", "adventure", "family", "romantic", "solo"], required),
startDate: Date (required),
endDate: Date (required),
weatherSummary: String,
createdAt: Date
}No manual database setup is required - Mongoose will create collections automatically.
Create a .env file in the root directory (optional, for API keys):
# OpenWeatherMap API Key (optional - can also be set via browser localStorage)
VITE_OPENWEATHER_API_KEY=your-openweather-api-key-hereTo get an OpenWeatherMap API key:
- Sign up for a free API key at https://openweathermap.org/api
- Get your API key from the dashboard (free tier includes 1,000 calls/day)
- Add it to your
.envfile or set it in browser localStorage:localStorage.setItem('OPENWEATHER_API_KEY', 'your-api-key-here')
Note: Destination search uses OpenStreetMap Nominatim (free, no API key required). Route calculation uses OSRM (free, no API key required).
cd server
npm startThe backend will run on http://localhost:5000
npm run devThe frontend will run on http://localhost:5173
- Navigate to Trip Planner from the home page
- Add Destinations: Use the search box to find and add multiple destinations
- Set Trip Details: Enter start/end dates and trip type
- View Route: See all destinations connected on an interactive map
- Compare Transport: View transport options between destinations (plane, train, bus, drive)
- Check Weather: See live weather for each destination
- View Summary: Check total time, cost, and COβ emissions
- Save Trip: Save your multi-destination trip plan
- Sign Up: Create a new account or log in
- Create Trip: Enter destination, dates, and trip type
- View Map: See your destination on an interactive map
- Check Weather: View current weather and 5-day forecast
- Compare Travel Modes: See estimated costs and times
- Generate Checklist: Get a smart packing list
- Track Progress: Check off items as you pack
- Save Trip: Save your trip for future reference
- Manage Trips: View and manage all your saved trips
packpal/
βββ server/ # Backend
β βββ models/ # Mongoose models
β β βββ User.js
β β βββ Trip.js
β βββ routes/ # API routes
β β βββ authRoutes.js
β β βββ tripRoutes.js
β βββ middleware/ # Auth middleware
β β βββ authMiddleware.js
β βββ server.js # Express server
β βββ package.json
β βββ .env # Environment variables
β
βββ src/ # Frontend
β βββ components/ # React components
β β βββ Header.tsx
β β βββ Footer.tsx
β β βββ ThemeToggle.tsx # Dark/light mode toggle
β β βββ DestinationAutocomplete.tsx # Destination search with autocomplete
β β βββ TransportComparison.tsx # Transport options comparison
β β βββ TripOverview.tsx # Multi-destination trip dashboard
β β βββ MapView.tsx
β β βββ WeatherDisplay.tsx
β β βββ TravelModes.tsx
β β βββ PackingItem.tsx
β β βββ PackingCategory.tsx
β β βββ ui/ # Shadcn UI components
β βββ pages/ # Page components
β β βββ Index.tsx # Landing page
β β βββ Login.tsx
β β βββ Signup.tsx
β β βββ TripPlanner.tsx # Multi-destination trip planner
β β βββ TripForm.tsx # Single destination trip creation
β β βββ Destination.tsx # Single destination view
β β βββ Checklist.tsx # Packing checklist
β β βββ MyTrips.tsx # Saved trips
β βββ utils/ # Utilities
β β βββ api.ts # Axios config
β β βββ packingListGenerator.ts
β βββ App.tsx # Main app & routing
β βββ index.css # Global styles
β βββ main.tsx
β
βββ public/
βββ index.html
βββ package.json
βββ tailwind.config.ts
βββ vite.config.ts
βββ README.md
POST /api/auth/signup- Create new userPOST /api/auth/login- Login user
POST /api/trips/save- Save a new trip (supports both single and multi-destination trips)- Single destination:
{ destination, coordinates, tripType, startDate, endDate, ... } - Multi-destination:
{ destinations: [{ name, coordinates }], route, totalTime, totalCost, totalCO2, ... }
- Single destination:
GET /api/trips/user/:id- Get all trips for a userDELETE /api/trips/:id- Delete a trip
PackPal uses a custom design system with semantic color tokens:
- Primary: Travel-themed green (
hsl(142, 70%, 45%)) - Secondary: Ocean blue (
hsl(201, 89%, 48%)) - Accent: Coral (
hsl(14, 90%, 60%))
All components use these tokens for consistent theming and dark mode support.
- Ensure MongoDB is running:
mongod --version - Check your connection string in
.env - For Atlas, verify IP whitelist and credentials
- Verify your OpenWeatherMap API key is valid
- Check browser console for errors
- API keys can take a few minutes to activate after creation
- Ensure backend is running on port 5000
- Check for port conflicts
- Verify
baseURLinsrc/utils/api.ts
- Check browser console for errors
- Ensure Leaflet CSS is imported
- Verify internet connection for map tiles
- Push code to Git repository
- Connect to deployment platform
- Set environment variables
- Deploy
- Build the app:
npm run build - Deploy the
distfolder - Update backend URL in environment variables
MIT License - feel free to use this project for learning or production!
Contributions are welcome! Please feel free to submit a Pull Request.
For issues or questions, please open an issue on GitHub.
Happy Packing with PackPal!