Skip to content

Subeshrock/deal_planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

58 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Deal Simulator - Professional M&A Financial Modeling Platform

Next.js React TypeScript Tailwind CSS PWA

A comprehensive, professional-grade financial modeling tool for mergers & acquisitions (M&A). Model complex deal structures including earn-outs, seller financing, and all-cash scenarios with advanced analytics, risk assessment, and scenario planning.

โœจ Features

๐ŸŽฏ Core Functionality

  • Deal Structure Modeling: Earn-out, seller financing, and all-cash payment scenarios
  • Financial Projections: Multi-year cash flow analysis with growth and churn factors
  • Real-time Calculations: Instant updates as you adjust parameters

๐Ÿ“Š Advanced Analytics

  • Sensitivity Analysis: Interactive sliders for real-time parameter testing
  • Financial Metrics: NPV, IRR, and payback period calculations
  • Monte Carlo Simulations: Probabilistic risk analysis with 1000+ scenarios
  • Multi-currency Support: USD, EUR, GBP, JPY, CAD, AUD with inflation adjustments

๐Ÿ› ๏ธ Professional Tools

  • Scenario Management: Save, load, and compare multiple deal scenarios
  • Data Import: CSV upload for historical revenue trends
  • PDF Reports: Professional export with charts and detailed summaries
  • Chart Visualization: Interactive bar charts with export capabilities

๐ŸŽจ User Experience

  • Responsive Design: Mobile-first approach with touch-friendly interfaces
  • Accessibility: WCAG compliant with ARIA labels and semantic HTML
  • Progressive Web App: Offline functionality and installable experience
  • Guided Onboarding: Tooltips and tutorials for new users

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm, yarn, pnpm, or bun

Installation

  1. Clone the repository

    git clone <repository-url>
    cd deal-simulator
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
    # or
    bun install
  3. Run the development server

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
    # or
    bun dev
  4. Open your browser Navigate to http://localhost:3000

๐Ÿ“– Usage Guide

Basic Deal Modeling

  1. Input Parameters:

    • Annual Revenue: Base revenue figure
    • Churn Rate: Annual revenue loss percentage
    • Growth Rate: Expected annual revenue increase
    • Earn-out %: Percentage of revenue paid as earn-out
    • Tax Rate: Applicable tax percentage
  2. Advanced Options:

    • Earn-out Years: Duration of earn-out payments
    • Seller Financing: Percentage and interest rate
    • All Cash: Upfront payment percentage
    • Currency: Deal currency selection
    • Inflation: Annual inflation rate
  3. Analysis Features:

    • Adjust sliders for real-time sensitivity analysis
    • View financial metrics (NPV, IRR, payback period)
    • Run Monte Carlo simulations for risk assessment

Scenario Management

  • Save Scenarios: Store current deal parameters for later use
  • Load Scenarios: Retrieve and modify saved deals
  • Compare Scenarios: Analyze multiple deal structures side-by-side

Data Import

Upload CSV files with historical data:

year,revenue
2020,1000000
2021,1200000
2022,1400000

The system will calculate average growth rates automatically.

Export & Reporting

  • PDF Reports: Comprehensive deal summaries with charts
  • Chart Export: PNG images of visualizations
  • Scenario Sharing: Save and share deal configurations

๐Ÿ—๏ธ Architecture

Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript
  • Styling: Tailwind CSS 4, shadcn/ui components
  • Charts: Recharts for data visualization
  • Forms: React Hook Form with Zod validation
  • PDF Generation: @react-pdf/renderer
  • PWA: next-pwa for offline functionality

Project Structure

deal-simulator/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                 # Next.js app router
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx      # Root layout
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx        # Main deal simulator page
โ”‚   โ”‚   โ””โ”€โ”€ globals.css     # Global styles
โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”‚   โ”œโ”€โ”€ ui/            # shadcn/ui components
โ”‚   โ”‚   โ”œโ”€โ”€ InputForm.tsx  # Deal parameter input
โ”‚   โ”‚   โ”œโ”€โ”€ ChartDisplay.tsx # Data visualization
โ”‚   โ”‚   โ”œโ”€โ”€ SummaryCard.tsx # Results summary
โ”‚   โ”‚   โ””โ”€โ”€ DealSummaryPdf.tsx # PDF generation
โ”‚   โ”œโ”€โ”€ lib/               # Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ calculations.ts # Financial calculations
โ”‚   โ”‚   โ”œโ”€โ”€ schema.ts      # Input validation
โ”‚   โ”‚   โ””โ”€โ”€ formatter.ts   # Data formatting
โ”‚   โ”œโ”€โ”€ types/            # TypeScript definitions
โ”‚   โ””โ”€โ”€ utils/            # Utility functions
โ”œโ”€โ”€ public/               # Static assets
โ”‚   โ”œโ”€โ”€ manifest.json     # PWA manifest
โ”‚   โ””โ”€โ”€ fonts/           # Custom fonts
โ”œโ”€โ”€ CONTEXT.md           # Project context and roadmap
โ””โ”€โ”€ README.md           # This file

Key Components

Financial Engine (src/lib/calculations.ts)

  • Deal scenario calculations
  • Financial metrics (NPV, IRR, payback period)
  • Monte Carlo simulation engine
  • Multi-year cash flow projections

Input Validation (src/lib/schema.ts)

  • Zod schemas for type-safe input validation
  • Business logic constraints
  • Error message handling

UI Components

  • InputForm: Parameter input with real-time validation
  • ChartDisplay: Interactive data visualization
  • SummaryCard: Results presentation with metrics
  • ExportButton: PDF generation and download

๐Ÿ”ง Development

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run start    # Start production server
npm run lint     # Run ESLint

Code Quality

  • TypeScript: Strict type checking enabled
  • ESLint: Code linting and formatting
  • Prettier: Code formatting (via ESLint)
  • Git Hooks: Pre-commit quality checks

Testing

# Run tests
npm run test
npm run test:watch
npm run test:coverage

The project includes comprehensive unit tests for:

  • Financial calculations (NPV, IRR, Monte Carlo)
  • Schema validation and input constraints
  • Edge cases and error handling

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run quality checks
    npm run lint
    npm run build
  5. Commit your changes
    git commit -m "feat: add amazing feature"
  6. Push to the branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Development Guidelines

  • Follow existing code style and patterns
  • Add TypeScript types for new features
  • Include comprehensive error handling
  • Update documentation for new features
  • Test on multiple devices/browsers

๐Ÿ“‹ Roadmap

Completed โœ…

  • Basic deal calculations (earn-out, financing, cash)
  • Input validation and error handling
  • Real-time sensitivity analysis
  • Financial metrics (NPV, IRR, payback)
  • Monte Carlo simulations
  • Scenario management
  • Data import/export
  • PDF report generation
  • PWA functionality
  • Accessibility improvements

Future Enhancements ๐Ÿš€

  • User accounts and cloud storage
  • Collaboration features
  • Advanced financing structures
  • Industry benchmarking
  • API integrations
  • Mobile app development

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

For questions, issues, or contributions:

  • Open an issue on GitHub
  • Check the CONTEXT.md for project details
  • Review the codebase for implementation examples

Built with โค๏ธ for the M&A community

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก