A comprehensive web application for managing events, featuring an admin interface for staff to create and manage events, and a public-facing website for visitors to browse, search, and book tickets for events.
- Secure authentication system with role-based access control (admin and super-admin roles)
- Dashboard with real-time statistics and event metrics
- Event Management: Create, edit, delete, and view events
- Ticket Management: Define multiple ticket types with pricing and quantities
- Reservation Management: View and manage customer reservations
- User Management: Create and manage admin users with different roles
- Image uploads to Cloudinary CDN for event images
- Category Management: Organize events by categories
- Responsive design for desktop and mobile devices
- Event Discovery: Browse upcoming events with filtering options
- Search functionality: Find events by title, location, date, or category
- Event Details: View comprehensive event information
- Online Ticket Booking: Purchase tickets for events
- Reservation Confirmation: Email notifications for bookings
- Responsive design optimized for all devices
- Backend: PHP 8.4
- Database: MySQL 8.0
- Frontend: HTML5, CSS3, JavaScript, AJAX
- Containerization: Docker & Docker Compose
- Image Storage: Cloudinary CDN
- Email Service: SMTP integration
- Testing: PHPUnit for unit and integration testing
.
├── docker/ # Docker configuration
│ ├── Dockerfile
│ ├── docker-compose.yml
│ ├── nginx/ # Nginx configuration
│ └── php/ # PHP configuration
├── src/ # Application source code
│ ├── admin/ # Admin panel files
│ ├── api/ # API endpoints
│ ├── assets/ # CSS, JS, images
│ ├── includes/ # PHP includes
│ │ ├── classes/ # PHP classes
│ │ │ ├── Controllers/
│ │ │ ├── Models/
│ │ │ └── Services/
│ │ ├── config.php
│ │ ├── db.php
│ │ └── helpers.php
│ └── test/ # Unit tests
└── README.md
- Docker and Docker Compose
- Git
- Clone the repository:
git https://github.com/IniBuilds-git/Event-Hub
cd event-hub
- Start the Docker containers:
cd docker
docker-compose up -d
- Access the application:
- Public site: http://localhost:8000
- Admin interface: http://localhost:8000/admin
- phpMyAdmin: http://localhost:8081 (username: admin, password: admin123)
- Admin Panel:
- Email: [email protected]
- Password: password
The application includes unit tests using PHPUnit. To run the tests:
cd src
vendor/bin/phpunit
- Created appropriate model class in
src/includes/classes/Models/
- Created controller in
src/includes/classes/Controllers/
- Implemented API endpoints in
src/api/
- Add frontend views in
src/admin/
orsrc/
- Wrote tests in
src/test/
GET /api/admin/events/get.php
- Get all events (admin)GET /api/admin/events/get.php?id=X
- Get event by ID (admin)POST /api/admin/events/create.php
- Create new event (admin)POST /api/admin/events/delete.php
- Delete event (admin)GET /api/user/events.php
- Get public eventsGET /api/user/event/get-event.php?id=X
- Get public event details
GET /api/admin/reservation/get.php
- Get all reservations (admin)GET /api/admin/reservation/get.php?id=X
- Get reservation by ID (admin)POST /api/admin/reservation/cancel.php
- Cancel reservation (admin)POST /api/user/reservation/create.php
- Create new reservation (public)
This application uses environment variables for configuration. Here's what each variable does:
DB_SERVER
: MySQL server hostnameDB_USERNAME
: MySQL usernameDB_PASSWORD
: MySQL passwordDB_NAME
: Database name
BASE_URL
: The base URL of the applicationADMIN_URL
: The URL for the admin interface
CLOUDINARY_CLOUD_NAME
: Your Cloudinary cloud nameCLOUDINARY_API_KEY
: Your Cloudinary API keyCLOUDINARY_API_SECRET
: Your Cloudinary API secretCLOUDINARY_UPLOAD_PRESET
: Your Cloudinary upload preset
SMTP_HOST
: SMTP server hostnameSMTP_PORT
: SMTP server portSMTP_USER
: SMTP usernameSMTP_PASS
: SMTP passwordSMTP_FROM
: Sender email addressSMTP_FROM_NAME
: Sender name
- All user inputs are sanitized to prevent XSS attacks
- Prepared statements prevent SQL injection
- Password hashing for secure authentication
- Environment variables for sensitive credentials
- CSRF protection for forms
- Role-based access control for admin functions
- Cloudinary for image hosting
- PHPUnit for testing framework
- Docker for containerization