# orderPRO — Codebase Map

**Generated:** 2026-04-26 | **Version:** 3.1.0-dev | **Milestone:** v3.1 Operational Enhancements

## What Is This Project

orderPRO is a **multi-channel order management system** for Polish e-commerce. It aggregates orders from Allegro (OAuth2) and shopPRO platforms, manages shipments via Apaczka and InPost APIs, generates PDF receipts/invoices, sends automated emails, and exposes a REST API for a Windows print client.

## Quick Navigation

| Document | Contents |
|----------|----------|
| [STACK.md](STACK.md) | PHP 8.4, custom framework, PDO, SCSS, PHPUnit, Composer deps |
| [ARCHITECTURE.md](ARCHITECTURE.md) | MVC + Repository + Service layers, modules, routing, data flows |
| [CONVENTIONS.md](CONVENTIONS.md) | Naming, code patterns, security, UI rules (from CLAUDE.md) |
| [TESTING.md](TESTING.md) | PHPUnit 11.5, test patterns, coverage areas |
| [INTEGRATIONS.md](INTEGRATIONS.md) | Allegro, shopPRO, Apaczka, InPost, Email, Print queue |
| [CONCERNS.md](CONCERNS.md) | Tech debt, SonarQube issues, known bugs, performance |

## Key Directories

```
src/Core/           Custom framework (router, PDO, session, logger, CSRF)
src/Modules/        13 feature modules (Orders, Shipments, Accounting, Email, …)
routes/web.php      All ~80 routes in one file
resources/views/    PHP templates organized by module
resources/scss/     SCSS sources → public/assets/css/
database/migrations/ 84 SQL migration files (timestamped)
tests/Unit/         PHPUnit tests for services
.paul/docs/         ARCHITECTURE.md, DB_SCHEMA.md, TECH_CHANGELOG.md
```

## Current State

- **Active phase:** 107 — Automation Email Send Once (planning)
- **Last completed:** Phase 106 — Customer Return Alert (2026-04-22)
- **Total migrations:** 84 (latest: `20260425_000102_create_automation_email_once_deliveries_table`)
- **God classes to watch:** `OrdersRepository` (1221 LOC), `OrdersController` (1187 LOC), `AutomationService` (834 LOC)
