Update docs: compact numbers, Alerte Termene sender, notifications in repo structure

- CLAUDE.md: add compact registry numbers feature, sender name, test mode
- ROADMAP.md: expand 8.03 with compact numbers, icon-only toolbar, test mode
- REPO-STRUCTURE.md: add src/core/notifications/ directory + description
- SYSTEM-ARCHITECTURE.md: add sender name, test mode, group company behavior
- CONFIGURATION.md + DOCKER-DEPLOYMENT.md: NOTIFICATION_FROM_NAME=Alerte Termene

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-11 09:14:39 +02:00
parent dff0bbe97c
commit 0958238b25
6 changed files with 23 additions and 10 deletions
+3 -1
View File
@@ -101,7 +101,7 @@ legacy/ # Original HTML tools for reference
| 1 | **Dashboard** | `/` | 0.1.0 | KPI cards (6), activity feed (last 20), module grid, external tools | | 1 | **Dashboard** | `/` | 0.1.0 | KPI cards (6), activity feed (last 20), module grid, external tools |
| 2 | **Email Signature** | `/email-signature` | 0.1.0 | Multi-company branding, address toggle (BTG/US/SDT), live preview, zoom/copy/download | | 2 | **Email Signature** | `/email-signature` | 0.1.0 | Multi-company branding, address toggle (BTG/US/SDT), live preview, zoom/copy/download |
| 3 | **Word XML Generator** | `/word-xml` | 0.1.0 | Category-based XML gen, simple/advanced mode, ZIP export | | 3 | **Word XML Generator** | `/word-xml` | 0.1.0 | Category-based XML gen, simple/advanced mode, ZIP export |
| 4 | **Registratura** | `/registratura` | 0.5.0 | CRUD registry, dynamic doc types, bidirectional Address Book, threads, backdating, **legal deadline tracking** (6 categories, 18 types), recipient registration, document expiry, **NAS network path attachments** (A/O/P/T drives, copy-to-clipboard), **detail sheet side panel**, **configurable column visibility**, **QuickLook attachment preview** (images: zoom/pan, PDFs: native viewer, multi-file navigation), **email notifications** (Brevo SMTP daily digest, per-user preferences) | | 4 | **Registratura** | `/registratura` | 0.5.0 | CRUD registry, dynamic doc types, bidirectional Address Book, threads, backdating, **legal deadline tracking** (6 categories, 18 types), recipient registration, document expiry, **NAS network path attachments** (A/O/P/T drives, copy-to-clipboard), **detail sheet side panel**, **configurable column visibility**, **QuickLook attachment preview** (images: zoom/pan, PDFs: native viewer, multi-file navigation), **email notifications** (Brevo SMTP daily digest, per-user preferences), **compact registry numbers** (single-letter company badge + direction arrow + plain number) |
| 5 | **Tag Manager** | `/tag-manager` | 0.2.0 | CRUD tags, category/scope/color, US/SDT seeds, mandatory categories, **ManicTime bidirectional sync** | | 5 | **Tag Manager** | `/tag-manager` | 0.2.0 | CRUD tags, category/scope/color, US/SDT seeds, mandatory categories, **ManicTime bidirectional sync** |
| 6 | **IT Inventory** | `/it-inventory` | 0.2.0 | Dynamic equipment types, rented status (purple pulse), **42U rack visualization**, type/status/company filters | | 6 | **IT Inventory** | `/it-inventory` | 0.2.0 | Dynamic equipment types, rented status (purple pulse), **42U rack visualization**, type/status/company filters |
| 7 | **Address Book** | `/address-book` | 0.1.1 | CRUD contacts, card grid, vCard export, Registratura reverse lookup, **dynamic types (creatable)**, **alphabetically sorted type dropdown** | | 7 | **Address Book** | `/address-book` | 0.1.1 | CRUD contacts, card grid, vCard export, Registratura reverse lookup, **dynamic types (creatable)**, **alphabetically sorted type dropdown** |
@@ -135,6 +135,7 @@ Key files:
- `components/deadline-dashboard.tsx` — Stats + filters + table - `components/deadline-dashboard.tsx` — Stats + filters + table
- `components/deadline-add-dialog.tsx` — 3-step wizard (category → type → date preview) - `components/deadline-add-dialog.tsx` — 3-step wizard (category → type → date preview)
- `components/notification-preferences.tsx` — Bell button + dialog with per-type toggles - `components/notification-preferences.tsx` — Bell button + dialog with per-type toggles
- `components/registry-table.tsx``CompactNumber` component: single-letter company badge (B/U/S/G), direction arrow (↓ intrat / ↑ iesit), plain number
### Email Notifications (Brevo SMTP) ### Email Notifications (Brevo SMTP)
@@ -145,6 +146,7 @@ Platform-level notification service for daily email digests:
- **Per-user preferences**: stored in KeyValueStore (`notifications` namespace), toggle global opt-out + 3 notification types - **Per-user preferences**: stored in KeyValueStore (`notifications` namespace), toggle global opt-out + 3 notification types
- **Digest content**: urgent deadlines (<=5 days), overdue deadlines, expiring documents (CU/AC) - **Digest content**: urgent deadlines (<=5 days), overdue deadlines, expiring documents (CU/AC)
- **HTML email**: inline-styled table layout, color-coded rows (red/yellow/blue), per-company grouping - **HTML email**: inline-styled table layout, color-coded rows (red/yellow/blue), per-company grouping
- **Sender**: "Alerte Termene" &lt;noreply@beletage.ro&gt;, test mode via `?test=true` query param
Key files: Key files:
+9 -5
View File
@@ -826,18 +826,22 @@ Env vars (hardcoded in docker-compose.yml for Portainer CE):
--- ---
### 8.03 ✅ `[STANDARD]` Notification System (2026-03-11) ### 8.03 ✅ `[STANDARD]` Notification System + Registratura UI Polish (2026-03-11)
**What:** Email notification system with daily digest via Brevo SMTP + N8N cron. **What:** Email notification system with daily digest via Brevo SMTP + N8N cron. Plus Registratura toolbar and registry number UX improvements.
**Implemented:** **Implemented:**
- Brevo SMTP relay (nodemailer, port 587 STARTTLS) - Brevo SMTP relay (nodemailer, port 587 STARTTLS), sender "Alerte Termene" &lt;noreply@beletage.ro&gt;
- Daily digest email: urgent deadlines, overdue deadlines, expiring documents - Daily digest email: urgent deadlines, overdue deadlines, expiring documents
- Per-user notification preferences (3 types + global opt-out) stored in KeyValueStore - Per-user notification preferences (3 types + global opt-out) stored in KeyValueStore
- API routes: POST `/api/notifications/digest` (N8N Bearer auth), GET/PUT `/api/notifications/preferences` (session auth) - API routes: POST `/api/notifications/digest` (N8N Bearer auth), GET/PUT `/api/notifications/preferences` (session auth)
- UI: Bell button "Notificari" in Registratura toolbar → dialog with toggles - Test mode via `?test=true` query param on digest endpoint
- "group" company users see ALL entries across companies in digest
- UI: Bell icon button "Notificari" in Registratura toolbar → dialog with toggles
- Icon-only toolbar buttons (Bune practici + Notificari) with native `title` tooltips
- HTML email: inline-styled tables, color-coded rows (red/yellow/blue), per-company grouping - HTML email: inline-styled tables, color-coded rows (red/yellow/blue), per-company grouping
- N8N cron: `0 8 * * 1-5` (weekdays 8:00) - N8N cron: `0 8 * * 1-5` (weekdays 8:00)
**Files:** `src/core/notifications/`, `src/app/api/notifications/`, `components/notification-preferences.tsx` - **Compact registry numbers**: single-letter company badge (B=blue, U=violet, S=green, G=gray) + direction arrow (↓ green=intrat, ↑ orange=iesit) + plain number — `CompactNumber` component in `registry-table.tsx`
**Files:** `src/core/notifications/`, `src/app/api/notifications/`, `components/notification-preferences.tsx`, `components/registry-table.tsx`
--- ---
+7
View File
@@ -99,6 +99,11 @@ ArchiTools/
│ │ │ ├── use-theme.ts # Hook for theme access │ │ │ ├── use-theme.ts # Hook for theme access
│ │ │ ├── tokens.ts # Design token definitions │ │ │ ├── tokens.ts # Design token definitions
│ │ │ └── index.ts # Public API │ │ │ └── index.ts # Public API
│ │ ├── notifications/
│ │ │ ├── types.ts # NotificationType, NotificationPreference, DigestSection
│ │ │ ├── email-service.ts # Nodemailer transport singleton (Brevo SMTP)
│ │ │ ├── notification-service.ts # runDigest(), buildCompanyDigest(), preference CRUD
│ │ │ └── index.ts # Public API
│ │ └── auth/ │ │ └── auth/
│ │ ├── auth-provider.tsx # Auth context provider (stub) │ │ ├── auth-provider.tsx # Auth context provider (stub)
│ │ ├── use-auth.ts # Hook for auth state │ │ ├── use-auth.ts # Hook for auth state
@@ -324,6 +329,8 @@ Platform core systems. These are infrastructure services used by all modules. Co
- **`theme/`** — Dark/light theme system. Provides the theme context, toggle hook, and design token definitions. Theme preference is persisted in storage. Tokens define colors, spacing, and typography values consumed by Tailwind and component styles. - **`theme/`** — Dark/light theme system. Provides the theme context, toggle hook, and design token definitions. Theme preference is persisted in storage. Tokens define colors, spacing, and typography values consumed by Tailwind and component styles.
- **`notifications/`** — Email notification service. Daily digest via Brevo SMTP relay (nodemailer, port 587 STARTTLS). Includes `runDigest()` orchestrator, `buildCompanyDigest()` for per-company deadline aggregation, `renderDigestHtml()` for inline-styled email, and preference CRUD via KeyValueStore (`notifications` namespace). API routes: POST `/api/notifications/digest` (N8N cron, Bearer auth), GET/PUT `/api/notifications/preferences` (user session auth).
- **`auth/`** — Authentication and authorization stub. Defines the `AuthContext` interface (`user`, `role`, `permissions`, `company`). Currently returns a default admin user. When Authentik SSO integration is implemented, this module will resolve real identity from OIDC tokens. The interface remains stable; only the provider implementation changes. - **`auth/`** — Authentication and authorization stub. Defines the `AuthContext` interface (`user`, `role`, `permissions`, `company`). Currently returns a default admin user. When Authentik SSO integration is implemented, this module will resolve real identity from OIDC tokens. The interface remains stable; only the provider implementation changes.
### `src/modules/` ### `src/modules/`
+1 -1
View File
@@ -449,7 +449,7 @@ ArchiTools runs alongside existing services on the internal network:
**Automation integration (N8N):** N8N triggers scheduled workflows via API endpoints. Active: daily digest cron calls `POST /api/notifications/digest` with Bearer token auth. Future: document processing, backups. **Automation integration (N8N):** N8N triggers scheduled workflows via API endpoints. Active: daily digest cron calls `POST /api/notifications/digest` with Bearer token auth. Future: document processing, backups.
**Email notifications (Brevo SMTP):** Platform service in `src/core/notifications/`. Nodemailer transport singleton connects to Brevo SMTP relay. `runDigest()` loads all registry entries, groups by company, builds digest per subscriber filtering by their preference types (urgent, overdue, expiry), renders inline-styled HTML, sends via SMTP. Preferences stored in KeyValueStore (namespace `notifications`). **Email notifications (Brevo SMTP):** Platform service in `src/core/notifications/`. Nodemailer transport singleton connects to Brevo SMTP relay. Sender: "Alerte Termene" &lt;noreply@beletage.ro&gt;. `runDigest()` loads all registry entries, groups by company, builds digest per subscriber filtering by their preference types (urgent, overdue, expiry), renders inline-styled HTML, sends via SMTP. Test mode via `?test=true` query param. "group" company users receive digest with ALL entries. Preferences stored in KeyValueStore (namespace `notifications`).
**SSO integration (Authentik):** Authentik OIDC provides user identity. NextAuth v4 JWT/session callbacks map Authentik groups to roles and companies. Notification preferences auto-refresh user email/name/company from session on each save. **SSO integration (Authentik):** Authentik OIDC provides user identity. NextAuth v4 JWT/session callbacks map Authentik groups to roles and companies. Notification preferences auto-refresh user email/name/company from session on each save.
+1 -1
View File
@@ -66,7 +66,7 @@ BREVO_SMTP_PORT=587
BREVO_SMTP_USER= # Brevo SMTP login (from Brevo dashboard) BREVO_SMTP_USER= # Brevo SMTP login (from Brevo dashboard)
BREVO_SMTP_PASS= # Brevo SMTP key (from Brevo dashboard) BREVO_SMTP_PASS= # Brevo SMTP key (from Brevo dashboard)
NOTIFICATION_FROM_EMAIL=noreply@beletage.ro NOTIFICATION_FROM_EMAIL=noreply@beletage.ro
NOTIFICATION_FROM_NAME=ArchiTools NOTIFICATION_FROM_NAME=Alerte Termene
NOTIFICATION_CRON_SECRET= # Random Bearer token for N8N → digest API auth NOTIFICATION_CRON_SECRET= # Random Bearer token for N8N → digest API auth
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
+2 -2
View File
@@ -214,11 +214,11 @@ BREVO_SMTP_PORT=587
BREVO_SMTP_USER=<brevo-login> BREVO_SMTP_USER=<brevo-login>
BREVO_SMTP_PASS=<brevo-smtp-key> BREVO_SMTP_PASS=<brevo-smtp-key>
NOTIFICATION_FROM_EMAIL=noreply@beletage.ro NOTIFICATION_FROM_EMAIL=noreply@beletage.ro
NOTIFICATION_FROM_NAME=ArchiTools NOTIFICATION_FROM_NAME=Alerte Termene
NOTIFICATION_CRON_SECRET=<random-bearer-token> NOTIFICATION_CRON_SECRET=<random-bearer-token>
``` ```
> **N8N cron setup:** Create a workflow with Cron node (`0 8 * * 1-5`), HTTP Request node (POST `https://tools.beletage.ro/api/notifications/digest`, header `Authorization: Bearer <NOTIFICATION_CRON_SECRET>`). The endpoint returns `{ success, totalEmails, errors, companySummary }`. > **N8N cron setup:** Create a workflow with Cron node (`0 8 * * 1-5`), HTTP Request node (POST `https://tools.beletage.ro/api/notifications/digest`, header `Authorization: Bearer <NOTIFICATION_CRON_SECRET>`). The endpoint returns `{ success, totalEmails, errors, companySummary }`. Add `?test=true` query param to send a test digest with sample data.
### Variable Scoping Rules ### Variable Scoping Rules