A modern travel agency web application built with Node.js, Express, and MySQL. Features user authentication, booking management, and a beautiful responsive UI.
- User Authentication (Login/Signup)
- Destination Browsing
- Booking Management
- Contact Form
- Responsive Design
- Admin Dashboard
- MySQL Database Integration
Before you begin, ensure you have the following installed:
- Clone the repository:
git clone https://github.com/yourusername/tap-travel-agency.git
cd tap-travel-agency- Install dependencies:
npm install- Create a
.envfile in the root directory:
DB_HOST=localhost
DB_USER=your_mysql_username
DB_PASSWORD=your_mysql_password
DB_NAME=travel_agency
SESSION_SECRET=your_session_secret- Create the database and tables:
mysql -u root -p
CREATE DATABASE travel_agency;- Start the development server:
npm run devThe application will be available at http://localhost:8080
- Using Docker Compose (Recommended):
# Build and start containers
docker-compose up -d
# View logs
docker-compose logs -f
# Stop containers
docker-compose down- Using Docker directly:
# Build the image
docker build -t tap-travel-agency .
# Run the container
docker run -p 8080:8080 -d \
-e DB_HOST=your_db_host \
-e DB_USER=your_db_user \
-e DB_PASSWORD=your_db_password \
-e DB_NAME=travel_agency \
-e SESSION_SECRET=your_session_secret \
tap-travel-agencytap-travel-agency/
├── views/ # EJS templates
│ ├── login.ejs
│ ├── signup.ejs
│ ├── dashboard.ejs
│ └── booking.ejs
├── public/
│ ├── images/ # Image assets
│ ├── style.css # Styles
│ └── script.js # Client-side JavaScript
├── server.js # Main application file
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
└── package.json # Project dependencies
| Variable | Description |
|---|---|
| DB_HOST | MySQL database host |
| DB_USER | Database username |
| DB_PASSWORD | Database password |
| DB_NAME | Database name |
| SESSION_SECRET | Secret for session management |
| PORT | Server port (default: 8080) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /signup | Create new user account |
| POST | /login | Authenticate user |
| GET | /dashboard | View user bookings |
| POST | /book | Create new booking |
| POST | /contact | Submit contact form |
# Start development server
npm run dev
# Run tests
npm test
# Lint code
npm run lint# Build image
docker build -t tap-travel-agency .
# Run container
docker run -p 8080:8080 tap-travel-agency
# View logs
docker logs -f container_name
# Stop container
docker stop container_name
# Remove container
docker rm container_name-
Database Connection Issues
- Verify MySQL is running
- Check credentials in .env file
- Ensure database exists
-
Docker Issues
- Verify Docker daemon is running
- Check container logs
- Verify port availability
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
