Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RidmaShehan/univ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mentor - PHP Full-Stack System with Admin Panel

A complete PHP-based content management system converted from a static HTML website, featuring a modern admin panel built with TailAdmin UI (Tailwind CSS).

Features

Frontend

  • ✅ 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)

Admin Panel

  • ✅ 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

Backend

  • ✅ Pure PHP (no frameworks)
  • ✅ MVC-style architecture
  • ✅ PDO database connection
  • ✅ RESTful API endpoints
  • ✅ Component-based structure

Project 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

Database Setup

  1. Create MySQL database:
CREATE DATABASE mentor_admin CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  1. Import the schema:
mysql -u root -p mentor_admin < admin/app/config/database.sql

Or run the SQL file located at: admin/app/config/database.sql

Configuration

  1. Update database credentials in config/database.php:
return [
    'host' => 'localhost',
    'dbname' => 'mentor_admin',
    'username' => 'your_username',
    'password' => 'your_password',
    // ...
];
  1. Update site settings in config/config.php:
define('SITE_NAME', 'Mentor');
define('SITE_URL', 'http://localhost:8000');

Default Admin Credentials

After database setup, default admin user:

  • Username: admin
  • Password: admin123

⚠️ IMPORTANT: Change the default password immediately after first login!

Installation

  1. Clone or download the project
  2. Set up your web server (Apache/Nginx) or use PHP built-in server:
php -S localhost:8000
  1. Configure database connection
  2. Import database schema
  3. Access the site at http://localhost:8000
  4. Access admin panel at http://localhost:8000/admin

API Endpoints

Content API

  • GET /api/content - List all content
  • GET /api/content/{id} - Get single content
  • POST /api/content - Create content
  • PUT /api/content/{id} - Update content
  • DELETE /api/content/{id} - Delete content

Users API

  • GET /api/users - List all users
  • GET /api/users/{id} - Get single user
  • POST /api/users - Create user
  • PUT /api/users/{id} - Update user
  • DELETE /api/users/{id} - Delete user

Settings API

  • GET /api/settings - Get all settings
  • GET /api/settings/{key} - Get single setting
  • POST /api/settings - Create/Update setting

Security Features

  • ✅ Password hashing (bcrypt)
  • ✅ CSRF token protection
  • ✅ SQL injection prevention (PDO prepared statements)
  • ✅ XSS protection (input sanitization)
  • ✅ Session-based authentication
  • ✅ Input validation

Frontend Pages

All pages are now PHP-based and use reusable components:

  • index.php - Home page
  • about.php - About page
  • courses.php - Courses listing
  • course-details.php - Course details
  • trainers.php - Trainers page
  • events.php - Events page
  • pricing.php - Pricing page
  • contact.php - Contact page with form

Admin Panel Features

Dashboard

  • Statistics overview
  • Recent activity
  • Quick actions

Users Management

  • Create, read, update, delete users
  • Role management (admin/editor)
  • User status management

Content Management

  • Create and edit pages
  • Manage courses
  • Manage events
  • Featured image uploads
  • Content status (draft/published/archived)

Settings

  • Site configuration
  • General settings
  • Email settings

Development

Adding New Pages

  1. Create PHP file in root directory
  2. 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'; ?>

Adding API Endpoints

Edit api/index.php and add your route handler.

Adding Models

Create new model in app/Models/ extending base functionality.

Requirements

  • PHP 7.4 or higher
  • MySQL 5.7 or higher
  • Apache/Nginx web server (or PHP built-in server)
  • PDO MySQL extension

License

This project is based on the Mentor Bootstrap template by BootstrapMade.

Support

For issues or questions, please refer to the documentation or create an issue in the repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published