Add prominent reminders in both CLAUDE.md and AGENTS.md to update the shared ARCHITECTURE.md file when making architectural changes. This helps ensure the documentation stays current and both AI tools have accurate context. Changes include: - Added step in development workflow to update docs - Added "Important: Keep Documentation Updated" section - Listed specific types of changes that require doc updates - Emphasized that this keeps both tools in sync 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5.1 KiB
5.1 KiB
MoneyMap - Claude Code Context
Quick Overview
MoneyMap is an ASP.NET Core 8.0 Razor Pages application for personal finance tracking. Users can import bank transaction CSVs, categorize expenses, attach receipt images/PDFs, and parse receipts using OpenAI's Vision API.
Architecture Documentation
For detailed technical documentation, see ARCHITECTURE.md
The architecture document contains:
- Complete technology stack
- Core domain models (Transaction, Receipt, Card, Account, Merchant, etc.)
- Service layer details (TransactionImporter, CardResolver, TransactionCategorizer, etc.)
- Database schema and relationships
- Key workflows and design patterns
- Security and performance considerations
Project Structure
MoneyMap/
├── Data/
│ └── MoneyMapContext.cs # EF Core DbContext
├── Models/
│ ├── Account.cs # Bank accounts
│ ├── Card.cs # Payment cards
│ ├── Merchant.cs # Merchants/vendors
│ ├── Transaction.cs # Core transaction entity
│ ├── Receipt.cs # Receipt files
│ ├── ReceiptLineItem.cs # Parsed line items
│ └── ReceiptParseLog.cs # Parse attempt logs
├── Services/
│ ├── TransactionCategorizer.cs # Auto-categorization logic
│ ├── ReceiptManager.cs # Receipt upload/storage
│ └── OpenAIReceiptParser.cs # AI-powered receipt parsing
├── Pages/
│ ├── Index.cshtml[.cs] # Dashboard
│ ├── Upload.cshtml[.cs] # CSV import
│ ├── Transactions.cshtml[.cs] # Transaction list
│ ├── EditTransaction.cshtml[.cs] # Edit transaction
│ ├── ViewReceipt.cshtml[.cs] # Receipt details
│ ├── CategoryMappings.cshtml[.cs]# Category rules
│ ├── Merchants.cshtml[.cs] # Merchant management
│ └── Recategorize.cshtml[.cs] # Bulk recategorization
└── Program.cs # DI configuration
Common Development Tasks
Adding a New Page
- Create
.cshtmland.cshtml.csfiles inPages/ - Inherit from
PageModel - Add route via
@pagedirective - Register dependencies in constructor via DI
Adding a New Service
- Create interface in appropriate namespace
- Create implementation class
- Register in
Program.cs:builder.Services.AddScoped<IMyService, MyService>();
Adding a Database Migration
dotnet ef migrations add MigrationName
dotnet ef database update
Modifying Domain Models
- Update model class in
Models/ - Update
MoneyMapContext.OnModelCreating()if needed (relationships, indexes) - Create and apply migration
Key Design Principles
- Service Layer Pattern: Business logic lives in services, not pages
- Result Pattern: Services return result objects (not exceptions)
- Dependency Injection: All services injected via interfaces
- Single Responsibility: Each service has one clear purpose
- Clean Architecture: UI → Services → Data Access
Important Notes
- Duplicate Prevention: Transactions have a unique constraint on (Date, Amount, Name, Memo, AccountId, CardId)
- Cascade Deletes: Deleting a transaction cascades to receipts, parse logs, and line items
- Merchant Assignment: Category mappings can auto-assign merchants to transactions
- Transfer Detection: Transactions with
TransferToAccountIdare identified as transfers - Receipt Parsing: OpenAI API key required for receipt parsing (env var
OPENAI_API_KEY)
Development Workflow
- Read ARCHITECTURE.md for technical details
- Make changes to models, services, or pages
- Test locally
- Create database migration if schema changed
- Update ARCHITECTURE.md if architecture changes (new models, services, workflows, etc.)
- Commit with descriptive message
Important: Keep Documentation Updated
When making architectural changes, always update ARCHITECTURE.md:
- Adding/removing domain models
- Adding/removing services or changing their responsibilities
- Modifying database schema or relationships
- Adding new workflows or processes
- Changing design patterns or conventions
- Adding new pages or major features
This ensures both Claude Code and Codex CLI have accurate, up-to-date context.
Configuration
See appsettings.json:
ConnectionStrings:MoneyMapDb- SQL Server connectionOpenAI:ApiKey- OpenAI API key (optional, use env var instead)Receipts:StoragePath- Receipt storage location (relative to wwwroot)
Testing
- All services use interfaces for mockability
- Use in-memory database for integration tests
- Mock
IReceiptParserto avoid OpenAI API calls in tests
Questions?
Refer to ARCHITECTURE.md for comprehensive technical documentation including:
- Detailed service descriptions
- Database schema
- Key workflows
- Security considerations
- Performance optimizations
- Troubleshooting guide