> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laportenard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project structure

> How the monorepo is organized and where to find things.

## Root layout

```
rost_pos_restaurant/
├── nu_pos_react/           # Frontend (Next.js + Tauri)
├── nu_restaurant_pos/      # Odoo 12 addon (Python backend)
├── nu_pos_sync_protocol/   # Shared sync protocol (TypeScript)
├── nu_pos_hub/             # Sync hub (Node.js)
└── version.json            # Single source of truth for client version
```

## Frontend (`nu_pos_react/`)

The frontend follows domain-driven design:

```
src/
├── domain/           # Business logic (pure functions, types)
│   ├── catalog/      # Products, categories, menu hierarchy
│   ├── orders/       # Order models, computations
│   ├── tables/       # Table models
│   ├── users/        # User models, role guards
│   ├── payments/     # Payment models
│   ├── taxes/        # Tax calculations
│   ├── customers/    # Customer models
│   ├── sessions/     # Session models
│   └── stock/        # Stock models
├── features/         # Feature slices (screens, components, hooks)
│   ├── restaurant/   # Floor plan, layout presets, all-zones view
│   ├── sales/        # Order UI
│   ├── settings/
│   ├── management/
│   └── customers/
├── state/            # XState machines + POS reducer
│   └── machines/     # sessionMachine, orderMachine, syncMachine, uiMachine
├── realtime/         # Sync transport, order locks, table locks
├── ui/               # Shared Radix UI components
├── lib/              # API client, utilities
└── i18n/             # Translations (en.json, es.json)
```

<Note>
  Path alias `@/` maps to `src/` — configured in both `tsconfig.json` and `vitest.config.ts`.
</Note>

## Backend (`nu_restaurant_pos/`)

```
nu_restaurant_pos/
├── controllers/
│   ├── api_v1.py           # v1 API gateway (JWT, CORS, routing)
│   ├── bff_auth.py         # JWT token issuance and validation
│   ├── api.py              # Legacy session/config/bootstrap methods
│   ├── api_orders.py       # Order CRUD methods
│   ├── api_payments.py     # Payment methods
│   └── api_customers.py    # Customer methods
├── models/
│   ├── pos_order.py        # Order extensions (NCF, delegation)
│   ├── pos_bootstrap_data.py  # Bootstrap payload builder
│   ├── pos_config.py       # POS configuration extensions
│   ├── account_invoice.py  # Invoice extensions (NCF/DGII)
│   ├── order_audit.py      # Audit logging
│   ├── restaurant_floor.py # Floor layout mode (free/grid/perimeter_center)
│   └── permission_registry.py  # Permission defaults + resolver
├── migrations/             # Version-specific migration scripts
└── i18n/
    └── es.po               # Spanish translations
```

## Versioning

The client version is managed from a single source of truth:

```json title="version.json" theme={null}
{ "version": "X.Y.Z" }
```

The sync script `scripts/sync-version.mjs` stamps this version into `package.json`, `tauri.conf.json`, and `Cargo.toml`. Build numbers are derived from `git rev-list --count HEAD`.

<Info>
  Odoo modules keep their own `__manifest__` versions — `version.json` is for client apps only.
</Info>
