# CIX Orbit Academy

**Learn. Build. Automate. Grow.** | AI Skills for the New Economy.

A complete standalone PHP/MySQL Learning Management System (LMS) built for CIX Orbit Academy by CIX Connect.

## Features

- **Public Website** - Landing page, course catalogue, pricing, application form
- **Student Portal** - Dashboard, courses, lessons, tests, certificates, payments
- **Teacher Portal** - Course management, lesson creation, question bank, marking, reports
- **Admin Backend** - Full management of students, courses, assessments, payments, certificates, settings
- **CBT System** - Computer-Based Testing with question banks, timed tests, auto-marking, anti-cheat
- **Certificate System** - PDF generation with QR verification, public verification page
- **Payment Workflow** - Manual EFT, proof of payment upload, finance approval
- **PWA Support** - Installable on mobile devices, offline lesson viewing
- **AI Integration** - Optional AI providers for question generation, summaries, study assistant
- **Multi-Theme** - 22+ themes with CSS variables, role-based default themes
- **Full Reporting** - PDF reports, CSV export, analytics dashboards

## Tech Stack

- PHP 8.1+
- MySQL / MariaDB
- PDO database layer
- Bootstrap 5 responsive UI
- PHPMailer for SMTP (bundled)
- mPDF for PDF generation (bundled)
- QR code generation for certificates (bundled)
- Vanilla JavaScript
- PWA support with service worker
- All third-party libraries included - no Composer required

## Installation

### Requirements

- PHP 8.1 or higher
- MySQL 5.7+ or MariaDB 10.3+
- Apache with mod_rewrite enabled (or equivalent URL rewriting)

### Shared Hosting Installation

No SSH or Composer required. Upload and go.

1. Upload all project files to your hosting directory
2. Ensure `/storage`, `/public/uploads`, and `/config` are writable by the web server
3. Open `https://yourdomain.com/install/` in your browser
4. Complete the 8-step setup wizard:
   - **Step 1** - Welcome and overview
   - **Step 2** - System requirements check
   - **Step 3** - Folder permissions check
   - **Step 4** - Database setup (enter MySQL credentials)
   - **Step 5** - Import database tables and seed data
   - **Step 6** - Academy profile (name, URL, slogan, theme)
   - **Step 7** - Banking details confirmation
   - **Step 8** - Create super admin account
5. The installer creates config files, imports tables, creates admin, and locks itself
6. Login at `https://yourdomain.com/login`

### Developer Mode (Optional)

Composer may be used by developers who want to manage dependencies:

```bash
composer install --no-dev --optimize-autoloader
```

This is **not required** for production deployment. All required libraries are bundled in the `/vendor` directory.

### Default Banking Details (Seeded)

| Bank | Account Name | Account Number | Branch Code |
|------|-------------|---------------|-------------|
| Standard Bank | CIX CONNECT | 10200349927 | 051001 |
| Capitec Business | CIX CONNECT | 1051396964 | 450105 |
| ABSA | CIX CONNECT | 4123963036 | 632005 |

## Student Number Format

`COA-YYYY-000001` (e.g., COA-2026-000001)

## Certificate Number Format

`COA-CERT-YYYY-000001` (e.g., COA-CERT-2026-000001)

## Directory Structure

```
/cix-orbit-academy
  /app
    /Controllers    - Application controllers
    /Models         - Data models and repositories
    /Views          - PHP view templates
    /Helpers        - Helper functions
    /Middleware      - Auth and other middleware
    /Services       - Business logic services
    /Libraries      - Bundled compatibility libraries
    bootstrap.php   - Production bootstrap (no Composer required)
  /config           - Configuration files
  /database         - SQL schema and seed files
  /install          - Installation wizard (browser-based)
  /public           - Web root (index.php, assets, uploads)
  /storage          - Logs, cache, certificates, reports, backups
  /themes           - Theme CSS files
  /vendor           - Bundled third-party libraries (pre-installed)
  composer.json     - Optional for developers only
  README.md
```

## Security

- Password hashing with bcrypt
- CSRF protection on all forms
- Prepared statements (PDO) for all queries
- Input validation and XSS prevention
- Role-based access control
- Login throttling and account locking
- Audit logging for all admin actions
- Secure file upload validation
- Installer lock after setup

## Contact

- **Academy**: CIX Orbit Academy
- **Company**: CIX Connect
- **Website**: https://cixconnect.co.za
- **Academic Email**: academic@cixconnect.co.za
- **Office**: 012 004 0207
- **WhatsApp**: 083 759 8075

## License

Proprietary - CIX Connect. All rights reserved.

## Note for Developers

This project bundles all required third-party libraries in the `/vendor` directory for shared-hosting deployment. If you are a developer and prefer to manage dependencies via Composer:

```bash
composer install --no-dev --optimize-autoloader
```

This will use the packages defined in `composer.json` and regenerate `vendor/`. The bundled vendor folder works as-is without running this command.
