A modern, feature-rich trip planning application built with React, TypeScript, and Tailwind CSS. Plan your trips with detailed day-by-day itineraries, accommodation management, and seamless data synchronization.
- β¨ Features
- π Quick Start
- βοΈ Google Drive Setup
- π± PWA Installation
- π Usage Guide
- π οΈ Development
- π§ Configuration
- π€ Contributing
- π License
- Complete CRUD Operations - Add, edit, delete everything through an intuitive UI
- Day-by-Day Itineraries - Organize your trip with detailed daily plans
- Place Management - Add and manage places to visit with descriptions and images
- Accommodation Tracking - Manage hotel bookings with amenities and details
- Image Galleries - Add photos to capture your trip memories
- Notes & Descriptions - Add detailed notes for each day and place with markdown support
- Multi-language Support - English and Portuguese (Portugal)
- Language Selector - Easy language switching with flag icons
- Localized Content - All text, dates, and formats adapt to selected language
- Persistent Language Choice - Remembers your language preference
- Google Drive Integration - Sync your trip data across devices
- Real-time Sync - Automatic synchronization with conflict resolution
- Offline Support - Work without internet connection
- Import/Export - Backup and share your trip data as JSON files
- Installable - Add to home screen on mobile and desktop
- Offline Functionality - Works without internet connection
- App-like Experience - Standalone mode with no browser UI
- Push Notifications Ready - Framework for future notification features
- Responsive Design - Optimized for all screen sizes
- Beautiful Components - Built with shadcn/ui for consistency
- Dark/Light Mode Ready - Framework for theme switching
- Accessible - WCAG compliant with proper ARIA labels
- Mobile-First - Touch-optimized interface
- Node.js 16.6.0 or higher
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd trip-planner
-
Install dependencies
npm install
-
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:5174
npm run build
npm run preview- A Google Cloud Platform account
- Your trip planner application running locally or deployed
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Drive API:
- Navigate to APIs & Services > Library
- Search for "Google Drive API"
- Click Enable
- Go to APIs & Services > OAuth consent screen
- Choose External user type
- Fill in required information:
- App name: "Trip Planner"
- User support email: Your email
- Developer contact information: Your email
- Add scopes:
https://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/userinfo.email
- Add test users (your email address)
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Choose Web application
- Add authorized redirect URIs:
- Development:
http://localhost:5174 - Production:
https://your-domain.com
- Development:
- Copy the Client ID (you'll need this for environment variables)
Create a .env file in the project root:
# Google Drive Integration
VITE_GOOGLE_CLIENT_ID=your_google_client_id_here
VITE_GOOGLE_REDIRECT_URI=http://localhost:5174
# For production deployment
# VITE_GOOGLE_REDIRECT_URI=https://your-domain.comNote: Client Secret is not required for this integration as we use the implicit OAuth flow for security.
- Start the development server:
npm run dev - Open the application in your browser
- Click Connect to Google Drive in the header
- Complete the OAuth flow
- Verify that your trip data syncs with Google Drive
- Authentication: Uses OAuth 2.0 implicit flow (no client secret required)
- File Storage: Trip data is stored as
trip-planner-data.jsonin your Google Drive - Sync Strategy: The app automatically syncs when you authenticate and checks for changes every 30 seconds
- Conflict Resolution: Smart merge strategies for handling conflicts
- Privacy: Data is stored in your personal Google Drive, not accessible to other users
"Authentication failed" Error
- Verify your Client ID is correct
- Check that the redirect URI matches exactly (including http/https)
- Ensure the Google Drive API is enabled in your project
"Popup blocked" Error
- Allow popups for your application domain
- Try using a different browser or incognito mode
"Not authenticated" Error
- Clear your browser's localStorage and try logging in again
- Check that your OAuth credentials haven't expired
β
Offline Access - App works without internet connection
β
App Installation - Can be installed on mobile and desktop
β
Push Notifications - Ready for future notifications
β
Responsive Design - Optimized for all screen sizes
β
App-like Experience - Standalone mode, no browser UI
- Open the app in Chrome
- Look for the "Install Trip Planner" popup at the bottom
- Tap "Install" or use the browser menu β "Add to Home Screen"
- Open the app in Safari
- Tap the share button (π€) at the bottom
- Select "Add to Home Screen"
- Tap "Add" in the top right
- Look for install icon in address bar
- Click "Install" to add to desktop
The app works offline because:
- Local Storage: Trip data is saved locally
- Service Worker: Caches app files for offline access
- Smart Syncing: Syncs changes when connection is restored
App not installing
- Ensure HTTPS (except localhost)
- Check manifest in DevTools β Application β Manifest
- Verify service worker in DevTools β Application β Service Workers
Offline not working
- Check service worker registration
- Verify caching strategies in
vite.config.ts - Test with Chrome DevTools β Application β Service Workers
-
Create Your Trip
- Click "Edit Trip" to set trip name, description, and dates
- Add your first day using the "Add Day" button
-
Plan Your Days
- Add regions/locations for each day
- Include drive times and distances
- Add Google Maps embed URLs for navigation
-
Add Places to Visit
- Click "Add Place" in any day section
- Include descriptions, website URLs, and images
- Add Google Maps links for easy navigation
-
Manage Accommodation
- Edit accommodation details for each day
- Add hotel websites and Google Maps links
- Select amenities from a comprehensive checklist
- Switch Languages: Use the flag icon in the header
- Default Language: App defaults to Portuguese
- Persistent Choice: Your language preference is saved
- Responsive Layout - Optimized for all screen sizes
- Touch Gestures - Swipe and tap optimized interface
- Offline Support - Works without internet connection
- Installable - Add to home screen for app-like experience
- Safe Areas - Respects device notches and system UI
- Chrome 88+ (Recommended)
- Firefox 85+
- Safari 14+
- Edge 88+
# Development
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
npm run type-check # Run TypeScript checks
npm run check-all # Run all quality checkssrc/
βββ components/ # React components
β βββ ui/ # shadcn/ui components
β βββ TripPlanner.tsx # Main application component
β βββ TripHeader.tsx # Header with actions and language selector
β βββ GoogleDriveAuth.tsx # Google Drive integration
β βββ PWAInstallPrompt.tsx # PWA installation prompts
β βββ [Other components] # Modals, cards, etc.
βββ contexts/ # React contexts
β βββ SyncContext.tsx # Data synchronization context
βββ hooks/ # Custom React hooks
β βββ useTripData.ts # Trip data management
βββ lib/ # Utility libraries
β βββ utils.ts # General utilities
β βββ amenities.ts # Amenity definitions
βββ locales/ # Translation files
β βββ en.json # English translations
β βββ pt.json # Portuguese translations
βββ i18n.ts # Internationalization setup
βββ App.tsx # Root application component
- React 18 - Modern React with hooks and concurrent features
- TypeScript - Type-safe JavaScript development
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Beautiful, accessible component library
- Vite - Fast build tool and development server
- i18next - Internationalization framework
- PWA - Progressive Web App capabilities
- Google Drive API - Cloud synchronization
The PWA is configured in vite.config.ts with:
- Service worker for offline functionality
- Manifest for app installation
- Icon generation and caching strategies
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and ensure all tests pass
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow TypeScript best practices
- Use ESLint and Prettier for code formatting
- Write meaningful commit messages
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ for travelers who love to plan their adventures!