A comprehensive web-based project appraisal and feasibility analysis tool similar to UNIDO's COMFAR. Built with React, TypeScript, Node.js, and PostgreSQL.
- Project Setup: Define project parameters, timeline, and financial assumptions
- Investment Planning: Track fixed assets, pre-production costs, working capital with depreciation
- Production & Revenue: Capacity planning, product pricing, and sales projections
- Operating Costs: Fixed and variable cost tracking with escalation
- Financing: Equity, loans with amortization schedules, and grants
- Cash Flow Projections: Operating, investing, and financing activities
- Financial Statements: Income Statement and Balance Sheet generation
- Profitability Indicators:
- Net Present Value (NPV)
- Internal Rate of Return (IRR)
- Modified IRR (MIRR)
- Payback Period (simple and discounted)
- Return on Investment (ROI)
- Benefit-Cost Ratio
- Break-Even Analysis: Units and revenue calculation with visualization
- Sensitivity Analysis: Variable impact analysis with tornado charts
- Scenario Analysis: Best/base/worst case comparisons
- PDF Reports: Professional formatted reports with charts
- Excel Export: Multi-sheet workbooks with formulas preserved
| Layer | Technology |
|---|---|
| Frontend | React 18, TypeScript, Tailwind CSS, Recharts |
| State Management | Zustand |
| Backend | Node.js, Express, TypeScript |
| Database | PostgreSQL with Prisma ORM |
| Authentication | JWT + bcrypt |
| Reports | PDFKit, ExcelJS |
- Node.js 18+
- PostgreSQL 14+
- npm or yarn
-
Clone the repository
git clone <repository-url> cd fs-builder
-
Install dependencies
npm install
-
Configure environment
cp .env.example .env # Edit .env with your database credentials -
Set up the database
npm run db:generate npm run db:migrate
-
Start development servers
npm run dev
This will start:
- Frontend at http://localhost:3000
- Backend at http://localhost:4000
fs-builder/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ features/ # Feature modules
β β β βββ investment/
β β β βββ production/
β β β βββ costs/
β β β βββ financing/
β β β βββ analysis/
β β β βββ reports/
β β βββ hooks/ # Custom hooks & stores
β β βββ pages/ # Route pages
β β βββ services/ # API client
β β βββ types/ # TypeScript types
β β βββ utils/ # Helpers
β βββ package.json
βββ server/ # Node.js backend
β βββ src/
β β βββ routes/ # API routes
β β βββ middleware/ # Auth, error handling
β β βββ services/
β β β βββ calculations/ # Financial calculation engine
β β β βββ reports/ # Report generators
β β βββ types/
β βββ package.json
βββ prisma/ # Database schema
β βββ schema.prisma
βββ package.json # Root package.json
POST /api/auth/register- Register new userPOST /api/auth/login- LoginGET /api/auth/me- Get current user
GET /api/projects- List projectsPOST /api/projects- Create projectGET /api/projects/:id- Get projectPUT /api/projects/:id- Update projectDELETE /api/projects/:id- Delete projectPOST /api/projects/:id/duplicate- Duplicate project
/api/projects/:id/investments- Investment CRUD/api/projects/:id/products- Products CRUD/api/projects/:id/costs- Operating costs CRUD/api/projects/:id/financing- Financing CRUD
GET /api/projects/:id/analysis/indicators- Financial indicatorsGET /api/projects/:id/analysis/cashflow- Cash flow projectionsGET /api/projects/:id/analysis/income-statement- Income statementsGET /api/projects/:id/analysis/balance-sheet- Balance sheetsPOST /api/projects/:id/analysis/sensitivity- Sensitivity analysisGET /api/projects/:id/analysis/break-even- Break-even analysis
POST /api/projects/:id/reports/pdf- Generate PDF reportPOST /api/projects/:id/reports/excel- Generate Excel report
NPV = Ξ£ (CFt / (1 + r)^t)
Where CFt = cash flow at time t, r = discount rate
Rate r where NPV = 0 (calculated using Newton-Raphson method)
Year when cumulative cash flow turns positive
Break-Even Units = Fixed Costs / (Price - Variable Cost per Unit)
npm run testnpm run buildnpm run db:generate # Generate Prisma client
npm run db:migrate # Run migrations
npm run db:push # Push schema changes (dev only)MIT License
Inspired by UNIDO's COMFAR (Computer Model for Feasibility Analysis and Reporting) software for investment project analysis.