Invoice Pro v1.0
AI-powered invoice extraction and financial management platform
Complete SaaS solution with Next.js 16 frontend, Go backend microservices, document extraction, and intelligent data processing.
π Quick Start
Prerequisites
- Docker & Docker Compose
- Go 1.25+
- Node.js 18+
- PostgreSQL 15+
- Redis 7+
Installation
# Clone repository
git clone https://github.com/yourusername/invoice-pro.git
cd invoice-pro
# Install dependencies
./deploy.sh install
# Start development
docker-compose up -d
Access Points
| Service | URL | Purpose |
|---|---|---|
| Frontend | http://localhost:3000 | Next.js web app |
| Backend API | http://localhost:8080 | gRPC-Web gateway |
| PostgreSQL | localhost:5432 | Primary database |
| Redis | localhost:6379 | Cache & rate limiting |
ποΈ Architecture
System Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js 16) β
β β’ App Router, TypeScript, Tailwind CSS β
β β’ Connect-RPC gRPC client β
β β’ React Query for state management β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β HTTP/gRPC-Web
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend Services (Go) β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Rate Limiter (Redis) β β
β ββββββββββββββββ¬ββββββββββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Authentication (JWT) β β
β ββββββββββββββββ¬ββββββββββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Business Logic Handlers β β
β β β’ Accounting Service β β
β β β’ Import Service β β
β β β’ Integration Service β β
β β β’ AI Agent Service β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
ββββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
βββββββββββ ββββββββββ ββββββββββββ
βPostgreSQLβ β Redis β β AI APIs β
β(Primary) β β(Cache) β β(OpenAI) β
βββββββββββ ββββββββββ ββββββββββββ
π¦ Data Import System Complete
Overview
Universal CSV/Excel import with AI-powered column mapping. Supports any provider (Paystack, Stripe, Flutterwave, Square) with automatic field detection and transformation.
Key Features
- β CSV & Excel (.xlsx, .xls) file upload
- β AI-powered column mapping with 70-95% accuracy
- β Template matching for instant imports (100% confidence, zero AI cost)
- β Pre-seeded templates for Stripe and Paystack
- β Value transformations (divide_by, currency conversion, value_mapping)
- β Duplicate detection via ExternalTransactionSource
- β Multi-step wizard UI with progress tracking
- β Integration-aware imports (standalone + from integrations page)
Import Strategy
| Method | Speed | Cost | Accuracy |
|---|---|---|---|
| Template Matching | Instant | FREE | 100% |
| Rule-Based Patterns | Instant | FREE | 70-95% |
| AI Fallback | ~2s | ~$0.02/file | 85% |
| 90-day Cache | Instant | FREE | 95% hit |
Database Schema
import_sessions
- id, tenant_id, filename, status
- total_rows, processed_rows, error_rows
- integration_id, provider, template_id
import_field_mappings
- session_id, source_column, target_entity, target_field
- mapping_strategy (template/ai/rules)
- confidence_score, transformations (JSONB)
import_errors
- session_id, row_number, field_name, error_message
import_templates
- name, description, provider
- column_mappings (JSONB), is_public
mapping_cache
- cache_key (hash of columns), mapping_result (JSONB)
- hit_count, expires_at
API Endpoints (gRPC)
UploadImportFile- Upload CSV/Excel, start analysisGetImportMappings- Get AI/template mappingsUpdateFieldMapping- Manual mapping adjustmentConfirmMappings- Lock mappings, optionally save templateExecuteImport- Process file, create payments/entriesGetImportSession- Session status & progressListImportSessions- All imports with paginationGetImportErrors- Row-level error detailsListImportTemplates- Available templatesCreateImportTemplate- Save mappings for reuseDeleteImportTemplate- Remove templateCancelImport- Abort running import
Frontend Components
frontend/src/
βββ app/dashboard/data-imports/
β βββ page.tsx (list all imports)
β βββ new/page.tsx (import wizard)
β βββ [id]/page.tsx (import details)
β βββ templates/page.tsx (manage templates)
βββ components/data-imports/
β βββ import-wizard.tsx (multi-step wizard)
β βββ upload-step.tsx
β βββ review-step.tsx
β βββ execute-step.tsx
βββ hooks/
β βββ use-imports.ts (8 React hooks)
βββ lib/api/
βββ imports.ts (ImportsAPI client)
Usage Example
// Upload file
const session = await ImportsAPI.uploadFile({
tenantId: 'uuid',
file: csvFile,
integrationId: 'uuid', // optional
provider: 'stripe', // optional
templateId: 'uuid', // optional (instant import)
})
// Get mappings (AI or template)
const { mappings } = await ImportsAPI.getMappings(tenantId, sessionId)
// Adjust if needed
await ImportsAPI.updateMapping({
tenantId,
sessionId,
mappingId: 'uuid',
targetField: 'amount',
isUserConfirmed: true
})
// Execute import
await ImportsAPI.executeImport(tenantId, sessionId)
β‘ Workflow Automation Phase 6 Complete
Overview
Visual workflow builder with scheduled execution, AI-powered automation, and seamless integration management. Build complex business processes with drag-and-drop nodes.
Key Features
- β Visual drag-and-drop workflow builder (V2)
- β
Template variable substitution with
{{variable}}syntax - β Loop node for array iteration with context setting
- β Condition node with 12 comparison operators
- β Transform node for data mapping and manipulation
- β Scheduled execution with cron-based scheduler
- β Real Paystack API integration with transaction sync
- β Integration-aware workflow builder with validation
- β 11 node executors with comprehensive functionality
Workflow Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Workflow Builder (Frontend V2) β
β β’ Drag-and-drop canvas with zoom/pan β
β β’ Node palette (triggers, actions, logic) β
β β’ Configuration sidebar β
β β’ Integration validation before save β
ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β HTTP POST /api/workflows
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Workflow API Route (Next.js) β
β β’ Validates required integrations β
β β’ Returns 400 if integration missing β
β β’ Saves workflow definition to backend β
ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β gRPC createWorkflow
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend Workflow Services (Go) β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β Workflow Scheduler (Cron) β β
β β β’ Polls for scheduled workflows β β
β β β’ Triggers execution at intervals β β
β ββββββββββββββ¬ββββββββββββββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β Workflow Runner (Graph Executor) β β
β β β’ Resolves {{template}} variables β β
β β β’ Executes nodes in dependency order β β
β β β’ Manages execution context β β
β ββββββββββββββ¬ββββββββββββββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β Node Executors (11 types) β β
β β β’ Triggers: paystack_sync β β
β β β’ Actions: create_payment, create_contact β β
β β β’ Logic: condition, loop, transform β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
Node Executors
| Category | Node Type | Purpose |
|---|---|---|
| Triggers | paystack_sync | Fetch transactions from Paystack API |
| Actions | create_payment | Create payment record in database |
| create_contact | Create customer/vendor contact | |
| create_journal | Create journal entry for accounting | |
| link_external | Link to external transaction source | |
| send_email | Send notification email | |
| Logic | condition | If/else branching with operators |
| loop | Iterate over arrays, set context per item | |
| transform | Data mapping and transformation |
Template Variable System
Use {{variable}} syntax to reference data from previous nodes. Supports dot notation for nested fields.
// Template syntax examples
{{current_transaction.amount}} // Access nested field
{{loop_item.customer.email}} // Access from loop context
{{paystack_transactions[0].status}} // Array indexing
// Context variables
{{loop_item}} // Current item in loop
{{loop_index}} // Current iteration index (0-based)
{{loop_total}} // Total items in array
{{loop_is_first}} // Boolean: first iteration
{{loop_is_last}} // Boolean: last iteration
Condition Operators
| Operator | Example | Use Case |
|---|---|---|
| equals | status == "success" | Exact match |
| not_equals | type != "refund" | Exclusion |
| greater_than | amount > 10000 | Numeric threshold |
| less_than | amount < 1000 | Lower bound |
| contains | email contains "@gmail" | Substring match |
| starts_with | reference starts_with "PAY" | Prefix match |
| ends_with | name ends_with ".pdf" | Suffix match |
| is_empty | description is_empty | Null/empty check |
Integration-Aware Workflow Builder
When creating workflows that require integrations (Paystack, Stripe, etc.), the system automatically validates that integrations are connected before saving.
User Flow
- User drags Paystack Scheduled Sync node onto canvas
- Node configuration shows alert: "β οΈ Integration Required - Connect Paystack Integration β"
- User configures polling interval and transaction filter
- User clicks Save Workflow
- Backend validates that Paystack integration exists and is connected
- If missing: Returns 400 error with provider name
- Frontend shows alert: "Please connect Paystack integration before saving"
- User clicks link β Redirects to integrations page
- User connects Paystack with API key
- Returns to workflow builder and saves successfully β
Backend Validation
// API Route: /api/workflows (POST)
// Extract integration nodes
const integrationNodes = nodes.filter(node =>
node.nodeType === 'paystack_scheduled_sync' ||
node.nodeType === 'stripe_scheduled_sync'
)
// Check each integration
for (const node of integrationNodes) {
const provider = node.nodeType.replace('_scheduled_sync', '')
const integrations = await accountingClient.listIntegrations({})
const hasIntegration = integrations.some(
int => int.provider === provider && int.status === 'connected'
)
if (!hasIntegration) {
return NextResponse.json({
error: 'Missing required integrations',
missingIntegrations: [{ provider }],
message: `Please connect ${provider} before saving`
}, { status: 400 })
}
}
Frontend Node Configuration
// Paystack Sync Node Config UI
{selectedNode.nodeType === "paystack_scheduled_sync" && (
<>
<div className="bg-blue-50 border border-blue-200 rounded p-3">
<AlertCircle className="text-blue-600" />
<span className="font-semibold">Integration Required</span>
<p>This workflow requires a connected Paystack integration.</p>
<a href="/integrations">Connect Paystack Integration β</a>
</div>
<select>
<option value="15">Every 15 minutes</option>
<option value="60">Every hour</option>
<option value="1440">Daily (recommended)</option>
</select>
</>
)}
Example Workflow: Auto-Import Paystack Transactions
{
"name": "Auto-import Paystack Transactions",
"nodes": [
{
"id": "node_1",
"nodeType": "paystack_scheduled_sync",
"config": {
"polling_interval": "1440",
"from_date": "{{today - 7 days}}",
"to_date": "{{today}}",
"transaction_filter": "success_only"
}
},
{
"id": "node_2",
"nodeType": "loop",
"config": {
"array_path": "paystack_transactions.transactions"
}
},
{
"id": "node_3",
"nodeType": "condition",
"config": {
"field": "{{loop_item.amount}}",
"operator": "greater_than",
"value": 10000
}
},
{
"id": "node_4",
"nodeType": "create_payment",
"config": {
"amount": "{{loop_item.amount}}",
"reference": "{{loop_item.reference}}",
"customer_email": "{{loop_item.customer.email}}",
"payment_type": "received",
"payment_method": "card"
}
},
{
"id": "node_5",
"nodeType": "create_journal",
"config": {
"description": "Payment received: {{loop_item.reference}}",
"lines": [
{
"account_code": "1010",
"debit": "{{loop_item.amount}}"
},
{
"account_code": "4010",
"credit": "{{loop_item.amount}}"
}
]
}
}
],
"connections": [
{ "sourceId": "node_1", "targetId": "node_2" },
{ "sourceId": "node_2", "targetId": "node_3" },
{ "sourceId": "node_3", "targetId": "node_4", "type": "true_branch" },
{ "sourceId": "node_4", "targetId": "node_5" }
]
}
Workflow Execution Flow
- Scheduler triggers workflow (daily at midnight)
- Paystack Sync Node fetches last 7 days of transactions via API
- Loop Node iterates over each transaction, sets
{{loop_item}} - Condition Node checks if amount > β¦10,000
- Create Payment Node creates payment record with resolved values
- Create Journal Node generates double-entry journal entry
- Workflow completes, logs execution summary
Paystack API Integration
Real HTTP integration to api.paystack.co/transaction with pagination, date filtering, and Bearer authentication.
// Paystack Sync Executor (Go)
func (e *PaystackSyncExecutor) Execute(ctx context.Context, ...) {
// 1. Get integration credentials
integration := getIntegration(tenantID, "paystack")
// 2. Fetch transactions from Paystack
transactions := fetchPaystackTransactions(
integration.SecretKey,
config.FromDate,
config.ToDate,
100 // perPage
)
// 3. Transform API response
for _, txn := range transactions {
amount := txn.Amount / 100 // kobo to naira
processedTxns = append(processedTxns, {
"amount": amount,
"reference": txn.Reference,
"status": txn.Status,
"customer": {
"email": txn.Customer.Email,
"name": txn.Customer.FirstName + " " + txn.Customer.LastName
}
})
}
// 4. Store in execution context
return map[string]interface{}{
"paystack_transactions": {
"transactions": processedTxns,
"total": len(processedTxns)
}
}
}
Performance
- Template Resolution: ~50Β΅s per variable
- Node Execution: ~200Β΅s per node (avg)
- Paystack API: ~1.5s per 100 transactions
- Loop Iteration: ~100Β΅s per item
- Total Workflow: ~5s for 1000 transactions
Files
| File | Lines | Purpose |
|---|---|---|
| workflow_scheduler.go | 275 | Cron-based scheduler |
| workflow_runner.go | 441 | Graph execution engine |
| executors/paystack_sync.go | 210 | Paystack API integration |
| executors/loop.go | 145 | Array iteration with context |
| executors/condition.go | 217 | If/else branching logic |
| executors/transform.go | 180 | Data transformation |
| workflow-builder-v2.tsx | 1800+ | Visual workflow builder |
| /api/workflows/route.ts | 150 | Workflow CRUD + validation |
π Rate Limiting Complete
Overview
Multi-tier token bucket rate limiting with Redis. Protects API from abuse with automatic retry and user-friendly feedback.
Architecture
- β Global limiting (10k req/min)
- β Tenant limiting (1k req/min)
- β User limiting (200 req/min)
- β Method-specific limits (AI: 100/min, uploads: 200/min, bulk: 50/min)
- β Frontend: Automatic retry with exponential backoff
- β Frontend: Toast notifications with countdown
Default Limits
| Tier | Requests/Min | Burst |
|---|---|---|
| Global | 10,000 | 100 |
| Tenant | 1,000 | 50 |
| User | 200 | 20 |
| AI Chat | 100 | 10 |
| File Upload | 200 | 20 |
| Bulk Ops | 50 | 5 |
Backend Implementation
// Go - Rate limiter with token bucket
rateLimiter := middleware.NewRateLimiter(redisClient, config)
// gRPC interceptor chain
grpcSrv := grpc.NewServer(
grpc.ChainUnaryInterceptor(
rateLimiter.Unary(), // Rate limit FIRST
authInterceptor.Unary(), // Auth second
),
)
Frontend Integration
// Automatic retry on rate limit
import { withRateLimitRetry } from '@/lib/rate-limit-handler'
const result = await withRateLimitRetry(async () => {
return await fetch('/api/endpoint')
})
// Retries 3x with backoff: 1s β 2s β 4s
// Toast notification
import { useRateLimitToast } from '@/components/ui/rate-limit-toast'
const { toast, showToast } = useRateLimitToast()
if (isRateLimited) {
showToast("Rate limit reached, retrying in 3s...", 3)
}
Performance
- Latency: ~187Β΅s per check
- Throughput: 100k+ checks/sec
- Memory: ~200 bytes per key
- Tests: 8/8 passing
π€ AI Chatbot Enhanced
Overview
Natural language interface for financial queries. Powered by OpenAI with context-aware function calling.
Features
- β Natural language queries ("Show me Q3 revenue")
- β Context-aware responses with tenant data
- β Function calling for database queries
- β Conversation history with session management
- β Real-time streaming responses
Available Functions
| Function | Purpose |
|---|---|
| get_dashboard_stats | Revenue, expenses, profit overview |
| list_transactions | Recent transactions with filters |
| get_revenue_trend | Time-series revenue analysis |
| get_expense_breakdown | Category-wise expense breakdown |
| search_payments | Find specific payments |
| get_mrr_report | Monthly recurring revenue metrics |
Usage
// Frontend - Chat with AI
import { accountingClientBrowser } from '@/lib/connect-rpc-browser'
const stream = accountingClientBrowser.chatWithAI({
tenantId: 'uuid',
sessionId: 'uuid',
userMessage: 'What was my revenue last month?'
})
for await (const response of stream) {
console.log(response.assistantMessage)
}
π Integrations Active
Supported Providers
| Provider | Type | Features |
|---|---|---|
| Paystack | API + CSV | Live sync, transaction history, webhooks |
| Stripe | CSV | Balance history import, template matching |
| Flutterwave | CSV | Transaction export import |
| Square | CSV | Payment export import |
| Generic | CSV | Any provider with AI mapping |
Integration Architecture
βββββββββββββββββββββββββββββββββββββββββββ
β Integration Manager β
βββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ β
β β API Sync β β CSV Import β β
β β (Paystack) β β (All) β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββββββββββββββββββββββββββ β
β β ExternalTransactionSource β β
β β (Deduplication & Linking) β β
β βββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββ β
β β Payment & Journal Entry β β
β βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
Dual Entry Points
- From Integrations Page: Click "Import Data" on connected integration β Pre-fills integrationId
- Standalone: Data Imports β New Import β Provider selection dropdown
π Pitch Deck Generation Active
Overview
AI-generated investor pitch decks with live financial metrics. Connect data sources, answer questions, get presentation-ready slides.
Features
- β AI-powered slide generation from financial data
- β Real-time metrics (MRR, burn rate, runway)
- β Customizable templates and branding
- β Export to PDF/PowerPoint
- β Version history and collaboration
Data Sources
- Dashboard stats (revenue, expenses, profit)
- Transaction history and trends
- MRR and subscription metrics
- User-provided business context
- Uploaded presentation assets (logos, charts)
βοΈ Backend Services
Service Architecture
backend/
βββ cmd/
β βββ server/
β βββ main.go (gRPC server, interceptors)
βββ internal/
β βββ accountingserver/ (20+ gRPC handlers)
β β βββ accounts.go
β β βββ payments.go
β β βββ journalentries.go
β β βββ reconciliation.go
β β βββ ai_agent.go
β β βββ ...
β βββ services/ (Business logic)
β β βββ import_parser_service.go
β β βββ import_mapper_service.go
β β βββ import_service.go
β β βββ ai_agent_service.go
β β βββ ...
β βββ middleware/
β β βββ ratelimit.go (Rate limiting)
β β βββ auth.go (JWT validation)
β βββ database/
β β βββ database.go (GORM setup)
β βββ models/
β βββ models.go (50+ database models)
βββ proto/
βββ accounting.proto (gRPC definitions)
Key Services
| Service | Purpose | LOC |
|---|---|---|
| ImportParserService | CSV/Excel parsing & validation | 400 |
| ImportMapperService | AI/template column mapping | 500 |
| ImportService | Import workflow orchestration | 400 |
| AIAgentService | Chatbot with function calling | 600 |
| PaymentService | Payment CRUD & reconciliation | 300 |
| JournalService | Double-entry accounting | 450 |
Database Models (50+)
- Tenant, User, TenantMembership
- Account, Transaction, Payment
- JournalEntry, JournalLine
- ImportSession, ImportFieldMapping, ImportError, ImportTemplate
- Integration, ExternalTransactionSource
- ExpensePolicy, ExpenseClaim, ExpenseApproval
- AIQueryHistory, Subscription, PitchData
π¨ Frontend App
Tech Stack
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- State: React Query (@tanstack/react-query)
- API: Connect-RPC (gRPC-Web)
- Forms: React Hook Form + Zod
- Charts: Recharts
Structure
frontend/src/
βββ app/
β βββ (auth)/
β β βββ login/page.tsx
β β βββ register/page.tsx
β βββ dashboard/
β βββ page.tsx (dashboard)
β βββ payments/
β βββ journal-entries/
β βββ accounts/
β βββ data-imports/
β βββ integrations/
β βββ settings/
βββ components/
β βββ ui/ (shadcn components)
β βββ dashboard/
β βββ data-imports/
β βββ pitch-deck/
βββ lib/
β βββ connect-rpc-browser.ts (gRPC client)
β βββ rate-limit-handler.ts
β βββ api/
β βββ imports.ts
βββ hooks/
β βββ use-imports.ts (React hooks)
βββ gen/
βββ accounting_pb.ts (Protobuf messages)
βββ accounting_connect.ts (gRPC service)
ποΈ Database Schema
Core Tables
-- Tenants & Users
tenants (id, name, base_currency, created_at)
users (id, email, password_hash, created_at)
tenant_memberships (tenant_id, user_id, role)
-- Accounting
accounts (id, tenant_id, name, type, code, parent_id)
transactions (id, tenant_id, amount, date, type, status)
payments (id, tenant_id, amount, date, type, payment_method)
journal_entries (id, tenant_id, date, description, status)
journal_lines (entry_id, account_id, debit, credit)
-- Data Imports
import_sessions (id, tenant_id, filename, status, total_rows)
import_field_mappings (id, session_id, source_column, target_field)
import_errors (id, session_id, row_number, error_message)
import_templates (id, name, provider, column_mappings)
mapping_cache (cache_key, mapping_result, expires_at)
-- Integrations
integrations (id, tenant_id, provider, status, credentials)
external_transaction_sources (integration_id, external_id, transaction_id)
-- AI & Analytics
ai_query_history (id, tenant_id, user_id, query, response)
subscriptions (id, tenant_id, plan, mrr, status)
pitch_data (tenant_id, data_type, content)
π Production Deployment
Deployment Script
# Install dependencies
./deploy.sh install
# Deploy to production
./deploy.sh deploy
# Setup SSL certificate
./deploy.sh ssl yourdomain.com
# Status check
./deploy.sh status
Docker Compose Services
| Service | Image | Purpose |
|---|---|---|
| frontend | node:18-alpine | Next.js app |
| backend | golang:1.25-alpine | gRPC server |
| extractor | golang:1.25-alpine | Document AI |
| postgres | postgres:15-alpine | Database |
| redis | redis:7-alpine | Cache & rate limiting |
| nginx | nginx:alpine | Reverse proxy |
Environment Variables
# Backend (.env)
DATABASE_URL=postgres://user:pass@postgres:5432/invoicepro
REDIS_URL=redis://redis:6379
JWT_SECRET=your-secret-key
OPENAI_API_KEY=sk-...
PAYSTACK_SECRET_KEY=sk_...
# Frontend (.env.local)
NEXT_PUBLIC_GRPC_WEB_URL=http://localhost:8080
NEXT_PUBLIC_API_URL=http://localhost:3000/api
Resource Limits (Optimized for $6-24/mo droplets)
| Service | CPU | Memory |
|---|---|---|
| Frontend | 0.5 | 512MB |
| Backend | 1.0 | 1GB |
| Extractor | 0.5 | 512MB |
| PostgreSQL | 1.0 | 1GB |
| Redis | 0.25 | 256MB |
| Nginx | 0.25 | 128MB |
π Monitoring
Health Checks
# Check all services
docker-compose ps
# View logs
docker-compose logs -f backend
docker-compose logs -f frontend
# Database connection
docker-compose exec postgres psql -U postgres -d invoicepro
# Redis status
docker-compose exec redis redis-cli INFO
Key Metrics
- Rate Limiting: Monitor ResourceExhausted errors (code 8)
- Import System: Track import_sessions.status distribution
- API Performance: gRPC response times < 100ms average
- Database: Connection pool usage, slow queries
- Redis: Memory usage, eviction rate
- Always backup PostgreSQL before major updates
- Monitor disk usage (imports create temp files)
- Set up log rotation for Docker containers
- Test SSL renewal process (Let's Encrypt auto-renews)
Invoice Pro Documentation | Complete Implementation Guide | 2025
For detailed rate limiting documentation, see rate-limiting.html