# CMMSchool Short Project Docs (CI4)

This is a concise reference for the `cmmschoolupgrade` project.

## What this project is

`cmmschoolupgrade` is a CodeIgniter 4 school-management portal migrated from a CI3 system (`cmmschoolold`) with database parity in progress.

Primary domains:

- Teacher and unified-role workflows (`tp/te`, `tp/ur`, `tp/quests`, `tp/messages`)
- Parent access and portal (`tp/pa`, `tp/pp`)
- Student enrollment and fees (`tp/studentEnrollment`, `tp/payment`, Stripe webhook)
- Admin and school-owner modules (`admin/*`)

## Stack

- PHP `^8.1` (composer platform pin currently `8.4.18`)
- CodeIgniter 4 (`codeigniter4/framework`)
- MySQL (mysqli)
- Stripe (`stripe/stripe-php`)
- PhpSpreadsheet (`phpoffice/phpspreadsheet`)
- PHPUnit 10

## Key folders

```text
app/        Controllers, Models, Config, Views, Libraries
public/     Web root (index.php, assets, registration_paper_form PDFs)
writable/   Logs, cache, sessions, uploads
tests/      PHPUnit tests
docs/       Project and migration documentation
spark       CodeIgniter CLI
```

## Quick start

```bash
composer install
cp .env.example .env
php spark serve
```

Then configure `.env` (DB, `app.baseURL`, email, Stripe keys, webhook secret).

## Core routes (high-level)

- `tp/te/*` teacher authentication
- `tp/ur/*` unified-role dashboard and class flows
- `tp/pp/*` parent portal
- `tp/studentEnrollment/*` enrollment flow
- `tp/payment/*` Stripe checkout flow
- `POST /webhook/stripe` Stripe webhook callback
- `admin/*` admin back office modules

## Day-to-day commands

```bash
php spark list
php spark serve
composer test
php spark cache:clear
```

## Migration status

Project is mid-migration from CI3 to CI4. Some legacy-compatible routes may map to placeholders while modules are ported.

Primary migration source:

- [MIGRATION.md](MIGRATION.md)

## Where to read more

- Full docs index: [README.md](README.md)
- Architecture: [ARCHITECTURE.md](ARCHITECTURE.md)
- Environment variables: [ENVIRONMENT.md](ENVIRONMENT.md)
- Testing guide: [UNIT-TESTING.md](UNIT-TESTING.md)
- Payments: [payment-gateway.md](payment-gateway.md)
