chore: Remove obsolete microservices directories and update all references
- Delete data-entry-app/ (1.6GB), reports-app/ (447MB), .auto-build-data/
- Saved ~1.4GB disk space (64% reduction: 2.2GB → 845MB)
Updated references across 38 files:
- .claude/rules/ paths: backend/modules/, src/modules/
- .claude/commands/validate.md: all validation paths
- docs/ (13 files): data-entry, telegram, README, CLAUDE.md
- scripts/ (3 files): backup-secrets, restore-secrets, test-docker
- security/ (2 files): git_cleanup, SECURITY_PROCEDURES
- deployment/ & shared/: updated all stale comments
All paths now reflect ultrathin monolith architecture:
- Backend: backend/modules/{reports,data_entry,telegram}/
- Frontend: src/modules/{reports,data-entry}/
- Shared: shared/{auth,database,routes}/
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,13 +35,13 @@
|
||||
|
||||
### Fișiere Modificate (7 fișiere)
|
||||
|
||||
- [ ] `reports-app/backend/requirements.txt` - Adaugă redis>=5.0.0
|
||||
- [ ] `reports-app/backend/.env.example` - Adaugă REDIS_* env vars
|
||||
- [ ] `reports-app/backend/app/main.py` - Initialize Redis at startup
|
||||
- [ ] `reports-app/backend/app/services/dashboard_service.py` - Apply caching
|
||||
- [ ] `reports-app/backend/app/services/invoice_service.py` - Apply caching
|
||||
- [ ] `reports-app/backend/app/routers/dashboard.py` - Cache invalidation on mutations
|
||||
- [ ] `reports-app/backend/app/routers/invoices.py` - Cache invalidation on mutations
|
||||
- [ ] `backend/requirements.txt` - Adaugă redis>=5.0.0
|
||||
- [ ] `backend/.env.example` - Adaugă REDIS_* env vars
|
||||
- [ ] `backend/app/main.py` - Initialize Redis at startup
|
||||
- [ ] `backend/app/services/dashboard_service.py` - Apply caching
|
||||
- [ ] `backend/app/services/invoice_service.py` - Apply caching
|
||||
- [ ] `backend/app/routers/dashboard.py` - Cache invalidation on mutations
|
||||
- [ ] `backend/app/routers/invoices.py` - Cache invalidation on mutations
|
||||
|
||||
---
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
**Tasks:**
|
||||
|
||||
1. [ ] **Adaugă dependency în requirements.txt**
|
||||
- Fișier: `reports-app/backend/requirements.txt`
|
||||
- Fișier: `backend/requirements.txt`
|
||||
- Acțiune: Adaugă linia `redis>=5.0.0` după `httpx>=0.27.0`
|
||||
- Motivație: redis 5.0+ are async support nativ
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
- Template (vezi secțiunea Code Templates mai jos)
|
||||
|
||||
4. [ ] **Adaugă env variables în .env.example**
|
||||
- Fișier: `reports-app/backend/.env.example`
|
||||
- Fișier: `backend/.env.example`
|
||||
- Acțiune: Adaugă la sfârșitul fișierului:
|
||||
```bash
|
||||
# Redis Configuration
|
||||
@@ -90,7 +90,7 @@
|
||||
```
|
||||
|
||||
5. [ ] **Initialize Redis la startup în main.py**
|
||||
- Fișier: `reports-app/backend/app/main.py`
|
||||
- Fișier: `backend/app/main.py`
|
||||
- Acțiune: În funcția `startup_event()`:
|
||||
```python
|
||||
from shared.cache import redis_cache
|
||||
@@ -254,7 +254,7 @@
|
||||
**Tasks:**
|
||||
|
||||
1. [ ] **Apply @cached în DashboardService.get_complete_summary()**
|
||||
- Fișier: `reports-app/backend/app/services/dashboard_service.py`
|
||||
- Fișier: `backend/app/services/dashboard_service.py`
|
||||
- Acțiune: Adaugă decorator la metoda `get_complete_summary`:
|
||||
```python
|
||||
from shared.cache import cached
|
||||
@@ -268,26 +268,26 @@
|
||||
- Motivație: Dashboard e accesat des, datele se schimbă rar
|
||||
|
||||
2. [ ] **Apply @cached în DashboardService.get_trends()**
|
||||
- Fișier: `reports-app/backend/app/services/dashboard_service.py`
|
||||
- Fișier: `backend/app/services/dashboard_service.py`
|
||||
- Acțiune: Similar, TTL=180 (3 min pentru trends)
|
||||
- Cache key va include period: `cache:default:dashboard_trends:company-X:period-30d:abc123`
|
||||
|
||||
3. [ ] **Apply @cached în DashboardService.get_detailed_data()**
|
||||
- Fișier: `reports-app/backend/app/services/dashboard_service.py`
|
||||
- Fișier: `backend/app/services/dashboard_service.py`
|
||||
- Acțiune: TTL=60 (1 min pentru tabel detalii - se refreshează des)
|
||||
- Cache key include page, page_size, search
|
||||
|
||||
4. [ ] **Apply @cached în InvoiceService.get_invoices()**
|
||||
- Fișier: `reports-app/backend/app/services/invoice_service.py`
|
||||
- Fișier: `backend/app/services/invoice_service.py`
|
||||
- Acțiune: TTL=60 (1 min)
|
||||
- Cache key include filter params (partner_type, date_from, date_to, etc.)
|
||||
|
||||
5. [ ] **Apply @cached în InvoiceService.get_invoice_summary()**
|
||||
- Fișier: `reports-app/backend/app/services/invoice_service.py`
|
||||
- Fișier: `backend/app/services/invoice_service.py`
|
||||
- Acțiune: TTL=180 (3 min pentru summary)
|
||||
|
||||
6. [ ] **Cache invalidation în dashboard mutations (viitor)**
|
||||
- Fișier: `reports-app/backend/app/routers/dashboard.py`
|
||||
- Fișier: `backend/app/routers/dashboard.py`
|
||||
- Acțiune: Pregătește cod pentru invalidation (de activat când există POST/PUT/DELETE):
|
||||
```python
|
||||
# TODO: Activate când implementăm mutations
|
||||
@@ -301,7 +301,7 @@
|
||||
```
|
||||
|
||||
7. [ ] **Cache invalidation în invoice mutations**
|
||||
- Fișier: `reports-app/backend/app/routers/invoices.py`
|
||||
- Fișier: `backend/app/routers/invoices.py`
|
||||
- Acțiune: Când se implementează POST/PUT/DELETE pentru invoices, invalidează:
|
||||
- `invoices_list`
|
||||
- `invoices_summary`
|
||||
@@ -601,7 +601,7 @@ ab -n 100 -c 10 http://localhost:8001/api/dashboard/summary?company=123
|
||||
|
||||
## 🔧 Configurare Env Variables
|
||||
|
||||
**File:** `reports-app/backend/.env`
|
||||
**File:** `backend/.env`
|
||||
|
||||
```bash
|
||||
# ============================================================================
|
||||
@@ -657,7 +657,7 @@ docker-compose exec roa-backend env | grep REDIS
|
||||
- [ ] Dependency added: `redis>=5.0.0` în requirements.txt
|
||||
- [ ] Package created: `shared/cache/__init__.py`
|
||||
- [ ] Redis client: `shared/cache/redis_client.py`
|
||||
- [ ] Env vars added: `reports-app/backend/.env.example`
|
||||
- [ ] Env vars added: `backend/.env.example`
|
||||
- [ ] Main.py updated: Redis initialize at startup
|
||||
- [ ] Test: `python -c "import asyncio; from shared.cache import redis_cache; asyncio.run(redis_cache.initialize())"`
|
||||
|
||||
@@ -703,8 +703,8 @@ docker-compose exec roa-backend env | grep REDIS
|
||||
|
||||
- **Docker Compose Redis Config:** `docker-compose.yml:147-163`
|
||||
- **Oracle Pool Pattern:** `shared/database/oracle_pool.py` (reference for singleton pattern)
|
||||
- **Backend Services:** `reports-app/backend/app/services/` (where to apply caching)
|
||||
- **Backend Routers:** `reports-app/backend/app/routers/` (where to invalidate cache)
|
||||
- **Backend Services:** `backend/app/services/` (where to apply caching)
|
||||
- **Backend Routers:** `backend/app/routers/` (where to invalidate cache)
|
||||
|
||||
### Documentație Externă
|
||||
|
||||
|
||||
Reference in New Issue
Block a user