Local development workflow for Fondo startup tax and bookkeeping integration. Provides a fast feedback loop using CSV exports and mock financial data so you can build dashboards, R&D credit calculators, and burn-rate tools without waiting on live Fondo reports. Toggle between mock mode for rapid iteration and real export parsing for production validation.
import express from "express";
const app = express();
app.use(express.json());
const MOCK = process.env.MOCK_MODE === "true";
if (MOCK) {
const { mountMockRoutes } = require("./mocks");
mountMockRoutes(app);
} else {
const { mountExportRoutes } = require("./export-parser");
mountExportRoutes(app, process.env.FONDO_EXPORT_DIR!);
}
app.listen(3002, () => console.log(`Fondo dev server on :3002 [mock=${MOCK}]`));
export function mountMockRoutes(app: any) {
app.get("/api/transactions", (_req: any, res: any) => res.json([
{ date: "2025-03-01", description: "AWS Infrastructure", amount: -4200, category: "Cloud Hosting", account: "Operating", isRnD: true },
{ date: "2025-03-05", description: "Engineer Salary", amount: -12500, category: "Payroll", account: "Operating", isRnD: true },
{ date: "2025-03-10", description: "Stripe Revenue", amount: 8750, category: "Revenue", account: "Income", isRnD: false },
]));
app.get("/api/reports/pnl", (_req: any, res: any) => res.json({
period: "2025-Q1", revenue: 26250, expenses: 50100, netIncome: -23850,
}));
app.get("/api/reports/rnd-summary", (_req: any, res: any) => res.json({
totalQualified: 38500, categories: ["Cloud Hosting", "Payroll", "Software Tools"],
}));
}