โจ Real-time Cap Tables ย |ย ๐ค AI Equity Advisor ย |ย ๐ฎ๐ณ 100% INR Native
CapZen is a full-stack SaaS application that gives Indian startups a single source of truth for all things equity. Built on React + Vite (frontend) and Node.js + Express + SQLite (backend), with optional OpenAI GPT-4 integration for the AI Equity Advisor.
Key design decisions:
- All monetary values are in INR (โน) โ no USD ever.
- All data is auto-saved per user to a SQLite database on every change.
- A race-condition-safe
isDataLoadedflag ensures saved data is never overwritten by an empty session on login. - Fully self-hostable โ no cloud dependencies required.
| Feature | Description |
|---|---|
| ๐ Cap Table Management | Real-time ownership percentages across all share classes |
| ๐ฅ Shareholder Registry | Founders, investors, employees, advisors โ all in one place |
| ๐ฐ Investment Rounds | Log Seed, Series A/B/C, and Bridge rounds with full term details |
| ๐ Dilution Modeling | Simulate future rounds and see ownership impact instantly |
| ๐ Convertible Instruments | Track SAFEs and convertible notes with cap & discount logic |
| ๐ ESOP & Stock Grants | Manage employee option pools with vesting schedules |
| ๐ Waterfall Analysis | Model exit scenarios โ acquisition, IPO, or liquidation |
| ๐ค AI Equity Advisor | Plain-English equity Q&A powered by OpenAI GPT-4 |
| ๐ฅ XLSX Export | One-click export of board-ready cap table reports |
| ๐ Secure Auth | Signup/login with PBKDF2-SHA512 password hashing |
| Technology | Version | Purpose |
|---|---|---|
| React | 18.3 | UI framework |
| TypeScript | 5.5 | Type safety |
| Vite | 5.4 | Build tool & dev server |
| Tailwind CSS | 3.4 | Utility-first styling |
| Radix UI | Various | Accessible component primitives |
| React Router DOM | 6.26 | Client-side routing |
| Recharts | 2.12 | Equity visualizations |
| xlsx | 0.18 | Excel export |
| Technology | Purpose |
|---|---|
| Node.js + Express | REST API server |
| better-sqlite3 | Lightweight, fast SQLite driver |
| OpenAI SDK | AI Equity Advisor integration |
| crypto (built-in) | PBKDF2-SHA512 password hashing |
| dotenv | Environment variable management |
CapZen/
โโโ server/
โ โโโ index.js โ Express API (auth, data save/load, AI)
โโโ src/
โ โโโ components/
โ โ โโโ AIEquityCalculator.tsx โ AI Advisor UI
โ โ โโโ CapTableDisplay.tsx โ Ownership table + chart
โ โ โโโ CompanyInfo.tsx โ Company setup form
โ โ โโโ ConvertibleInstruments.tsx
โ โ โโโ InvestmentRounds.tsx
โ โ โโโ ShareholderManagement.tsx
โ โ โโโ StockGrants.tsx
โ โ โโโ WaterfallAnalysis.tsx
โ โ โโโ Logo.tsx / Footer.tsx
โ โโโ contexts/
โ โ โโโ AuthContext.tsx โ Auth state + API helpers
โ โโโ pages/
โ โ โโโ Landing.tsx โ Marketing landing page
โ โ โโโ Login.tsx / Signup.tsx
โ โ โโโ Index.tsx โ Main dashboard
โ โโโ types/index.ts โ TypeScript interfaces
โ โโโ utils/enhancedExportUtils.tsโ XLSX export logic
โโโ .env โ API keys (not committed)
โโโ package.json
โโโ vite.config.ts
- Node.js v18+
- npm v9+
- OpenAI API key (optional โ only for AI Advisor)
# 1. Clone the repo
git clone https://github.com/sakshinikam05/CapZen.git
cd CapZen
# 2. Install dependencies
npm install
# 3. Set up environment
cp .env.example .env
# Edit .env with your OpenAI key# .env โ place in project root
OPENAI_API_KEY=sk-your-openai-api-key-hereThe AI Equity Advisor is the only feature requiring an API key. All other features work without it.
- Make sure Node.js is installed before running the project.
- Keep the
.envfile private. - Use
npm installbefore starting the app.
CapZen runs two processes in parallel:
# Terminal 1 โ Backend API (port 3001)
node server/index.js
# Terminal 2 โ Frontend dev server (port 8080)
npm run devOr run both together (macOS/Linux):
node server/index.js & npm run devOn first run, the SQLite database is automatically created at server/capzen.db.
Production build:
npm run build # Output in dist/Base URL:
http://localhost:3001
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/signup |
Create account |
POST |
/api/login |
Authenticate user |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/data/save |
Save a data section (company, shareholders, etc.) |
GET |
/api/data/load/:userId |
Load all data for a user |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/ai/calculate |
Submit equity question to GPT-4 |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Server + DB status check |
SQLite with WAL mode ยท Auto-created on first run
| Column | Type | Notes |
|---|---|---|
id |
TEXT (PK) | UUID |
name |
TEXT | Full name |
email |
TEXT UNIQUE | Login email |
password_hash |
TEXT | PBKDF2-SHA512 + random salt |
created_at |
DATETIME | Auto timestamp |
| Column | Type | Notes |
|---|---|---|
id |
TEXT (PK) | {userId}_{dataType} |
user_id |
TEXT (FK) | References users.id |
data_type |
TEXT | company, shareholders, etc. |
data_json |
TEXT | JSON-serialized data |
updated_at |
DATETIME | Last save timestamp |
Uses UPSERT โ each save replaces the previous version of that data type.
| Concern | Implementation |
|---|---|
| ๐ Passwords | PBKDF2 + SHA-512 + 16-byte random salt |
| ๐ Sessions | Stored in localStorage post-auth |
| ๐ CORS | Scoped to localhost:8080 in dev |
| ๐พ Database | Local SQLite file, never publicly exposed |
| ๐ Data isolation | All queries scoped strictly by userId |
Sakshi Nikam |
Sneha Andhale |
Shrushti Pawar |
Vishakha Patil |
