# e-MaaS All-in-One Release Pack

This release consolidates the previous e-MaaS starter, the expanded academic/finance modules and the multilingual update into one Laravel source overlay.

## Included product areas

- School operations: dashboard, student and teacher registers, guardian links, daily attendance and notices.
- Academics: examinations, subjects/results, assignments/submissions and timetables.
- Finance: fee invoices, payment ledger and provider webhook integration boundary.
- School services: transport routes and student route assignments.
- Platform foundations: tenant registry, tenant provisioning command, audit log/message models, locale middleware and preferences.
- Internationalisation: 30 selectable locales, Arabic and Urdu RTL direction, browser-language detection, per-user locale persistence, date/currency settings.
- UI: responsive deep-teal theme based on the supplied reference (
  `#003F3D`, `#005653`, `#075653`, `#004744`, `#28A99A`, `#EAF7F5`).

## Languages

English, French, Spanish, German, Arabic, Portuguese, Italian, Dutch, Kiswahili, Hindi, Simplified Chinese, Russian, Afrikaans, isiZulu, isiXhosa, Sesotho, Setswana, siSwati, Tshivenda, Xitsonga, Sepedi, Japanese, Korean, Turkish, Indonesian, Bengali, Urdu, Hausa, Amharic and Yoruba.

The interface dictionary files are in `lang/{locale}/messages.php`. French, Spanish, German, Arabic, Portuguese, Italian, Dutch, Kiswahili, Hindi, Chinese, Russian, Afrikaans, isiZulu and isiXhosa have translated core UI labels. Other locales are selectable and use English fallback for untranslated keys; arrange native-speaker review before commercial release.

## User language preferences

- Middleware order: session must be available before `set.locale`.
- Locale precedence: session choice, saved user preference, browser preference, application default.
- `preferred_locale` is added to the central `users` table by migration `2026_11_09_000002_add_preferred_locale_to_users.php`.
- Arabic and Urdu set `dir=rtl`; RTL stylesheet is loaded by the main layout.

## Install into a fresh Laravel 11 project

1. `composer create-project laravel/laravel emaas`
2. `cd emaas`
3. `composer require stancl/tenancy:^3.9 laravel/sanctum:^4.0`
4. Install Laravel Breeze Blade for authentication: `composer require laravel/breeze --dev && php artisan breeze:install blade && npm install && npm run build`.
5. Merge the folders in this bundle into the Laravel project. Do not overwrite your `.env`, `composer.json`, or existing authentication scaffolding without reviewing differences.
6. Register `App\Http\Middleware\SetLocale::class` as `set.locale` alias in `bootstrap/app.php`. Keep it inside the `web` middleware stack after session middleware.
7. Configure tenancy provider and tenant routes using `docs/TENANCY.md`.
8. Configure `.env`, generate key, set `APP_DEBUG=false`, enforce HTTPS and configure database credentials.
9. Run central migration(s), then run tenant migrations using the tenancy package's tenant migration command.
10. Run `php artisan route:list`, `php artisan migrate:status`, tests, queue worker and scheduler checks before launch.

## Production gate — do not skip

This is a consolidated development source pack, not a certified turnkey production ERP. The current bundle contains model/schema/controller foundations for the modules listed above, but the following must be completed and tested before real schools or payments are onboarded:

- complete create/edit/detail screens and workflow validation for every resource;
- role/permission policies for platform admin, reseller, school admin, teacher, parent and student;
- tenant isolation tests for every query, file, job, notification and payment callback;
- real parent/student account linking and secure portals;
- provider-specific PayFast/Peach checkout, signature verification, idempotency and reconciliation against current merchant documentation;
- email/SMS/WhatsApp delivery adapters and consent/opt-out controls;
- PDF generation and translation review for report cards, statements and invoices;
- backups, restore drills, logging, monitoring, rate limiting and security review;
- database-per-school hosting capacity verification on 20i.

Never trust a browser redirect as proof of payment. Mark an invoice paid only after a verified provider server-to-server notification and reconciliation.
