Final Project - Web Application Programming | Ganjil 2025
Trevio adalah sistem manajemen pemesanan hotel yang memungkinkan:
- Multiple hotels dengan multiple owners
- Manual payment verification oleh admin
- Room slot management (automatic availability tracking)
- Multi-channel notifications (Email & WhatsApp)
- Reviews & rating system
- Complete refund workflow
- Customer memilih hotel dan kamar
- Upload bukti transfer pembayaran
- Admin verifikasi payment secara manual
- Email invoice dikirim setelah konfirmasi
- WhatsApp notification ke owner
- Owner set total slot kamar saat create/edit room
- Slot otomatis ready untuk semua hari
- Slot berkurang otomatis saat booking confirmed
- Slot kembali saat booking cancelled/refunded
- No calendar per-date management needed!
- Customer request refund dengan bank info
- Admin review dan approve/reject
- Transfer manual oleh admin
- Upload bukti transfer refund
- Register/Login (Email + Password / Google OAuth)
- Browse & search hotels
- Check room availability (real-time slot check)
- Book multiple rooms
- Upload payment proof
- Receive email invoice
- View booking history
- Request refund
- Write reviews & ratings
- Register/Login (Email + Password / Google OAuth)
- Add/manage hotels
- Add/manage rooms (set default slot count)
- View bookings
- Check-in guests
- View reports (Chart.js)
- Receive WhatsApp notification for new bookings
- Login (Email + Password)
- Verify/reject payments (view proof, add notes)
- Process refunds
- Manage users (activate/deactivate)
- Manage hotels (approve/reject)
- View global statistics & reports
- Moderate reviews
- PHP 8.0+ (Native MVC Pattern)
- MySQL 8.0+
- PHPMailer (email notifications)
- WhatsApp API (Fonnte/Wablas)
- Google OAuth 2.0 (Sign in with Google)
- Tailwind CSS 3.0+ (styling)
- Chart.js (reports & statistics)
- SweetAlert2 (beautiful alerts)
- Vanilla JavaScript
- Google Fonts
- VPS Server (Ubuntu/CentOS)
- Apache/Nginx
- SSL Certificate (Let's Encrypt)
9 Tables:
- users - All users (customer, owner, admin)
- hotels - Hotels (owned by owners)
- rooms - Room types with slot count
- bookings - All booking transactions
- payments - Payment proofs & verification
- refunds - Refund requests & processing
- reviews - Customer reviews & ratings
- notifications - Notification logs (email & WhatsApp)
- admin_activities - Admin action audit log
See full schema: database/trevio_final.sql
See ERD: docs/ERD.png
- PHP >= 8.0
- MySQL >= 8.0
- Composer (optional, for dependencies)
- VPS Server with SSH access
git clone https://github.com/your-team/trevio.git
cd trevio# Copy environment template
cp .env.example .env
# Edit configuration
nano .envRequired configurations:
# Database
DB_HOST=localhost
DB_NAME=trevio
DB_USER=root
DB_PASS=your_password
# App
APP_URL=https://trevio.yourdomain.com
APP_ENV=production
# Email (Gmail SMTP)
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_app_password
MAIL_FROM=noreply@trevio.com
# WhatsApp (Fonnte)
WHATSAPP_API_KEY=your_fonnte_api_key
WHATSAPP_ENABLED=true
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=https://trevio.yourdomain.com/auth/google-callback# Create database
mysql -u root -p -e "CREATE DATABASE trevio"
# Import schema
mysql -u root -p trevio < database/trevio_final.sql
# Import sample data (optional)
mysql -u root -p trevio < database/seeders.sql# Set upload directory permissions
chmod -R 755 public/uploads
chmod -R 755 logs
# Set ownership (if on VPS)
chown -R www-data:www-data public/uploads
chown -R www-data:www-data logsApache (.htaccess already included):
# Enable mod_rewrite
sudo a2enmod rewrite
sudo systemctl restart apache2Nginx:
server {
listen 80;
server_name trevio.yourdomain.com;
root /var/www/trevio/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}http://your-domain.com
or
http://your-vps-ip
Admin:
Email: admin@trevio.com
Password: password123
Owner:
Email: owner@trevio.com
Password: password123
Customer:
Email: customer@trevio.com
Password: password123
// Example: Owner creates "Deluxe Room" with 5 slots
Room:
- room_type: "Deluxe Room"
- total_slots: 5 // Set by owner
- available_slots: 5 // Default = total_slots
// Slot is READY for ALL dates automatically!
// No need to set availability per date// Customer books 2 rooms
// Before booking:
available_slots = 5
// After booking confirmed:
available_slots = 5 - 2 = 3
// System automatically reduces slots// Restore slots
available_slots = 3 + 2 = 5
// Back to original// When customer searches hotel for any date:
SELECT * FROM rooms
WHERE hotel_id = ?
AND available_slots >= num_rooms_requestedResult: Simple, no per-date calendar needed! β
Sent for:
- βοΈ Booking created (invoice attached)
- βοΈ Payment verified
- βοΈ Payment rejected
- βοΈ Refund completed
Sent to OWNER only for:
- π± New booking confirmed
- π± Guest check-in today reminder
Email (Gmail):
- Enable 2-Step Verification in Google Account
- Generate App Password
- Use in
.envasMAIL_PASSWORD
WhatsApp (Fonnte):
- Register at https://fonnte.com
- Get API key
- Use in
.envasWHATSAPP_API_KEY
- Go to: https://console.cloud.google.com/
- Create new project: "Trevio"
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
https://trevio.yourdomain.com/auth/google-callback - Copy Client ID & Client Secret
GOOGLE_CLIENT_ID=your_client_id_here.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_client_secret_here
GOOGLE_REDIRECT_URI=https://trevio.yourdomain.com/auth/google-callbackAlready included in views/auth/login.php
- Revenue trend (line chart)
- Booking trend (bar chart)
- Occupancy rate (pie chart)
- Room type performance
- Total users (by role)
- Total hotels
- Total bookings (by status)
- Revenue summary
- Top performing hotels
Admin:
- Email: admin@trevio.com
- Password: password123
Owner:
- Email: owner@trevio.com
- Password: password123
Customer:
- Email: customer@trevio.com
- Password: password123
Customer Flow:
- Register/Login (email or Google)
- Search hotel
- Check room availability
- Book room
- Upload payment proof
- Wait admin verification
- Receive invoice email
- Write review after stay
Owner Flow:
- Login
- Add hotel
- Add rooms (set slots)
- View bookings
- Check-in guest
- View reports
Admin Flow:
- Login
- Verify payment
- Reject payment (test)
- Process refund
- Manage users
- View statistics
trevio/
βββ app/
β βββ controllers/
β β βββ AuthController.php # Login + Google OAuth
β β βββ BookingController.php # Booking logic
β β βββ OwnerRoomController.php # Room slot management
β βββ models/
β β βββ Room.php # Room model (slot logic)
β β βββ Booking.php # Booking model
β βββ views/
β βββ ...
βββ config/
β βββ database.php # DB config
β βββ google-oauth.php # Google OAuth config
βββ libraries/
β βββ PHPMailer/ # Email library
β βββ Mailer.php # Email wrapper
β βββ WhatsApp.php # WhatsApp wrapper
βββ public/
βββ index.php # Entry point
βββ uploads/ # Upload directory
1. Connect to VPS:
ssh root@your-vps-ip2. Install LAMP Stack:
# Update system
apt update && apt upgrade -y
# Install Apache, MySQL, PHP
apt install apache2 mysql-server php8.0 php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring -y3. Clone & Setup:
cd /var/www
git clone https://github.com/your-team/trevio.git
cd trevio
cp .env.example .env
nano .env # Configure4. Database:
mysql -u root -p < database/trevio_final.sql5. Permissions:
chown -R www-data:www-data /var/www/trevio
chmod -R 755 /var/www/trevio/public/uploads6. Apache Config:
nano /etc/apache2/sites-available/trevio.conf<VirtualHost *:80>
ServerName trevio.yourdomain.com
DocumentRoot /var/www/trevio/public
<Directory /var/www/trevio/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/trevio-error.log
CustomLog ${APACHE_LOG_DIR}/trevio-access.log combined
</VirtualHost>a2ensite trevio
a2enmod rewrite
systemctl restart apache27. SSL (Let's Encrypt):
apt install certbot python3-certbot-apache -y
certbot --apache -d trevio.yourdomain.comFull guide: docs/Deployment_Guide.md
- β¨ Responsive design (mobile-first)
- π¨ Modern Tailwind CSS
- π Interactive charts (Chart.js)
- π Beautiful alerts (SweetAlert2)
- πΌοΈ Image galleries
- β Star rating system
- π± Mobile-friendly forms
- π Real-time search
- π― Loading indicators
- ERD Diagram
- User Flow
- Deployment Guide
- API Documentation (if applicable)
| Name | Role | Responsibilities |
|---|---|---|
| Hendrik | Project Manager & Full Stack | Backend core, coordination |
| Fajar | Full Stack & DevOps | Backend, deployment, notifications |
| Syadat | Database & QA | Database design, testing |
| Zek | UI/UX Designer | Interface design, user experience |
| Reno | Frontend Developer | Frontend implementation, Tailwind |
- Total Files: 50+
- Lines of Code: 5000+
- Database Tables: 9
- Main Transactions: 3
- User Roles: 3
- Notification Channels: 2 (Email + WhatsApp)
# php.ini
upload_max_filesize = 10M
post_max_size = 10M- Check Gmail app password
- Check SMTP settings
- Check firewall (port 587)
- Verify redirect URI exactly matches
- Check Client ID & Secret
- Enable Google+ API
- Initial release
- Manual payment verification
- Room slot management
- Email & WhatsApp notifications
- Google OAuth integration
- Reviews & rating system
For questions or issues:
- Project Manager: Hendrik - hendrik@email.com
- Lecturer: Moch Kautsar Sophan
This project is created for educational purposes as part of Web Application Programming final project.
Β© 2025 Trevio Team. All Rights Reserved.
- Moch Kautsar Sophan (Lecturer)
- PHP Community
- Tailwind CSS Team
- Chart.js Contributors
- SweetAlert2 Team
- Google OAuth Documentation
- Fonnte WhatsApp API
Built with β€οΈ by Trevio Team