Financial Reporting Dashboard
Build a financial dashboard that pulls data from multiple sources, generates P&L statements, tracks KPIs, and exports reports — replacing spreadsheet chaos with automated clarity.
Financial data structure and sources
Financial reporting starts with clean, structured data. Most small businesses have financial data scattered across bank statements, invoicing tools, expense trackers, and spreadsheets. Ask Claude Code: Create a new Node.js project with TypeScript for a financial dashboard. Define types at src/types.ts for Transaction (id, date, description, amount as integer in pence, type as income or expense, category, subcategory, account, reference, reconciled boolean), Account (id, name, type as checking or savings or credit_card, currency, current_balance), Category (id, name, type as income or expense, parent_id for subcategories, budget_amount optional), and FinancialPeriod (start_date, end_date, label like January 2024 or Q1 2024). Create a comprehensive category structure covering income (Sales Revenue, Service Revenue, Interest, Other Income) and expenses (Salaries, Rent, Software Subscriptions, Marketing, Professional Services, Travel, Office Supplies, Insurance, Taxes, Bank Fees, Other Expenses). Each category can have subcategories. Ask Claude Code: Create a data import system at src/importers/. Build importers for: CSV bank statements (parse date, description, and amount columns, auto-categorise transactions based on description keywords), Stripe revenue data (parse a Stripe export CSV with payment amount, fees, and net amount), and manual expense entries (a JSON file format for entering cash expenses and receipts). Each importer should validate the data, flag duplicates, suggest categories based on previous similar transactions, and output a standardised Transaction array. Create sample data: 12 months of realistic transactions for a small SaaS business with monthly recurring revenue, operating expenses, and seasonal variations.
Profit and Loss statement
The P&L (Profit and Loss) statement is the most important financial report — it shows whether your business is making or losing money. Ask Claude Code: Create a P&L generator at src/reports/profit-loss.ts. The function takes a date range and produces a structured P&L statement with: Revenue section showing each income category with the total, Cost of Revenue (direct costs of delivering the service), Gross Profit (revenue minus cost of revenue), Operating Expenses broken down by category, Operating Income (gross profit minus operating expenses), Other Income and Expenses (interest, one-time items), and Net Income (the bottom line — did you make money?). Each line should show the amount and the percentage of total revenue. Generate the P&L as both a structured JSON object and a formatted HTML table. Add comparison columns: show this period alongside the previous period and the percentage change. A P&L that shows revenue up 15 percent but expenses up 25 percent tells a very different story than the numbers alone. Ask Claude Code: Create a monthly P&L trend view. Generate the P&L for each of the last 12 months and display as a table with months as columns. This shows patterns: is revenue growing? Are expenses creeping up? Which months are strongest? Add a chart showing revenue, expenses, and net income as three lines over time. Ask Claude Code: Add budget versus actual comparison. Define budget amounts per category per month. The P&L should show a Budget column next to the Actual column with a Variance column showing over or under budget. Colour code: green for under budget on expenses and over budget on revenue, red for the opposite. This makes it immediately obvious where the business is deviating from plan.
Cash flow tracking and forecasting
Profitable businesses can still run out of cash if the timing of income and expenses is misaligned. Ask Claude Code: Create a cash flow tracker at src/reports/cash-flow.ts. Build three reports. Cash Flow Statement: similar to the P&L but based on when money actually moves, not when transactions are recorded. Show cash from operations (daily business activity), cash from investing (equipment purchases, asset sales), and cash from financing (loans, investments). The ending cash balance should match your bank account balance. Daily Cash Position: show the bank balance for each day over the last 90 days as a line chart. Identify the lowest point (the most precarious day) and the average balance. This reveals cash flow patterns — perhaps balance dips every month on the 1st when rent is due and recovers on the 15th when clients pay. Cash Flow Forecast: project cash balance for the next 90 days. Use known upcoming transactions (recurring expenses, expected invoice payments), historical patterns (clients typically pay X days after invoicing), and seasonal adjustments. Show the forecast as a line chart with a confidence band — the optimistic scenario (everyone pays on time) and pessimistic scenario (late payments, unexpected expenses). Highlight any date where the forecast dips below a minimum threshold (like 30 days of operating expenses). Ask Claude Code: Add a runway calculation. Based on the current burn rate (average monthly expenses minus revenue), how many months can the business operate with the current cash balance? Show the runway in months and display it prominently on the dashboard with colour coding: green for over 12 months, yellow for 6 to 12, red for under 6.
KPI tracking and benchmarking
Key Performance Indicators distill complex financial data into actionable numbers. Ask Claude Code: Create a KPI tracking system at src/reports/kpis.ts. Calculate and display these KPIs for a SaaS business. Monthly Recurring Revenue (MRR): sum of all recurring subscription revenue this month. MRR Growth Rate: percentage change from last month. Annual Run Rate (ARR): MRR multiplied by 12. Customer Acquisition Cost (CAC): total sales and marketing spend divided by new customers acquired. Lifetime Value (LTV): average revenue per customer multiplied by average customer lifespan in months. LTV to CAC Ratio: should be above 3 for a healthy SaaS business. Gross Margin: gross profit divided by revenue as a percentage. Net Revenue Retention: revenue from existing customers this month (including expansion) divided by their revenue last month — over 100 percent means existing customers are growing. Burn Rate: net cash consumed per month. Quick Ratio (SaaS): new MRR plus expansion MRR divided by churned MRR plus contraction MRR — measures growth efficiency. For each KPI, show the current value, the trend (up or down from last month), a sparkline chart of the last 12 months, and a target or benchmark for comparison. Ask Claude Code: Add a KPI alert system. Define thresholds for each KPI: green (healthy), yellow (watch), and red (action needed). When a KPI moves to red, generate an alert with the metric name, current value, threshold, and suggested actions. For example: Burn rate alert. Current burn is 15000 per month, runway is 5 months at current rate. Suggested actions: review discretionary spending, accelerate accounts receivable collection, explore revenue acceleration opportunities.
Automated report generation and distribution
Financial reports are only valuable when they reach the right people on time. Ask Claude Code: Create an automated reporting system at src/reports/generator.ts. Build three report types. Monthly Financial Summary: a one-page overview with P&L summary, cash position, top KPIs, and notable items (largest expense, highest revenue day, any KPI alerts). Generate as both HTML and PDF. Quarterly Business Review: a detailed report with full P&L, cash flow statement, KPI trends, budget variance analysis, and a narrative section with AI-generated commentary on the numbers (e.g. Revenue grew 12 percent quarter-over-quarter driven by 8 new enterprise clients. Largest expense increase was in marketing at 23 percent, which correlated with the new client acquisition). Annual Report: comprehensive year-in-review with monthly P&L, year-over-year comparison, KPI annual trends, and financial highlights. Ask Claude Code: Create a report scheduler. The monthly summary generates on the 1st of each month and emails to a configured list of recipients. The quarterly report generates on the 1st of January, April, July, and October. Each report email includes the HTML report in the email body and the PDF as an attachment. Add a report archive: save every generated report to a reports/ directory with the date and type in the filename. Create an index page that lists all archived reports with links. Ask Claude Code: Add data validation before report generation. Check for: uncategorised transactions (these skew the P&L), missing data gaps (days with no transactions that might indicate a data import failure), outlier transactions that might be errors (an expense 10 times larger than the category average), and unreconciled transactions. Show a data quality score: 95 percent of transactions categorised, 0 gaps detected, 2 outliers flagged. Allow the user to address issues before generating the final report.
Dashboard visualisation and interactivity
The dashboard brings all financial data together in one view. Ask Claude Code: Create a comprehensive financial dashboard as a Next.js page. The layout should have: a header showing the company name, current period, and date range selector. A top row of KPI cards showing MRR, cash balance, net income, and runway, each with a trend arrow and sparkline. A second row with two charts: revenue versus expenses over time as a line chart, and expense breakdown as a donut chart. A third row with the cash flow forecast chart and the P&L summary table. A bottom row with recent transactions, upcoming scheduled payments, and alerts. Use Tailwind CSS for styling and a charting library for the visualisations. Ask Claude Code: Add interactivity. Clicking a KPI card should drill down to show the detail behind the number: clicking MRR shows the list of recurring customers and their subscription amounts. Clicking net income shows the full P&L for the period. Clicking cash balance shows the daily cash position chart. Add a date range selector that adjusts all charts and numbers: this month, last month, this quarter, last quarter, this year, last year, and custom range. All reports should update instantly when the date range changes. Ask Claude Code: Add comparison mode. Toggle a switch to show current period versus previous period side by side. Every number shows the delta: MRR is 15000, up 1200 from last month. Every chart shows both periods overlaid. This comparison view is the fastest way to understand whether the business is improving or declining. Add an export function that downloads the current dashboard view as a PNG image (for presentations) or the underlying data as a CSV file (for further analysis in spreadsheets). The dashboard should be the first thing the business owner opens each morning — a 30-second scan that tells them whether the business is healthy.
Security, compliance, and deployment
Financial data requires extra security measures. Ask Claude Code: Add security measures appropriate for financial data. Encrypt the database at rest. Use HTTPS for all connections. Add authentication with role-based access: the owner sees everything, an accountant sees financial data but not customer details, and a team lead sees only their department's budget. Log all access to financial data with who viewed what and when for audit compliance. Add row-level security so users only see data they are authorised for. Financial data retention: keep detailed transaction data for 7 years (tax requirement in most jurisdictions). Archive old data to cold storage after 2 years to keep the active database fast. Create a data export in a standard accounting format (CSV compatible with QuickBooks, Xero, and FreeAgent) for accountant handoff at year-end. Ask Claude Code: Add audit trail functionality. Every change to financial data (categorisation change, manual adjustment, deletion) should be logged with the before and after values, who made the change, when, and why (require a reason field for manual adjustments). This audit trail is essential for financial compliance and for catching errors — if a transaction was miscategorised 3 months ago, you can find and fix it. Deploy the dashboard to Vercel with a PostgreSQL database on Railway. Set up automated daily data imports from connected sources. Configure the report scheduler to send monthly summaries on the 1st. Add a health check that verifies data imports are running and alerts if they fail. The financial dashboard is now a complete system that replaces multiple spreadsheets, gives real-time visibility into business health, and automates the reporting that used to take hours each month. For a small business, this level of financial clarity is transformative — decisions are based on data instead of gut feeling.
Business Intelligence with AI
This guide is hands-on and practical. The full curriculum covers the conceptual foundations in depth with structured lessons and quizzes.
Go to lesson