diff --git a/CLAUDE.md b/CLAUDE.md index 7a56538..39758ce 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,9 +4,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## πŸš€ Project Overview -**ROA2WEB** - Modern ERP Reports Application with FastAPI backend, Vue.js frontend, and Telegram bot interface using microservices architecture. +**ROA2WEB** - Modern ERP Application with two main modules: +1. **Reports App** (`reports-app/`) - Read-only reports from Oracle (raportΔƒri) +2. **Data Entry App** (`data-entry-app/`) - Data input with approval workflow (introduceri date) -**Active Branch**: `v2-roa2web-fastapi` **Main Branch**: `main` (use for PRs) **Working Directory**: Repository root @@ -14,21 +15,68 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co --- +## πŸ“ Application-Specific Instructions + +> **IMPORTANT**: When working on a specific application, ALWAYS read its dedicated CLAUDE.md first! + +| Application | CLAUDE.md Location | Description | +|-------------|-------------------|-------------| +| **Data Entry** | `data-entry-app/CLAUDE.md` | Bonuri fiscale, chitanΘ›e, workflow aprobare | +| **Reports** | This file (below) | Rapoarte Oracle read-only | +| **Telegram Bot** | `reports-app/telegram-bot/README.md` | Bot Telegram | + +### When to Use Which Instructions + +**Working on `data-entry-app/`**: +β†’ **FIRST read `data-entry-app/CLAUDE.md`** for: + - SQLModel + Alembic patterns (NOT Oracle) + - SQLite database (NOT Oracle pool) + - Workflow states (DRAFT β†’ PENDING β†’ APPROVED) + - Receipt/Attachment/AccountingEntry models + - Expense types and auto-generation logic + +**Working on `reports-app/` or `shared/`**: +β†’ Use instructions from this file (below) + +**Working on shared components** (`shared/auth/`, `shared/database/`): +β†’ These are used by BOTH apps - be careful with changes! + +--- + ## πŸ—οΈ Architecture ### Microservices Structure ``` . β”œβ”€β”€ shared/ # Shared components (DB pool, auth, utils) -β”œβ”€β”€ reports-app/ +β”‚ β”œβ”€β”€ database/ # Oracle pool (used by reports-app) +β”‚ └── auth/ # JWT auth (used by both apps) +β”‚ +β”œβ”€β”€ reports-app/ # READ-ONLY reports from Oracle β”‚ β”œβ”€β”€ backend/ # FastAPI API (port 8001) β”‚ β”œβ”€β”€ frontend/ # Vue.js 3 UI (port 3000-3005) β”‚ └── telegram-bot/ # Telegram bot (port 8002 internal) +β”‚ +β”œβ”€β”€ data-entry-app/ # DATA INPUT with approval workflow +β”‚ β”œβ”€β”€ backend/ # FastAPI API (port 8003) - SQLite + SQLModel +β”‚ β”œβ”€β”€ frontend/ # Vue.js 3 UI (port 3010) +β”‚ └── CLAUDE.md # ⚠️ READ THIS for data-entry work! +β”‚ β”œβ”€β”€ docs/ # Architecture & style guides β”œβ”€β”€ deployment/ # Production deployment scripts └── ssh-tunnel/ # SSH tunnel for Oracle DB access ``` +### Starting Services + +```bash +# Reports App (Oracle reports) +./start-test.sh # Backend :8001, Frontend :3000-3005, Telegram :8002 + +# Data Entry App (fiscal receipts) +./start-data-entry.sh # Backend :8003, Frontend :3010 +``` + ### Key Architectural Decisions - **Shared Database Pool**: Singleton `OraclePool` in `shared/database/oracle_pool.py` (python-oracledb with connection pooling) - **Centralized Auth**: JWT-based auth in `shared/auth/` with middleware auto-injecting `request.state.user` @@ -266,6 +314,12 @@ const response = await api.get('/endpoint'); ### Quick Start & Commands β†’ **`README.md`** - Project overview, setup, development commands, testing, deployment +### Data Entry App (Bonuri Fiscale) +- **`data-entry-app/CLAUDE.md`** - ⚠️ **READ FIRST** when working on data-entry +- `data-entry-app/README.md` - Quick start guide +- `docs/data-entry/REQUIREMENTS.md` - Functional requirements +- `docs/data-entry/ARCHITECTURE.md` - Technical architecture (SQLModel, workflow) + ### Architecture & Planning - **`docs/ARCHITECTURE_SCHEMA.md`** - Architecture diagrams, cache system, and schemas - `docs/MICROSERVICES_GUIDE.md` - Microservices architecture details