# Inveetaire

**Wedding Management Platform** — One Wedding. One Workspace. Everyone Aligned.

A professional, multi-tenant wedding operations platform built for the Indonesian market.
Inveetaire unifies guest management, digital invitations, RSVP collection, vendor tracking, and wedding day check-in into a single operational workspace.

---

## Technology Stack

| Layer | Technology |
|-------|-----------|
| Backend | Native PHP 7.4 |
| Database | MariaDB / MySQL |
| Frontend | HTML5, TailwindCSS, Alpine.js, FontAwesome |
| Hosting | Apache / cPanel Shared Hosting |

---

## Project Structure

```
inveetaire/
│
├── app/                        # Application code — NOT web-accessible
│   ├── modules/                # Product modules (Auth, Guest, Vendor, etc.)
│   ├── core/                   # Framework kernel (Router, Bootstrap, Base classes)
│   ├── middleware/             # HTTP middleware (Auth, CSRF, Role, Workspace, Guest)
│   ├── helpers/                # Pure utility functions (env, config, date, string)
│   ├── services/               # Cross-module shared services
│   └── views/
│       ├── layouts/            # Master page templates (admin, couple, crew, public)
│       ├── components/         # Reusable UI fragments (nav, flash, pagination, modals)
│       └── errors/             # Error pages (403, 404, 500, maintenance)
│
├── config/                     # Configuration files — read from .env
│
├── routes/                     # Route definitions only (public, couple, crew, admin, support)
│
├── public/                     # Web root — the ONLY directory exposed to the web
│   ├── index.php               # Front controller — single entry point for ALL requests
│   └── assets/
│       ├── css/                # TailwindCSS stylesheets
│       ├── js/                 # Alpine.js + application scripts
│       └── fonts/              # Web fonts
│
├── storage/                    # Runtime files — NOT web-accessible
│   ├── uploads/                # Couple-uploaded media (workspace-scoped)
│   ├── exports/                # Temporary Excel/CSV exports
│   ├── reports/                # Generated post-event reports
│   ├── cache/                  # File-based cache
│   ├── logs/                   # Application error logs (daily rotation)
│   └── sessions/               # PHP session files
│
├── themes/                     # Invitation theme packages
│   └── klasik-putih/           # Default theme (created in Sprint 4)
│
├── docs/                       # Project documentation
│   └── ai/                     # AI assistant governance documents
│
├── .env.example                # Environment variable template (committed)
├── .env                        # Local environment values (NOT committed)
├── .gitignore
└── README.md
```

---

## Getting Started

### Prerequisites
- PHP 7.4+ with extensions: `pdo_mysql`, `mbstring`, `gd`
- MariaDB / MySQL 10.3+
- Apache with `mod_rewrite` enabled

### Setup

1. Clone the repository
2. Copy `.env.example` to `.env` and fill in your local values:
   ```bash
   cp .env.example .env
   ```
3. Create the database and run migrations (see `docs/`)
4. Point your web server / Apache VirtualHost to the `public/` directory
5. Ensure `storage/` is writable by the web server

---

## Architecture Principles

- **Modular MVC** — 17 modules, each self-contained
- **Thin Controllers** — receive, validate, delegate, respond (≤ 20 lines per method)
- **Fat Services** — all business logic lives in Service classes
- **Workspace Isolation** — every query scoped to `workspace_id`; no cross-workspace access ever
- **Parameterized PDO** — no string-concatenated SQL
- **Soft Delete** — guests, vendors, and events are soft-deleted; historical records preserved
- **Append-Only Audit Log** — `audit_logs` table is INSERT-only at DB user level

---

## User Roles

| Role | Portal | Purpose |
|------|--------|---------|
| Super Admin | `/app/admin/` | Platform management, workspace provisioning |
| Couple | `/app/couple/` | Wedding planning workspace |
| Event Crew | `/app/crew/` | Wedding day check-in only |
| Guest | `/{slug}/invite/{code}` | No account — URL is identity |

---

## Documentation

All project documentation lives in `docs/`. Read in this order:

1. `docs/ai/AI.md` — AI development constitution
2. `docs/ai/PROJECT.md` — Product overview
3. `docs/ai/WORKFLOW.md` — Development workflow
4. `docs/ai/IMPLEMENTATION_ROADMAP.md` — Sprint sequence
5. `docs/Inveetaire_PRD_v1.1.docx` — Product Requirements
6. `docs/Inveetaire_SAD_v1.1_FINAL.docx` — System Architecture
7. `docs/Inveetaire_MIB_v1.0.docx` — Master Implementation Backlog

---

## License

Private — All rights reserved. © Inveetaire
