# Gmind Institute — Computer Education Portal

A complete, production-ready PHP 8.2–8.4 web application for a computer education institute with MVC architecture, responsive design, admin panel, and online exam engine.

## Tech Stack

| Layer       | Technology                                          |
|-------------|-----------------------------------------------------|
| Backend     | PHP 8.2–8.4 (strict_types, match expressions)       |
| Database    | MySQL 8.0+ (InnoDB, utf8mb4_unicode_ci)            |
| Frontend    | Vanilla HTML5 + CSS3 + Vanilla JS (ES2022)          |
| ORM         | Custom PDO-based Model with prepared statements     |
| Routing     | Custom MVC Router with clean URLs (.htaccess)       |
| Auth        | PHP Sessions + password_hash()/password_verify()    |
| Autoloader  | Composer PSR-4                                       |

**No jQuery, no Bootstrap, no frameworks** — all CSS and JS written from scratch.

---

## Colour Palette

| Colour      | Hex       | Usage                    |
|-------------|-----------|--------------------------|
| Navy        | `#1a4fa0` | Primary brand            |
| Scarlet     | `#e84118` | Accent / CTAs            |
| Gold        | `#f39c12` | Highlights / badges      |
| Deep Navy   | `#0d2b6e` | Footer / header dark     |
| Off-White   | `#f4f7fc` | Page background          |

---

## Project Structure

```
gmind-institute/
├── app/
│   ├── Core/
│   │   ├── Controller.php      # Base controller (view, model, json, CSRF)
│   │   ├── Model.php           # Base model (CRUD with prepared statements)
│   │   └── Router.php          # URL routing with middleware
│   ├── Controllers/
│   │   ├── HomeController.php
│   │   ├── CourseController.php
│   │   ├── ExamController.php
│   │   ├── AdmissionController.php
│   │   ├── AuthController.php
│   │   └── ... (10 controllers)
│   ├── Models/
│   │   ├── Slider.php
│   │   ├── Course.php
│   │   ├── Exam.php
│   │   ├── Student.php
│   │   └── ... (17 models)
│   └── Views/
│       ├── layouts/
│       │   ├── header.php      # Top bar + sticky navigation
│       │   └── footer.php      # 4-column footer + copyright
│       ├── home/
│       │   └── index.php       # Home page (12 sections)
│       ├── courses/
│       ├── exam/
│       ├── admission/
│       ├── blog/
│       ├── news/
│       ├── faq/
│       ├── contact/
│       ├── auth/
│       └── pages/
├── admin/
│   ├── Controllers/
│   │   ├── AdminAuthController.php
│   │   ├── DashboardController.php
│   │   ├── AdminSliderController.php
│   │   ├── AdminCourseController.php
│   │   └── ... (11 controllers)
│   └── Views/
│       ├── layout.php          # Admin sidebar layout
│       ├── dashboard.php
│       ├── sliders.php
│       ├── courses.php
│       └── ... (10 admin views)
├── config/
│   ├── database.php            # PDO singleton
│   ├── app.php                 # Constants, helpers, CSRF
│   └── auth.php                # Auth functions
├── database/
│   ├── schema.sql              # 19 tables with FK + indexes
│   └── seeds/
│       └── seed_data.sql       # Sample data for all tables
├── public/
│   ├── index.php               # Front controller
│   ├── css/
│   │   ├── style.css           # Main stylesheet (2300+ lines)
│   │   ├── inner-pages.css     # Inner page styles
│   │   └── admin.css           # Admin panel styles
│   ├── js/
│   │   ├── main.js             # Frontend JS (839 lines)
│   │   └── admin.js            # Admin JS
│   ├── images/                 # Image directories
│   └── uploads/                # User uploads
├── routes/
│   └── web.php                 # All route definitions
├── .htaccess                   # URL rewriting
├── public/.htaccess            # Front controller rewrite
└── composer.json               # PSR-4 autoloading
```

---

## Installation

### Prerequisites
- PHP 8.2+
- MySQL 8.0+
- Apache with mod_rewrite enabled
- Composer

### Setup Steps

1. **Clone/Copy** the project to your web server directory
   ```bash
   cp -r gmind-institute /var/www/html/
   ```

2. **Install dependencies**
   ```bash
   cd gmind-institute
   composer install
   ```

3. **Create the database**
   ```bash
   mysql -u root -p
   CREATE DATABASE gmind_institute CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
   EXIT;
   ```

4. **Run schema & seed**
   ```bash
   mysql -u root -p gmind_institute < database/schema.sql
   mysql -u root -p gmind_institute < database/seeds/seed_data.sql
   ```

5. **Configure database** — Edit `config/database.php` with your credentials

6. **Set permissions**
   ```bash
   chmod -R 755 public/images/
   chmod -R 755 public/uploads/
   chown -R www-data:www-data public/uploads/
   ```

7. **Configure Apache** — Point DocumentRoot to the project root with `.htaccess` override enabled

8. **Access the site**
   - Frontend: `http://your-domain.com/`
   - Admin: `http://your-domain.com/admin`
   - Default admin: `admin@gmind.in` / `Admin@123`

---

## Home Page Sections

1. **Hero Slider** — Auto-playing, touch-swipe, 5 slides with overlay
2. **Announcement Marquee** — CSS animated scrolling news bar
3. **Stats Counter** — Animated numbers (students, courses, branches, years)
4. **Popular Courses** — Filter tabs + course cards with category badges
5. **Why Choose Us** — 6 feature boxes with alternating icon colours
6. **Latest Branches** — 4-column grid with horizontal scroll on mobile
7. **Affiliations & Partners** — Auto-scrolling greyscale logo strips
8. **Toppers** — Gold/silver/bronze bordered student cards
9. **Branch News** — 3-column news cards with branch badges
10. **FAQ Accordion** — CSS-only `<details>/<summary>` with chevrons
11. **Testimonials** — Auto-playing carousel with star ratings
12. **Footer** — 4-column grid + copyright bar

---

## Admin Panel Features

- **Dashboard** — Stats overview, recent contacts, quick actions
- **Sliders** — Full CRUD with image upload, sort order
- **Courses** — Full CRUD with categories, fee, duration
- **Branches** — Full CRUD with map links
- **FAQs** — Full CRUD with show_on_home toggle
- **Testimonials** — Approve/reject pending reviews
- **Students** — View, edit, manage enrollment status
- **Exams** — Create exams, add MCQ questions, view results
- **Settings** — Site-wide configuration (stats, social, contact)

---

## Security Features

- `declare(strict_types=1)` on every PHP file
- CSRF tokens on every POST form
- `password_hash()`/`password_verify()` for all passwords
- `htmlspecialchars()` + `filter_var()` on all inputs
- PDO prepared statements only — never raw queries
- Session fixation prevention on login
- `hash_equals()` for CSRF token comparison

---

## Contact

**Gmind Institute**  
📞 9305640290  
✉️ info@gmind.in
