A Flask and React-based project that generates personalized travel itineraries based on user preferences like destination, budget, and activities.
trip-planner/
├── node_modules/ # React dependencies (auto-generated)
├── public/ # Static assets (React)
│ └── index.html # Main HTML template for React
└── src/ # React components
│ ├── components/ # React UI components
│ │ ├── AuthForm.jsx # User authentication form (e.g., login/signup)
│ │ ├── dashboard.jsx # Main dashboard with travel preference form
│ │ ├── TripPlan.jsx
│ │ └── firebaseConfig.js
│ ├── CSS # CSS file
│ ├── AuthForm.css
│ ├── dashboard.css
│ └── TripPlan.css
│ ├── App.js # Main React component
│ └── index.js # React entry point
├── database # store ur .json file here
│ └── serviceAccountKey.json
├── app.py
├── app.js # JS version of app.py
├── userdb.py # python script for local database
├── server.py # Main Flask app (initializes server and routes)
├── server.js # JS version of server.js (NODE.js)
├── app.js
├── user.db # local database
git clone <your-repo-url>
cd trip-planner-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask app:
python app.py
-
Ensure you're in the project root:
cd trip-planner -
Install React dependencies:
npm install
-
Start the React app:
npm start
Visit http://localhost:3000 to use the trip-planner UI.
- AuthForm.jsx: Provides a user login/signup interface.
- Dashboard.jsx: Collects destination, travel dates, budget, activities, and group size. Sends data to
/api/generate-itinerary. - API Integration: Connects the React UI to Flask for dynamic itinerary generation.
-
app.py: Main Flask entry point that initializes the server and registers blueprints.
-
preference.py: Handles travel preference logic and processes
/api/generate-itineraryrequests. -
userdb.py: Manages user-related functions like data storage and validation.
-
React UI:
AuthForm.jsx: User authentication form.Dashboard.jsx: Travel preferences form for itinerary generation.
-
requirements.txt: Contains all necessary Python packages for the Flask backend.
- Enhance itinerary with third-party APIs (e.g., Google Maps).
- Add persistent user authentication and save plans.
- Implement detailed error handling and form validation.
Flask
Flask-Cors
requests
To install all necessary packages, run:
pip install -r requirements.txt