A comprehensive tour and travel management system built with Java EE, featuring user registration, tour booking, enquiry management, and admin panel functionality.
- User Registration & Authentication - Secure user registration and login system
- Tour Browsing - Browse available tour packages with detailed information
- Tour Booking - Book tours with personal details and preferences
- Enquiry System - Submit enquiries for tour information
- Issue Reporting - Report issues and get support
- Profile Management - Manage personal information and booking history
- Dashboard - Comprehensive admin dashboard with statistics
- Tour Management - Create, update, and manage tour packages
- User Management - Manage user accounts and permissions
- Booking Management - Handle tour bookings and confirmations
- Enquiry Management - Respond to customer enquiries
- Issue Management - Track and resolve customer issues
- Content Management - Manage website content and images
- Backend: Java 11, Java EE (Servlets, JSP)
- Database: PostgreSQL
- Build Tool: Maven
- Frontend: JSP, HTML, CSS, JavaScript, Bootstrap
- Deployment: Docker, webapp-runner
- Email: JavaMail API
- File Upload: Apache Commons FileUpload
- Java 11 or higher
- Maven 3.6+
- PostgreSQL 12+
- Git
- Docker 20.10+
- Docker Compose 1.29+
The easiest way to run the application is using Docker Compose:
# Clone the repository
git clone https://github.com/amolsr/TourAndTravel.git
cd TourAndTravel
# Build and run the application
docker-compose up --build
# Access the application
# Main Application: http://localhost:8080
# Admin Panel: http://localhost:8080/Admin/Logingit clone https://github.com/amolsr/TourAndTravel.git
cd TourAndTravel# Ubuntu/Debian
sudo apt update
sudo apt install postgresql postgresql-contrib
# macOS (using Homebrew)
brew install postgresql
brew services start postgresql
# Windows
# Download and install from https://www.postgresql.org/download/windows/-- Connect to PostgreSQL as superuser
sudo -u postgres psql
-- Create database
CREATE DATABASE tourdb;
-- Create user
CREATE USER touruser WITH PASSWORD 'your_password';
-- Grant privileges
GRANT ALL PRIVILEGES ON DATABASE tourdb TO touruser;
-- Exit PostgreSQL
\qCreate a .env file in the project root:
# Database Configuration
DATABASE_HOST=jdbc:postgresql://localhost:5432/tourdb
DBUSER=touruser
DBPASS=your_password
# Email Configuration (Optional)
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_app_password# Clean and compile
mvn clean compile
# Package the application
mvn package
# Run with Maven (requires servlet container)
mvn tomcat7:run# Build the project
mvn clean package
# Run with webapp-runner
java -jar target/dependency/webapp-runner.jar --port 8080 target/*.war- Import the project as a Maven project
- Configure the database connection in
src/com/tnt/dao/DBManager.java - Deploy to a servlet container (Tomcat, Jetty, etc.)
- Set environment variables for database connection
The application will automatically create the required tables on first run. The database schema includes:
- Users - User accounts and profiles
- Admin - Administrator accounts
- Tour - Tour packages and details
- Booking - Tour bookings and reservations
- Enquiry - Customer enquiries
- Issues - Support tickets and issues
- Home Page: http://localhost:8080/
- User Registration: http://localhost:8080/Register
- User Login: http://localhost:8080/Login
- Admin Login: http://localhost:8080/Admin/Login
- Admin Dashboard: http://localhost:8080/Admin/DashBoard
You'll need to create accounts through the registration process or directly in the database.
TourAndTravel/
βββ src/com/tnt/
β βββ cont/ # Controllers (Servlets)
β βββ dao/ # Data Access Objects
β βββ model/ # Data Models
β βββ util/ # Utility Classes
βββ WebContent/
β βββ Admin/ # Admin panel JSP pages
β βββ css/ # Stylesheets
β βββ js/ # JavaScript files
β βββ img/ # Images and assets
β βββ WEB-INF/ # Web configuration
βββ docker-compose.yml # Docker Compose configuration
βββ Dockerfile # Docker build configuration
βββ pom.xml # Maven configuration
βββ README.md # This file
Update the database connection in src/com/tnt/dao/DBManager.java:
con = DriverManager.getConnection(
System.getenv("DATABASE_HOST"),
System.getenv("DBUSER"),
System.getenv("DBPASS")
);Configure email settings in src/com/tnt/cont/ContactUs.java for enquiry notifications.
File upload settings are configured in the servlet classes for tour image uploads.
# Build and start services
docker-compose up --build
# Start in background
docker-compose up -d
# View logs
docker-compose logs -f app
# Stop services
docker-compose down
# Stop and remove volumes (WARNING: Deletes data)
docker-compose down -v
# Rebuild specific service
docker-compose up --build app- User Registration: Test user account creation
- Tour Browsing: Verify tour package display
- Booking Process: Test complete booking workflow
- Admin Functions: Test admin panel features
- Database Operations: Verify data persistence
# Connect to database
docker-compose exec postgres psql -U postgres -d tourdb
# View tables
\dt
# Check data
SELECT * FROM Users;
SELECT * FROM Tour;-
Database Connection Failed
- Verify PostgreSQL is running
- Check database credentials
- Ensure database exists
-
Port Already in Use
- Change port in docker-compose.yml
- Kill existing processes on ports 8080/5432
-
Build Failures
- Check Java version (requires Java 11+)
- Verify Maven dependencies
- Clean and rebuild:
mvn clean package
-
Servlet Container Issues
- Ensure proper servlet container configuration
- Check web.xml configuration
- Verify JSP compilation
# Application logs
docker-compose logs app
# Database logs
docker-compose logs postgres
# Maven debug
mvn clean package -X- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project has several identified issues that need attention:
- SQL syntax errors in DAO classes
- Inconsistent error handling
- Missing null checks
- TODO comments in production code
See the Issues page for detailed bug reports and fixes.
- Implement proper logging framework
- Add unit tests
- Improve error handling
- Add input validation
- Implement security enhancements
This project is licensed under the MIT License - see the LICENSE file for details.
Amol Saini
- GitHub: @amolsr
- Bootstrap for UI components
- PostgreSQL for database
- Maven for build management
- Java EE community for best practices
Note: This is a Java EE web application. Make sure you have the proper servlet container (Tomcat, Jetty, etc.) configured for local development, or use the provided Docker setup for the easiest deployment experience.