# ERP Foundation System — Ready-to-Run (XAMPP)

Complete CodeIgniter 4 application, framework included — just extract,
create a database, migrate, seed, and log in. No `composer install` step.

**👉 Start here: `docs/00-xampp-quickstart.md`**

Pre-configured for `http://localhost/enterprise/`.

## What's built so far

1. ✅ **Authentication** — login, logout, forgot/reset/change password,
   remember-me, session tracking + idle timeout, login rate limiting +
   account lockout, active-session management with force-logout-other-
   devices, login history, 2FA architecture (schema ready, OTP delivery
   deferred).
2. ✅ **User Management** — full CRUD, search/filter/pagination, avatar
   upload, activate/deactivate, soft delete/restore, admin-initiated
   password reset, online-status + last-login display.
3. ✅ **Roles & Permissions** — role CRUD, permission catalog grouped by
   module, visual permission matrix (view/create/edit/delete/export/
   print/approve × module), real per-route enforcement everywhere
   (including retrofitted onto User Management).

Every module's `docs/0N-*.md` file has full details, security notes, and
a manual test checklist.

## Default login

After running the seeder (`docs/00-xampp-quickstart.md`, step 4):

- Username: `admin`
- Password: printed once by the seeder — copy it immediately, it won't be shown again.

You'll be forced to change it on first login.

## Project layout

This is a full, standard CodeIgniter 4 project — `app/`, `public/`,
framework code inside `vendor/codeigniter4/framework`, `writable/`,
`spark`, etc. The custom work lives in:

```
app/Modules/{Auth,Users,Roles}/    Each module's Controllers, Models,
                                     Services, Views, Filters, Routes
app/Config/{Auth,Uploads}.php       Module configuration
app/Models/                          Shared cross-module models
app/Database/{Migrations,Seeds}/    All schema + seed data
app/Views/{layouts,partials}/       Shared app shell (sidebar, navbar,
                                     dark mode, light mode)
public/assets/                       CSS/JS for the admin panel UI
docs/                                 Setup guides + test checklists
```

## Build order — what's next

4. ⬜ Company Settings
5. ⬜ Branch Management (full CRUD — table already exists)
6. ⬜ Department Management (full CRUD — table already exists)
7. ⬜ Dashboard (real widgets — placeholder page exists)
8. ⬜ Notifications
9. ⬜ Activity Logs UI (table already exists and is being written to by every module)
10. ⬜ Audit Logs
11. ⬜ System Settings
12. ⬜ File Manager

Just ask for the next module and it'll build directly on top of this same
codebase.
