TripSmart helps users generate personalized trip plans with smart budget allocation, multi-modal transport choices, and destination-specific recommendations.
- Smart Budget Allocation - Automatically distributes budget across transport, accommodation, activities, and meals
- Multi-Modal Transport - Supports flights, trains, buses, and local transport planning
- Dynamic Trip Plans - Generates Budget, Comfort, and Premium tier options
- Places Selection - Choose which attractions to visit with actual entry fees displayed
- User Authentication - JWT-based auth with secure session management
- Trip Persistence - Save and retrieve trip plans from MongoDB
- React 18 + TypeScript
- Vite (build tool)
- Tailwind CSS + Radix UI
- React Router
- Leaflet + React-Leaflet (map rendering and route visualization)
- Node.js + Express
- MongoDB + Mongoose
- JWT Authentication
- Hybrid data layer (MongoDB + curated static datasets)
- The app uses Leaflet on the frontend to render the interactive map background and route overlays.
- We use coordinate lookup data (city names and IATA airport codes) to place:
- Origin marker
- Destination marker
- Stop markers
- Flight/train route paths and distance lines
- Core map files:
src/app/components/MapBackground.tsxsrc/data/cityCoordinates.ts
Radix UI is an unstyled, accessible component primitive library for React. In TripSmart, Radix provides reliable behavior and accessibility for interactive UI controls, while Tailwind handles the visual design.
In this project, Radix-based components are used for:
- Dialogs and modals (confirmations and detail overlays)
- Dropdown menus and selects (sorting/filter inputs)
- Tabs, accordions, popovers, tooltips, drawers
- Form-oriented controls like checkbox, radio group, switches, and labels
- Navigation primitives and command-style interactions
Where these are implemented:
- Component wrappers:
src/app/components/ui/ - Consumed across pages such as plan, results, profile, settings, and booking flows
| Tier | Description |
|---|---|
| Tier 1 - Presentation Layer | React-based UI with Radix components and Tailwind styling |
| Tier 2 - Application Layer | Express.js backend handling business logic and API requests |
| Tier 3 - Data Layer | MongoDB for persistence plus static/demo data providers for transport and city datasets |
- Node.js 18+
- MongoDB (local or Atlas)
- npm or yarn
- Clone the repository
git clone https://github.com/Sathvik5647/TripSmart.git
cd TripSmart-main- Install frontend dependencies
npm install- Install backend dependencies
cd backend
npm install- Configure environment variables
Create backend/.env:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/tripsmart
JWT_SECRET=your-secure-jwt-secret
JWT_REFRESH_SECRET=your-secure-refresh-secret
NODE_ENV=developmentOptional root .env values can be added for frontend runtime config if needed.
- Start the development servers
Frontend:
npm run devBackend (in separate terminal):
cd backend
npm run dev- Open the app
Navigate to
http://localhost:5173
TripSmart/
├── src/ # Frontend source
│ ├── app/
│ │ ├── components/ # UI components
│ │ └── pages/ # Page components
│ ├── contexts/ # React contexts (Auth)
│ └── services/ # API services
├── backend/
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── data/ # Mock data (cities, flights, trains)
│ │ ├── models/ # Mongoose models
│ │ ├── routes/ # API routes
│ │ └── services/ # Business logic services
│ └── EXP-TRAINS.json # Real Indian Railways data
└── README.md
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/refresh- Refresh tokenGET /api/auth/me- Get current user
POST /api/trips/plan- Generate trip plans (requires auth)GET /api/trips/:id- Get trip detailsGET /api/trips/user- Get user's saved trips
GET /api/cities/search?q=- Search citiesGET /api/cities/popular- Get popular citiesGET /api/flights/search- Search flightsGET /api/trains/search- Search trainsGET /api/hotels/search- Search hotels
- Flights, buses, hotels, cities, and local attractions are currently served from curated in-repo datasets and generation logic.
- Train search uses the backend train service and available train datasets.
- User, trip, and auth data are persisted in MongoDB.
- Live third-party APIs (for flight/bus/hotel inventory) are not yet integrated.
# Run frontend
npm run dev
# Run backend
cd backend && npm run dev
# Build for production
npm run buildMIT License - See LICENSE file for details.
Created by Sathvik