478 lines
12 KiB
Markdown
478 lines
12 KiB
Markdown
# Unified App - Critical Files Reference
|
|
|
|
**Quick Reference**: Files that will be most affected during implementation
|
|
|
|
---
|
|
|
|
## Files to Analyze (Before Implementation)
|
|
|
|
### Configuration Files
|
|
|
|
**Reports App**:
|
|
- `/mnt/e/proiecte/roa2web/reports-app/frontend/package.json` - Dependencies to merge
|
|
- `/mnt/e/proiecte/roa2web/reports-app/frontend/vite.config.js` - Proxy config, build settings
|
|
- `/mnt/e/proiecte/roa2web/reports-app/frontend/src/main.js` - PrimeVue setup
|
|
|
|
**Data Entry App**:
|
|
- `/mnt/e/proiecte/roa2web/data-entry-app/frontend/package.json` - Dependencies to merge
|
|
- `/mnt/e/proiecte/roa2web/data-entry-app/frontend/vite.config.js` - Proxy config
|
|
- `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/main.js` - PrimeVue setup
|
|
|
|
### Application Entry Points
|
|
|
|
**Reports App**:
|
|
- `/mnt/e/proiecte/roa2web/reports-app/frontend/src/App.vue` - Root component, menu integration
|
|
- `/mnt/e/proiecte/roa2web/reports-app/frontend/src/router/index.js` - Router config
|
|
|
|
**Data Entry App**:
|
|
- `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/App.vue` - Root component, menu integration
|
|
- `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/router/index.js` - Router config
|
|
|
|
### Shared Components (Already Created)
|
|
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/components/LoginView.vue`
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/components/layout/AppHeader.vue`
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/components/layout/SlideMenu.vue`
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/components/CompanySelector.vue`
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/components/PeriodSelector.vue`
|
|
|
|
### Shared Stores (Factories)
|
|
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/stores/auth.js`
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/stores/companies.js`
|
|
- `/mnt/e/proiecte/roa2web/shared/frontend/stores/accountingPeriod.js`
|
|
|
|
---
|
|
|
|
## Views to Migrate
|
|
|
|
### Reports Module (7 views)
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/reports-app/frontend/src/views/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/modules/reports/views/`
|
|
|
|
1. `DashboardView.vue` - Main dashboard with metrics
|
|
2. `InvoicesView.vue` - Invoices table and filters
|
|
3. `BankCashRegisterView.vue` - Bank and cash register transactions
|
|
4. `TrialBalanceView.vue` - Trial balance report
|
|
5. `TelegramView.vue` - Telegram bot management
|
|
6. `CacheStatsView.vue` - Cache statistics
|
|
7. ~~`LoginView.vue`~~ - USE SHARED VERSION
|
|
|
|
### Data Entry Module (2 views + 3 components)
|
|
|
|
**Views**:
|
|
Source: `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/views/receipts/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/modules/data-entry/views/receipts/`
|
|
|
|
1. `ReceiptsListView.vue` - List of receipts with filters
|
|
2. `ReceiptCreateView.vue` - Create/edit receipt form
|
|
|
|
**Components**:
|
|
Source: `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/components/ocr/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/modules/data-entry/components/ocr/`
|
|
|
|
1. `OCRUploadZone.vue` - File upload zone for receipts
|
|
2. `OCRPreview.vue` - Preview uploaded receipt image
|
|
3. `OCRConfidenceIndicator.vue` - OCR confidence indicator
|
|
|
|
---
|
|
|
|
## Stores to Migrate
|
|
|
|
### Reports Module (5 stores)
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/reports-app/frontend/src/stores/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/modules/reports/stores/`
|
|
|
|
1. `dashboard.js` - Dashboard data and metrics
|
|
2. `invoices.js` - Invoices data and filters
|
|
3. `treasury.js` - Bank/cash register data
|
|
4. `trialBalance.js` - Trial balance data
|
|
5. `cacheStore.js` - Cache statistics
|
|
|
|
**SKIP** (use shared):
|
|
- ~~`auth.js`~~ - Use `/mnt/e/proiecte/roa2web/shared/frontend/stores/auth.js`
|
|
- ~~`companies.js`~~ - Use `/mnt/e/proiecte/roa2web/shared/frontend/stores/companies.js`
|
|
- ~~`accountingPeriod.js`~~ - Use `/mnt/e/proiecte/roa2web/shared/frontend/stores/accountingPeriod.js`
|
|
|
|
### Data Entry Module (1 store)
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/stores/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/modules/data-entry/stores/`
|
|
|
|
1. `receiptsStore.js` - Receipts data and CRUD operations
|
|
|
|
**SKIP** (use shared):
|
|
- ~~`auth.js`~~ - Use shared
|
|
- ~~`companies.js`~~ - Use shared
|
|
- ~~`accountingPeriod.js`~~ - Use shared
|
|
|
|
---
|
|
|
|
## Services to Migrate
|
|
|
|
### Reports Module
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/reports-app/frontend/src/services/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/modules/reports/services/`
|
|
|
|
1. `api.js` - **MODIFY**: Change base URL to `/api/reports/`
|
|
|
|
**Current**:
|
|
```javascript
|
|
const api = axios.create({
|
|
baseURL: '/api'
|
|
})
|
|
```
|
|
|
|
**New**:
|
|
```javascript
|
|
const api = axios.create({
|
|
baseURL: '/api/reports'
|
|
})
|
|
```
|
|
|
|
### Data Entry Module
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/services/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/modules/data-entry/services/`
|
|
|
|
1. `api.js` - **MODIFY**: Change base URL to `/api/data-entry/`
|
|
|
|
**Current**:
|
|
```javascript
|
|
const api = axios.create({
|
|
baseURL: '/api'
|
|
})
|
|
```
|
|
|
|
**New**:
|
|
```javascript
|
|
const api = axios.create({
|
|
baseURL: '/api/data-entry'
|
|
})
|
|
```
|
|
|
|
---
|
|
|
|
## CSS to Migrate
|
|
|
|
### Reports Module CSS (COPY ENTIRE STRUCTURE)
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/reports-app/frontend/src/assets/css/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/assets/css/`
|
|
|
|
**Copy ALL files** (this is the main CSS system):
|
|
- `core/` - Design tokens (colors, spacing, typography)
|
|
- `components/` - Reusable UI patterns (buttons, forms, cards, tables, stats)
|
|
- `patterns/` - Interactive patterns (animations, dashboard, interactive)
|
|
- `layout/` - Page structure (containers, grid, navigation)
|
|
- `utilities/` - Utility classes (colors, spacing, flex, text, display)
|
|
- `vendor/` - PrimeVue overrides
|
|
- `global.css` - Global styles
|
|
- `main.css` - Main entry point
|
|
- `mobile.css` - Mobile responsive styles
|
|
|
|
### Data Entry Module CSS (MERGE)
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/data-entry-app/frontend/src/assets/css/`
|
|
|
|
**Analyze and merge unique styles**:
|
|
- `main.css` - Merge with reports-app main.css
|
|
- Any component-specific styles - Integrate into unified system
|
|
|
|
### Shared CSS
|
|
|
|
Source: `/mnt/e/proiecte/roa2web/shared/frontend/styles/`
|
|
Destination: `/mnt/e/proiecte/roa2web/src/shared/styles/`
|
|
|
|
1. `login.css` - Login page styles
|
|
2. `layout/header.css` - Header styles
|
|
3. `layout/navigation.css` - Navigation styles
|
|
|
|
---
|
|
|
|
## Critical Implementation Files
|
|
|
|
### 1. Package Configuration
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/package.json`
|
|
|
|
**Dependencies to merge**:
|
|
- From reports-app: axios, chart.js, date-fns, jspdf, jspdf-autotable, qrcode.vue, xlsx
|
|
- From data-entry-app: All covered by reports-app
|
|
- Shared: vue@^3.4.0, vue-router@^4.2.5, pinia@^2.1.7, primevue@^3.46.0
|
|
|
|
### 2. Vite Configuration
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/vite.config.js`
|
|
|
|
**Key sections**:
|
|
- Dual proxy for `/api/reports/` → `http://localhost:8001`
|
|
- Dual proxy for `/api/data-entry/` → `http://localhost:8003`
|
|
- Lazy loading configuration (manualChunks)
|
|
- Alias configuration (@, @shared, @reports, @data-entry)
|
|
|
|
### 3. Application Entry
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/main.js`
|
|
|
|
**Key setup**:
|
|
- PrimeVue configuration (theme: saga-blue)
|
|
- Global components registration
|
|
- Router, Pinia, ToastService, ConfirmationService
|
|
- CSS imports
|
|
|
|
### 4. Root Component
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/App.vue`
|
|
|
|
**Key elements**:
|
|
- AppHeader with unified menu
|
|
- SlideMenu with module sections
|
|
- router-view
|
|
- Toast, ConfirmDialog
|
|
|
|
### 5. Router Configuration
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/router/index.js`
|
|
|
|
**Key routes**:
|
|
- `/login` - LoginView (eager loaded)
|
|
- `/reports/*` - ReportsLayout (lazy loaded) with children
|
|
- `/data-entry/*` - DataEntryLayout (lazy loaded) with children
|
|
- Authentication guard
|
|
|
|
### 6. Menu Configuration
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/config/menu.js`
|
|
|
|
**Sections**:
|
|
- Rapoarte (Reports)
|
|
- Introduceri Date (Data Entry)
|
|
- Sistem (System)
|
|
|
|
### 7. Feature Flags
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/config/features.js`
|
|
|
|
**Flags**:
|
|
- reports.enabled
|
|
- dataEntry.enabled
|
|
- Module-level flags
|
|
|
|
### 8. Error Boundary Component
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/shared/components/ErrorBoundary.vue`
|
|
|
|
**Key features**:
|
|
- onErrorCaptured hook
|
|
- User-friendly error display
|
|
- Retry functionality
|
|
- Navigate away option
|
|
|
|
### 9. Module Layouts
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/modules/reports/ReportsLayout.vue`
|
|
|
|
**Wrapper**:
|
|
```vue
|
|
<ErrorBoundary module-name="Reports">
|
|
<router-view />
|
|
</ErrorBoundary>
|
|
```
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/src/modules/data-entry/DataEntryLayout.vue`
|
|
|
|
**Wrapper**:
|
|
```vue
|
|
<ErrorBoundary module-name="Data Entry">
|
|
<router-view />
|
|
</ErrorBoundary>
|
|
```
|
|
|
|
---
|
|
|
|
## Deployment Files
|
|
|
|
### IIS Configuration
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/web.config`
|
|
|
|
**Key rules**:
|
|
- SPA routing (all routes → index.html)
|
|
- API proxy: `/api/reports/*` → `http://localhost:8001/api/*`
|
|
- API proxy: `/api/data-entry/*` → `http://localhost:8003/api/*`
|
|
- Uploads proxy: `/uploads/*` → `http://localhost:8003/uploads/*`
|
|
|
|
### Environment Variables
|
|
|
|
**File**: `/mnt/e/proiecte/roa2web/.env.example`
|
|
|
|
**Variables**:
|
|
```bash
|
|
# API Endpoints (dev only, production uses IIS proxy)
|
|
VITE_REPORTS_API=http://localhost:8001
|
|
VITE_DATA_ENTRY_API=http://localhost:8003
|
|
|
|
# Feature Flags
|
|
VITE_ENABLE_REPORTS=true
|
|
VITE_ENABLE_DATA_ENTRY=true
|
|
```
|
|
|
|
---
|
|
|
|
## Testing Files
|
|
|
|
### E2E Tests
|
|
|
|
**New files to create**:
|
|
- `/mnt/e/proiecte/roa2web/tests/e2e/login.spec.js`
|
|
- `/mnt/e/proiecte/roa2web/tests/e2e/reports-navigation.spec.js`
|
|
- `/mnt/e/proiecte/roa2web/tests/e2e/data-entry-navigation.spec.js`
|
|
- `/mnt/e/proiecte/roa2web/tests/e2e/module-switching.spec.js`
|
|
- `/mnt/e/proiecte/roa2web/tests/e2e/error-isolation.spec.js`
|
|
|
|
**Existing tests to adapt**:
|
|
- `/mnt/e/proiecte/roa2web/reports-app/frontend/tests/` - Update routes
|
|
- `/mnt/e/proiecte/roa2web/data-entry-app/frontend/tests/` - Update routes
|
|
|
|
---
|
|
|
|
## Documentation Files to Update
|
|
|
|
### Primary Documentation
|
|
|
|
1. **CLAUDE.md** (root)
|
|
- Update architecture diagram
|
|
- Add unified-app section
|
|
- Mark old apps as archived
|
|
- Update deployment instructions
|
|
|
|
2. **README.md** (root)
|
|
- Update quick start
|
|
- Update deployment section
|
|
- Update URL structure
|
|
|
|
3. **DEPLOYMENT_GUIDE.md**
|
|
- Update IIS configuration
|
|
- Update build process
|
|
- Add rollback instructions
|
|
|
|
4. **docs/ARCHITECTURE_SCHEMA.md**
|
|
- Update architecture diagrams
|
|
- Document module structure
|
|
- Add error boundary architecture
|
|
|
|
### Deployment Documentation
|
|
|
|
5. **deployment/windows/README.md**
|
|
- Update deployment steps
|
|
- Update IIS configuration
|
|
- Update proxy rules
|
|
|
|
6. **deployment/windows/docs/WINDOWS_DEPLOYMENT.md**
|
|
- Complete Windows guide updates
|
|
|
|
---
|
|
|
|
## File Count Summary
|
|
|
|
**To Create**: ~15 new files
|
|
- 9 core files (package.json, vite.config.js, main.js, App.vue, router, menu, features, ErrorBoundary, 2 layouts)
|
|
- 3 configuration files (.env.example, web.config, README.md)
|
|
- 3 documentation updates
|
|
|
|
**To Migrate**: ~20 files
|
|
- 7 Reports views
|
|
- 2 Data Entry views
|
|
- 3 Data Entry components
|
|
- 5 Reports stores
|
|
- 1 Data Entry store
|
|
- 2 API services
|
|
|
|
**To Copy**: ~30 CSS files
|
|
- Entire reports-app CSS structure
|
|
|
|
**Total Files Affected**: ~65 files
|
|
|
|
---
|
|
|
|
## Time Estimates per File Type
|
|
|
|
| Task | Files | Avg Time | Total |
|
|
|------|-------|----------|-------|
|
|
| Create core files | 9 | 30 min | 4.5 hours |
|
|
| Migrate views | 9 | 20 min | 3 hours |
|
|
| Migrate components | 3 | 15 min | 45 min |
|
|
| Migrate stores | 6 | 20 min | 2 hours |
|
|
| Migrate services | 2 | 30 min | 1 hour |
|
|
| Copy CSS | 1 | 1 hour | 1 hour |
|
|
| Configuration | 3 | 30 min | 1.5 hours |
|
|
| Documentation | 6 | 30 min | 3 hours |
|
|
| Testing & fixes | - | - | 4 hours |
|
|
|
|
**Total**: ~20 hours (~2.5 days)
|
|
|
|
---
|
|
|
|
## Verification Checklist
|
|
|
|
After migrating each category:
|
|
|
|
### Configuration Files ✓
|
|
- [ ] package.json has all dependencies
|
|
- [ ] vite.config.js has dual proxy
|
|
- [ ] main.js initializes correctly
|
|
- [ ] npm install succeeds
|
|
- [ ] npm run dev starts
|
|
|
|
### Views ✓
|
|
- [ ] All Reports views render
|
|
- [ ] All Data Entry views render
|
|
- [ ] No import errors
|
|
- [ ] Routes work
|
|
|
|
### Stores ✓
|
|
- [ ] All stores import correctly
|
|
- [ ] No duplicate store instances
|
|
- [ ] Shared stores work
|
|
- [ ] Module stores isolated
|
|
|
|
### Services ✓
|
|
- [ ] API calls route to correct backend
|
|
- [ ] /api/reports/ → :8001
|
|
- [ ] /api/data-entry/ → :8003
|
|
- [ ] Auth headers preserved
|
|
|
|
### CSS ✓
|
|
- [ ] No style conflicts
|
|
- [ ] Design tokens work
|
|
- [ ] PrimeVue theme consistent
|
|
- [ ] Responsive works
|
|
|
|
### Router ✓
|
|
- [ ] All routes accessible
|
|
- [ ] Lazy loading works
|
|
- [ ] Auth guard works
|
|
- [ ] 404 redirects
|
|
|
|
### Error Boundaries ✓
|
|
- [ ] Catches component errors
|
|
- [ ] Displays user message
|
|
- [ ] Module isolation works
|
|
- [ ] Can retry/navigate
|
|
|
|
### Build ✓
|
|
- [ ] npm run build succeeds
|
|
- [ ] Chunks split correctly
|
|
- [ ] Bundle size acceptable
|
|
- [ ] Preview works
|
|
|
|
---
|
|
|
|
**Last Updated**: 2025-12-22
|
|
**For**: Unified App Implementation
|
|
**Reference**: See spec.md for complete specification
|