<p align="center"><img src="https://coretechno.com.au/wp-content/uploads/2020/08/logo_small.png" width="160" alt="Core Techno logo"></p>

<h1 align="center">We Care Cloud (WCC)</h1>
<p align="center"><b>NDIS SaaS Platform</b> &middot; Powered by Core Techno Pty Ltd</p>

---

## About

**We Care Cloud** is a Laravel 11 SaaS platform built for Australian **NDIS (National Disability Insurance Scheme)** service providers. It is developed and owned by **Core Techno Pty Ltd** and offered as a **subscription-based, white-labeled product** — each NDIS provider runs their own branded instance of WCC under their own identity, while the underlying platform, codebase, and infrastructure are shared and centrally maintained.

The platform covers the full operational chain for an NDIS provider, end to end:

- **Participant management** — onboarding, self-registration referral forms, documents, medication authority records, service agreements, consent forms, goal tracking
- **Shift rostering** — fortnightly rosters, AM/PM/passive night/active night shift types, open shift broadcasting
- **HR & workforce management** — job applications, onboarding, leave, document/certificate expiry tracking, performance appraisals
- **Incident reporting & compliance** — NDIS Commission-ready incident reports, 20+ pre-built compliance forms via FormIO
- **Invoicing & Xero integration** — internal invoicing or Xero sync, payment tracking, payroll calendar alignment
- **Staff training & certification** — training modules, assessments, completion certificates
- **Support worker mobile app** — GPS-verified clock in/out, shift case notes, push notifications
- **Real-time chat & notifications** — powered by Laravel Reverb

### Regulatory context

WCC operates under Australian **NDIS Practice Standards** and **NDIS Quality and Safeguards Commission** requirements, as well as general Australian regulatory obligations (privacy, payroll/Fair Work, accounting standards via Xero). This means compliance behavior — case note enforcement, document/certificate expiry tracking, incident reporting, full audit trails, role-based access control, and two-factor authentication — is a core part of the platform, not an optional feature.

## Tech Stack

| Layer | Technology |
|---|---|
| Backend | PHP 8.2+, Laravel 11 |
| Frontend | Vue 3, Bootstrap 5, CoreUI, built with Vite |
| Real-time | Laravel Reverb (WebSockets) + Laravel Echo |
| Auth | Laravel Passport (OAuth2 API), JWT (`tymon/jwt-auth`), Spatie Permission (RBAC) |
| Forms | FormIO (dynamic compliance forms) |
| PDF / Export | mPDF, Box/Spout (Excel) |
| Accounting | Xero integration |
| Notifications | OneSignal (push), SendGrid (email), SMS |
| Queues / Cache | Redis |

## Getting Started

### Prerequisites

- PHP ^8.2
- Composer
- Node.js + npm
- MySQL (or your configured database)
- Redis (for caching/queues — see `REDIS_IMPLEMENTATION_SUMMARY.md`)

### Setup

```bash
composer install && npm install

php setup-environment.php --app_url=http://localhost --db_database=your_db --db_username=root --db_password=pass --app_debug=true --app_env=development

php artisan key:generate
php artisan migrate && php artisan db:seed
```

See `SETUP_README.md` for full details on the environment setup script, including the PowerShell/Bash helper scripts and available parameters.

### Development

```bash
npm run dev          # Vite dev server (primary build tool)
php artisan serve    # Laravel dev server
```

### Build

```bash
npm run build         # Production Vite build
```

### Testing

```bash
php artisan test                        # All tests
php artisan test --filter=ClassName     # Single test class
php artisan schedule:run                # Trigger scheduled commands manually
php artisan <command-signature>         # Test a specific artisan command
```

## Architecture

### Layer structure

- `app/Http/Controllers/` — Web controllers organized under `Backend/`, `Api/`, `Auth/`, `staff/`, `Settings/`
- `app/Http/Livewire/` — Livewire interactive components
- `app/Models/` — Modern Eloquent models (modular namespace `App\Models\`)
- `app/*.php` (root) — Legacy models that coexist with the `Models` directory
- `app/Services/` — Business logic (Xero, Invoice, RosterV2, StorageDrive)
- `app/Console/Commands/` + `app/Console/Kernel.php` — Scheduled tasks and artisan commands
- `app/Jobs/` — Queued jobs (processed via Laravel queues)
- `routes/web.php` — Web routes; `routes/api.php` — REST API under `/v1` prefix

### Frontend

- Vue 3 + Bootstrap 5 + CoreUI, built via Vite (`vite.config.js`)
- Entry points: `resources/js/app.js`, `resources/js/echo.js`, `resources/sass/app.scss`
- Real-time via Laravel Echo + Laravel Reverb; channel definitions in `routes/channels.php`

### Key integrations

- **Xero** — two configs, `config/xero.php` and `config/xero-laravel-lf.php`, kept in sync for accounting changes
- **FormIO** — dynamic form builder used for compliance forms
- **OneSignal / SendGrid / SMS** — push, email, and SMS notifications

### Scheduler

Centralized in `app/Console/Kernel.php`. Includes roster calculations (every 5 minutes), birthday emails, and token management.

## Documentation

| Topic | File |
|---|---|
| Environment setup | `SETUP_README.md` |
| Seeder import details | `SEEDER_IMPORT_SUMMARY.md` |
| Seeder env options | `database/seeders/README_ENV_SEEDER.md` |
| Marking existing migrations | `database/seeders/README_MARK_MIGRATIONS.md` |
| Redis caching/queue setup | `REDIS_IMPLEMENTATION_SUMMARY.md`, `REDIS_SETUP_TUTORIAL.md` |
| Storage drive integration | `docs/storage-drive.md` |
| Guidance for AI coding agents | `CLAUDE.md` |

## Ownership

We Care Cloud is developed and owned by **[Core Techno Pty Ltd](https://coretechno.com.au)**. This is a private, proprietary, subscription-based product — not licensed for public/open-source use.
