Set up modern PHP MVC project structure for GetYourBand platform
- Implemented clean MVC architecture with Router, Controller, and Model base classes - Created database migrations for users, bands, bookings, reviews, and availability - Set up Tailwind CSS with yellow color scheme and modern design - Added Alpine.js for reactive JavaScript components - Configured Vite for asset building and hot module replacement - Created authentication and role-based middleware - Implemented helper functions and configuration system - Added comprehensive README with setup instructions - Configured Apache with proper rewrite rules and security headers - Set up Composer and npm package management with modern dependencies
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
-- Migration: Create users table
|
||||
-- Created: 2025-12-02
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
email VARCHAR(255) NOT NULL UNIQUE,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
role ENUM('admin', 'band', 'customer') NOT NULL DEFAULT 'customer',
|
||||
email_verified_at TIMESTAMP NULL,
|
||||
verification_token VARCHAR(64) NULL,
|
||||
reset_token VARCHAR(64) NULL,
|
||||
reset_token_expires TIMESTAMP NULL,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
INDEX idx_email (email),
|
||||
INDEX idx_role (role),
|
||||
INDEX idx_verification_token (verification_token),
|
||||
INDEX idx_reset_token (reset_token)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
@@ -0,0 +1,38 @@
|
||||
-- Migration: Create bands table
|
||||
-- Created: 2025-12-02
|
||||
|
||||
CREATE TABLE IF NOT EXISTS bands (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
slug VARCHAR(255) NOT NULL UNIQUE,
|
||||
description TEXT,
|
||||
genre VARCHAR(100),
|
||||
location VARCHAR(255),
|
||||
postal_code VARCHAR(10),
|
||||
price_min DECIMAL(10, 2),
|
||||
price_max DECIMAL(10, 2),
|
||||
member_count INT,
|
||||
phone VARCHAR(50),
|
||||
website VARCHAR(255),
|
||||
facebook VARCHAR(255),
|
||||
instagram VARCHAR(255),
|
||||
youtube VARCHAR(255),
|
||||
profile_image VARCHAR(255),
|
||||
cover_image VARCHAR(255),
|
||||
is_approved BOOLEAN DEFAULT FALSE,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
view_count INT DEFAULT 0,
|
||||
average_rating DECIMAL(3, 2) DEFAULT 0.00,
|
||||
total_reviews INT DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
INDEX idx_slug (slug),
|
||||
INDEX idx_genre (genre),
|
||||
INDEX idx_location (location),
|
||||
INDEX idx_postal_code (postal_code),
|
||||
INDEX idx_is_approved (is_approved),
|
||||
INDEX idx_average_rating (average_rating),
|
||||
FULLTEXT idx_search (name, description, genre)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
@@ -0,0 +1,17 @@
|
||||
-- Migration: Create band_media table
|
||||
-- Created: 2025-12-02
|
||||
|
||||
CREATE TABLE IF NOT EXISTS band_media (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
band_id INT NOT NULL,
|
||||
type ENUM('image', 'video') NOT NULL,
|
||||
url VARCHAR(500) NOT NULL,
|
||||
title VARCHAR(255),
|
||||
is_featured BOOLEAN DEFAULT FALSE,
|
||||
sort_order INT DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (band_id) REFERENCES bands(id) ON DELETE CASCADE,
|
||||
INDEX idx_band_id (band_id),
|
||||
INDEX idx_type (type),
|
||||
INDEX idx_sort_order (sort_order)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
@@ -0,0 +1,26 @@
|
||||
-- Migration: Create bookings table
|
||||
-- Created: 2025-12-02
|
||||
|
||||
CREATE TABLE IF NOT EXISTS bookings (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
band_id INT NOT NULL,
|
||||
customer_id INT NOT NULL,
|
||||
event_date DATE NOT NULL,
|
||||
event_time TIME,
|
||||
event_location VARCHAR(255) NOT NULL,
|
||||
event_type VARCHAR(100),
|
||||
budget DECIMAL(10, 2),
|
||||
guest_count INT,
|
||||
message TEXT,
|
||||
status ENUM('pending', 'accepted', 'rejected', 'completed', 'cancelled') DEFAULT 'pending',
|
||||
band_response TEXT,
|
||||
responded_at TIMESTAMP NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (band_id) REFERENCES bands(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (customer_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
INDEX idx_band_id (band_id),
|
||||
INDEX idx_customer_id (customer_id),
|
||||
INDEX idx_status (status),
|
||||
INDEX idx_event_date (event_date)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
@@ -0,0 +1,23 @@
|
||||
-- Migration: Create reviews table
|
||||
-- Created: 2025-12-02
|
||||
|
||||
CREATE TABLE IF NOT EXISTS reviews (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
band_id INT NOT NULL,
|
||||
booking_id INT NOT NULL,
|
||||
customer_id INT NOT NULL,
|
||||
rating INT NOT NULL CHECK (rating BETWEEN 1 AND 5),
|
||||
comment TEXT,
|
||||
is_approved BOOLEAN DEFAULT FALSE,
|
||||
is_visible BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (band_id) REFERENCES bands(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (booking_id) REFERENCES bookings(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (customer_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
UNIQUE KEY unique_booking_review (booking_id),
|
||||
INDEX idx_band_id (band_id),
|
||||
INDEX idx_customer_id (customer_id),
|
||||
INDEX idx_rating (rating),
|
||||
INDEX idx_is_approved (is_approved)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
@@ -0,0 +1,16 @@
|
||||
-- Migration: Create band_availability table
|
||||
-- Created: 2025-12-02
|
||||
|
||||
CREATE TABLE IF NOT EXISTS band_availability (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
band_id INT NOT NULL,
|
||||
date DATE NOT NULL,
|
||||
is_available BOOLEAN DEFAULT TRUE,
|
||||
notes VARCHAR(255),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (band_id) REFERENCES bands(id) ON DELETE CASCADE,
|
||||
UNIQUE KEY unique_band_date (band_id, date),
|
||||
INDEX idx_band_id (band_id),
|
||||
INDEX idx_date (date)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
Reference in New Issue
Block a user