A complete PHP-based content management system converted from a static HTML website, featuring a modern admin panel built with TailAdmin UI (Tailwind CSS).
- ✅ Fully converted from static HTML to PHP
- ✅ Component-based architecture (header, footer, navbar)
- ✅ All pages converted: Home, About, Courses, Trainers, Events, Pricing, Contact
- ✅ Dynamic content loading from database
- ✅ Responsive design (unchanged from original)
- ✅ Modern TailAdmin UI (Tailwind CSS)
- ✅ Session-based authentication
- ✅ Protected admin routes
- ✅ Dashboard with statistics
- ✅ Full CRUD operations:
- Users management
- Content/Pages management
- Settings management
- ✅ File upload support
- ✅ CSRF protection
- ✅ Input validation and security
- ✅ Pure PHP (no frameworks)
- ✅ MVC-style architecture
- ✅ PDO database connection
- ✅ RESTful API endpoints
- ✅ Component-based structure
/
├── public/ # Public entry point
│ └── index.php # Public router
├── admin/ # Admin panel
│ ├── index.php # Admin entry point
│ ├── pages/ # Admin pages
│ ├── components/ # Admin components
│ └── app/ # Admin app structure
├── app/ # Application core
│ ├── Controllers/ # MVC Controllers
│ ├── Models/ # Data models
│ ├── Services/ # Business logic
│ └── Helpers/ # Utility functions
├── api/ # API endpoints
│ └── index.php # API router
├── config/ # Configuration files
│ ├── config.php # Main config
│ └── database.php # Database config
├── includes/ # Frontend components
│ ├── header.php # Site header
│ ├── footer.php # Site footer
│ └── navbar.php # Navigation
├── assets/ # Static assets (CSS, JS, images)
└── forms/ # Form handlers
- Create MySQL database:
CREATE DATABASE mentor_admin CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;- Import the schema:
mysql -u root -p mentor_admin < admin/app/config/database.sqlOr run the SQL file located at: admin/app/config/database.sql
- Update database credentials in
config/database.php:
return [
'host' => 'localhost',
'dbname' => 'mentor_admin',
'username' => 'your_username',
'password' => 'your_password',
// ...
];- Update site settings in
config/config.php:
define('SITE_NAME', 'Mentor');
define('SITE_URL', 'http://localhost:8000');After database setup, default admin user:
- Username: admin
- Password: admin123
- Clone or download the project
- Set up your web server (Apache/Nginx) or use PHP built-in server:
php -S localhost:8000- Configure database connection
- Import database schema
- Access the site at
http://localhost:8000 - Access admin panel at
http://localhost:8000/admin
GET /api/content- List all contentGET /api/content/{id}- Get single contentPOST /api/content- Create contentPUT /api/content/{id}- Update contentDELETE /api/content/{id}- Delete content
GET /api/users- List all usersGET /api/users/{id}- Get single userPOST /api/users- Create userPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user
GET /api/settings- Get all settingsGET /api/settings/{key}- Get single settingPOST /api/settings- Create/Update setting
- ✅ Password hashing (bcrypt)
- ✅ CSRF token protection
- ✅ SQL injection prevention (PDO prepared statements)
- ✅ XSS protection (input sanitization)
- ✅ Session-based authentication
- ✅ Input validation
All pages are now PHP-based and use reusable components:
index.php- Home pageabout.php- About pagecourses.php- Courses listingcourse-details.php- Course detailstrainers.php- Trainers pageevents.php- Events pagepricing.php- Pricing pagecontact.php- Contact page with form
- Statistics overview
- Recent activity
- Quick actions
- Create, read, update, delete users
- Role management (admin/editor)
- User status management
- Create and edit pages
- Manage courses
- Manage events
- Featured image uploads
- Content status (draft/published/archived)
- Site configuration
- General settings
- Email settings
- Create PHP file in root directory
- Include config and components:
<?php
require_once __DIR__ . '/config/config.php';
$pageTitle = 'Page Title';
include __DIR__ . '/includes/header.php';
?>
<!-- Your content here -->
<?php include __DIR__ . '/includes/footer.php'; ?>Edit api/index.php and add your route handler.
Create new model in app/Models/ extending base functionality.
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Apache/Nginx web server (or PHP built-in server)
- PDO MySQL extension
This project is based on the Mentor Bootstrap template by BootstrapMade.
For issues or questions, please refer to the documentation or create an issue in the repository.