Compare commits

..
3 Commits
Author SHA1 Message Date
kiskaadee 1c5f946cec Merge pull request 'chore(dashboard): add NixOS flake.nix devShell and refine AGENTS.md blueprint' (#3) from chore/operational-truth-docs into main 2026-10-19 00:14:34 -05:00
kiskaadee 3f1ab11a5d docs(dashboard): refine AGENTS.md technical blueprint and align README with 48h follow-up workflow
- Strip duplicated workspace git/session rules from AGENTS.md and establish local pnpm + Vite+ + Biome gates.
- Document 48-hour follow-up queue, payment acknowledgment, delayed-payment authorization, and slot release in README.md.

Refs: #1
2026-10-19 00:10:35 -05:00
kiskaadee 70ee56848a build(nix): add declarative flake.nix devShell with nodejs_22, pnpm, biome, and tea
Refs: #1
2026-10-19 00:10:35 -05:00
6 changed files with 144 additions and 39 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
use flake
+2 -1
View File
@@ -14,7 +14,8 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
# Editor # Editor / Nix direnv
.vscode/ .vscode/
.idea/ .idea/
*.swp *.swp
.direnv/
+32 -22
View File
@@ -1,35 +1,45 @@
# Armonía del Ser: Admin Dashboard - Agent Guidelines & Workflow Rules # Repository Technical Blueprint: `armonia-dashboard`
This document specifies mandatory workflows, constraints, and quality gates for AI agents operating in `armonia-dashboard`. This file defines the local toolchain, frontend implementation rules, UX invariants, and security boundaries for `armonia-dashboard`. For cross-repo Git branching rules, TDD lifecycle, or Gitea (`tea`) issue tracking, consult the workspace root [`../AGENTS.md`](../AGENTS.md).
--- ---
## 1. Core Operating Constraints ## 1. Local Toolchain & Nix Environment (`flake.nix` + `pnpm` + `Vite+` + `Biome`)
- **No Direct Commits to `main`**: Agents must never commit directly to `main`. All work must be developed on descriptive feature, bugfix, or chore branches (`feat/*`, `fix/*`, `chore/*`). This repository is provisioned via a declarative Nix `devShell` (`flake.nix` + `.envrc`) and uses `pnpm`, `Vite+` (`vp`), and `Biome`.
- **No Destructive Git Actions**: Commands such as `git reset --hard`, `git restore <file>`, `git clean -fd`, and force-pushes (`git push --force`) are strictly prohibited without the user's explicit yes. - **Nix DevShell:** Ensure commands run inside the Nix environment (`direnv` activates automatically on `cd`, or prefix with `nix develop -c <cmd>`).
- **Secret Redaction**: Never print, commit, or log sensitive tokens or API credentials. - **Package Manager:** Use `pnpm` exclusively (`pnpm install`, `pnpm add`). Never use `npm` or `yarn` (do not generate `package-lock.json` or `yarn.lock`).
- **Session Modes**: - **Verification Gates (Pre-Commit Checklist):**
- `learning`: The user drives and writes the reasoning, the agent asks guiding questions. Before proposing or executing any commit, run and pass all checks with zero warnings or errors:
- `delivery`: The agent may draft code and plans, presenting rationale and trade-offs. ```bash
pnpm exec biome check .
pnpm exec vp check
pnpm exec vp test
```
--- ---
## 2. Agent Directory & Persona Delegation ## 2. Frontend Architecture & Persona Delegation
- **Anne Droid** (`profile/agents/anne-droid.md`): Senior Frontend Engineer & UX Specialist. ### Anne Droid Delegation (`profile/agents/anne-droid.md`)
- **Consult when**: Designing or reviewing mobile ergonomics, accessible form components, and booking state transitions. - **Consult when:** Designing or reviewing mobile ergonomics, accessible form controls, and operator workflows for booking/payment state transitions.
- **Delegate when**: Implementing UI components, Tailwind styling, and client-side interactions on `feat/anne/*` branches. - **Delegate when:** Implementing UI components, Tailwind CSS styling, HTMX/Vite+ client interactions, and frontend tests on `feat/anne/*` branches.
- **Anti-"Zombie UI" Invariant**: Every view must explicitly design for the 5 states: *Empty*, *Loading*, *Error*, *Partial*, and *Success*. Touch targets must be >= 44x44px for thumb use on mobile devices.
### UI & UX Invariants
- **5-State Resilient UI (Anti-"Zombie UI"):** Every operator view and interactive control must explicitly handle all 5 states: *Empty*, *Loading*, *Error*, *Partial* (e.g., booking saved in Turso but Google Calendar sync `FAILED`), and *Success*.
- **Mobile Ergonomics:** Designed mobile-first for Jasmin and her assistant operating on smartphones. All interactive touch targets must be $\ge 44\times 44\text{px}$ with zero layout shift.
### Security & API Boundary
- **Zero Client Secrets:** Never embed Google OAuth client secrets, Turso tokens, or session signing keys in frontend code or `VITE_*` environment variables. All authentication and `admin_allowlist` checks are enforced server-side by `armonia-api`.
--- ---
## 3. Architecture & Functional Directives ## 3. Core Operator Views & Functional Scope
- **Primary Persona**: Jazmín (therapist and business owner). 1. **Cola de Seguimiento (48h) & Pagos Pendientes:** Surfaces `RESERVED` bookings within 48 hours where `payment_status = 'AWAITING_ACKNOWLEDGMENT'` (plus any unpaid `DELAYED_ALLOWED` exceptions), providing 1-tap `wa.me` follow-up links and explicit operator actions:
- **Core Ergonomic Requirement**: **Mobile-first**. Jazmín checks her banking app (BBVA) on her phone to see incoming SPEI notifications, then switches to the dashboard to tap "Acreditar Pago" in one touch. - **Acreditar Pago (`ACKNOWLEDGED`)**
- **Key Views**: - **Autorizar Pago Diferido (`DELAYED_ALLOWED`)**
1. *Agenda & Reservas*: Live list of pending vs confirmed bookings with filter toggles. - **Liberar Espacio (`RELEASED`)**
2. *Validación de Pagos*: Fast-action review queue for incoming SPEI deposits matching folios (`ADS-XXXX`). 2. **Agenda & Sincronización con Google Calendar:** Displays unified booking (`booking_status`) and payment (`payment_arrangement`, `payment_status`) truth alongside Google Calendar sync status (`SYNCED` vs `FAILED` with 1-tap retry).
3. *Directorio de Clientes*: Searchable directory with direct `wa.me` WhatsApp contact links. 3. **Control de Paquetes & Asistencia:** Multi-session package progress tracker (e.g., `8 de 10`) and group workshop roster check-in.
4. *Catálogo de Servicios*: Configuration of prices, schedules, and capacity. 4. **Catálogo de Servicios:** Administrative management of service modalities (`PRESENCIAL` / `ONLINE`), capacities, buffers, and MXN pricing.
+23 -16
View File
@@ -1,26 +1,26 @@
# Armonía del Ser: Admin Dashboard (`armonia-dashboard`) # Armonía del Ser: Admin Dashboard (`armonia-dashboard`)
Mobile-first operational dashboard for **Jazmín**, owner of **Armonía del Ser**. Mobile-first operational control surface for **Jasmin**, owner of **Armonía del Ser**, and her assistant.
Designed to streamline schedule coordination, client directory tracking, and instant 1-tap SPEI payment acknowledgment without friction. Designed to provide single-source-of-truth visibility into bookings, 48-hour payment follow-ups, delayed-payment exceptions, deliberate slot releases, and Google Calendar coordination.
--- ---
## The Operational Problem Solved ## The Operational Problem Solved
Currently, Jazmín coordinates bookings via manual chat messages and allows clients to pay after sessions, leading to lost revenue when clients stop responding. `armonia-dashboard` equips Jasmin and her assistant with an authenticated (`Google OAuth` + server-side Turso allowlist), mobile-optimized control surface where they can:
1. **Monitor the 48-Hour Payment Follow-Up Queue**: View active bookings within 48 hours of their session (or with authorized delayed payments) whose payments have not yet been acknowledged, and contact clients manually via 1-tap `wa.me` links.
`armonia-dashboard` equips Jazmín with a dedicated, mobile-optimized tool where she can: 2. **Acknowledge Payments (`ACKNOWLEDGED`)**: Record verified SPEI/cash deposits with full auditability (`acknowledged_by`, `acknowledged_at`).
1. **Acknowledge Payments in 1 Tap**: When an SPEI deposit notification appears in her banking app matching a reservation folio (`ADS-XXXX`), she taps "Confirmar Pago" to transition the booking from `PENDING_PAYMENT` to `CONFIRMED`. 3. **Authorize Delayed-Payment Exceptions (`DELAYED_ALLOWED`)**: Explicitly allow a session to proceed without prepayment while keeping the outstanding balance visible and traceable.
2. **Synchronize with Google Calendar**: View locked-in sessions alongside tentative holds. 4. **Deliberately Release Slots (`RELEASED`)**: Release an unconfirmed slot after manual follow-up so another client can book the time.
3. **Contact Clients Directly**: One-touch WhatsApp triggers (`wa.me`) to send session reminders or meeting links. 5. **Coordinate with Google Calendar**: Inspect schedule synchronization status (`SYNCED` vs `FAILED`) and retry failed calendar syncs.
4. **Manage Services**: Adjust pricing, schedules, and capacity limits (e.g., Círculos de Cacao, Meditaciones con cuencos, Atención Psicológica).
--- ---
## Architectural Principles ## Architectural Principles
- **Zero-Cost Deployment**: Designed for **Cloudflare Pages** (static edge delivery, $0/month). - **Zero-Cost Deployment**: Designed for **Cloudflare Pages** (static edge delivery, $0/month).
- **Server-Enforced Security**: OAuth credentials and session signing secrets live strictly in `armonia-api`, verified on every request against Turso's `admin_allowlist`.
- **Mobile Ergonomics**: Large touch targets (minimum 44x44px), thumb-friendly layout, and zero layout shift. - **Mobile Ergonomics**: Large touch targets (minimum 44x44px), thumb-friendly layout, and zero layout shift.
- **5-State Resilient UI**: Every component handles *Empty*, *Loading*, *Error*, *Partial*, and *Success* states gracefully. - **5-State Resilient UI**: Every component handles *Empty*, *Loading*, *Error*, *Partial*, and *Success* states gracefully.
@@ -29,22 +29,29 @@ Currently, Jazmín coordinates bookings via manual chat messages and allows clie
## Local Development Quickstart ## Local Development Quickstart
### Prerequisites ### Prerequisites
- Node.js 20+ - NixOS / Nix Flakes (`direnv` recommended) or Node.js 22+ & `pnpm`
- npm
### 1. Setup Environment ### 1. Enter Nix DevShell & Setup Environment
```bash ```bash
direnv allow # or: nix develop
cp .env.example .env cp .env.example .env
``` ```
Set `VITE_API_BASE_URL=http://localhost:8000` to connect to `armonia-api`. Set `VITE_API_BASE_URL=http://localhost:8000` to connect to `armonia-api`.
### 2. Install Dependencies ### 2. Install Dependencies
```bash ```bash
npm install pnpm install
``` ```
### 3. Run Dev Server ### 3. Run Dev Server (`Vite+`)
```bash ```bash
npm run dev pnpm exec vp dev
``` ```
Open `http://localhost:5173` in your browser. Open `http://localhost:5173` in your browser.
### 4. Verification Gates
```bash
pnpm exec biome check .
pnpm exec vp check
pnpm exec vp test
```
Generated
+61
View File
@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1791914995,
"narHash": "sha256-Zf/xfQEAasnwnmEfHqW/4hjDE/s44yn2hD4RuVIZRjA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b7a79d3fea1e214f6d668d521cecec0c01e26544",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1792094642,
"narHash": "sha256-zp8ToDMnqZcu4o4IH9pdwXFXGp7yLm/M0dEnNWnyd7I=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fe13242281a67641c0102cdb1087f0ebe586c7df",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+25
View File
@@ -0,0 +1,25 @@
{
description = "Armonía del Ser: Admin Dashboard (armonia-dashboard) — Node.js 22 + pnpm + Biome devShell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
name = "armonia-dashboard-dev-shell";
packages = with pkgs; [
nodejs_22
pnpm
biome
tea
];
};
});
}