SmartTravel is a modern travel booking platform built to provide a seamless and fast user experience. It allows users to search and book flights, buses, and trains across multiple operators using an intuitive, clean interface.
- Flexible Route Search: Type a few letters (e.g., "a" to "u") to instantly see all matching routes like Ahmedabad to Udaipur.
- Multi-Operator Booking: Search options across different modes of transport (Flights, Trains, Buses).
- Secure Authentication: Registration, login, and secure sessions using JWT & Bcrypt.
- Admin Dashboard: Role-based access allowing admins to create, edit, and delete routes, as well as upload images to Cloudinary.
- Modern & Responsive UI: Clean, human-built aesthetic optimized for ease of use.
- Fully Containerized: One-command setup using Docker and Docker Compose.
- Frontend: React, Vite, React Router, CSS
- Backend: Node.js, Express.js
- Database: PostgreSQL
- Authentication: JSON Web Tokens (JWT), Bcrypt.js
- Media Hosting: Cloudinary (Integrated with Multer)
- Containerization: Docker, Docker Compose, Nginx
The easiest way to run the application is using Docker Compose, which automatically sets up the database, backend, and frontend.
-
Clone the repository:
git clone https://github.com/your-username/SmartTravel.git cd SmartTravel -
Configure Environment Variables: Copy the example environment file and fill in your details (like a secure Postgres password, your admin email, and Cloudinary keys):
cp .env.example .env
(Note: The
ADMIN_EMAILyou set here is the email address that will be granted Admin Dashboard access when you register/login). -
Start the containers:
docker-compose up -d --build
-
Access the Application:
- Frontend App: http://localhost:8080
- Backend API: http://localhost:4000
If you prefer to run the application directly on your machine:
-
Setup the Database: Ensure PostgreSQL is installed and running locally. Create a database named
smarttraveland run the script inbackend/db/schema.sqlto generate the required tables. -
Setup the Backend:
cd backend npm installCreate a
.envfile in the root matching the.env.examplefile. Then start the server:npm run server
-
Setup the Frontend: Open a new terminal:
cd frontend npm install npm run devThe frontend will boot up on
http://localhost:5173.
SmartTravel/
├── backend/ # Node.js Express server
│ ├── db/ # PostgreSQL connection & schema
│ ├── uploads/ # Local temp storage for multer
│ ├── server.js # API entry point & routes
│ └── Dockerfile
├── frontend/ # React web client
│ ├── src/
│ │ ├── api/ # Axios API clients
│ │ ├── pages/ # React pages (Home, Search, Admin, etc.)
│ │ ├── App.jsx # React Router setup
│ │ └── index.css # Global UI styling
│ ├── vite.config.js # Bundler configuration
│ └── Dockerfile # Multi-stage build with Nginx
├── docker-compose.yml # Docker orchestration configuration
├── .env.example # Template for required environment variables
└── README.md # Project documentation



