Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Balance Sheet Generator

A full-stack Financial Accounting semester project that uploads transaction records, classifies accounts, generates a balance sheet, validates the accounting equation, and exports reports.

Tech Stack

  • Frontend: React + Vite
  • Backend: Node.js + Express
  • Database: PostgreSQL with Prisma ORM
  • Hosted database: Neon PostgreSQL
  • Frontend deployment: Vercel
  • Backend deployment: Render

Folder Structure

smart-balance-sheet-generator/
  client/       React/Vite app
  server/       Express API, Prisma schema, parsing and report services

Local Setup

  1. Install dependencies:
npm install
  1. Create environment files:
cp server/.env.example server/.env
cp client/.env.example client/.env
  1. Add your Neon PostgreSQL connection string to server/.env.

    MAX_UPLOAD_MB controls the largest accepted upload. The default is 25. MAX_PARSE_ROWS controls how many rows are processed from a file. The default is 100000.

  2. Generate Prisma client and create tables:

npm run prisma:generate
npm run prisma:migrate
  1. Run both apps in separate terminals:
npm run dev:server
npm run dev:client

The frontend runs on http://localhost:5173 and the backend runs on http://localhost:4000.

Supported Uploads

  • CSV
  • Excel .xlsx
  • PDF parsing is experimental and depends on readable text tables

Recommended columns: date, description, account, debit, credit, and/or amount.

A small demo file is included at samples/transactions.csv.

Deployment

Backend on Render

  1. Create a new Render Web Service from this repository.
  2. Use server as the root directory.
  3. Build command: npm install && npx prisma generate && npx prisma db push
  4. Start command: npm start
  5. Add environment variables from server/.env.example.
  6. After the frontend is deployed, update FRONTEND_URL to the Vercel URL.

Frontend on Vercel

  1. Create a new Vercel project from this repository.
  2. Use client as the root directory.
  3. Add VITE_API_URL with the deployed Render backend URL.
  4. Deploy.

Backend on Vercel

If deploying the backend on Vercel instead of Render:

  1. Create a second Vercel project from this repository.
  2. Use server as the root directory.
  3. Add the backend environment variables from the section below.
  4. Deploy.
  5. Use the backend Vercel URL as VITE_API_URL in the frontend Vercel project.

Production Environment Variables

Render backend:

NODE_ENV=production
DATABASE_URL=postgresql://USER:PASSWORD@HOST.neon.tech/smart_balance_sheet?sslmode=require
FRONTEND_URL=https://your-vercel-app.vercel.app
MAX_UPLOAD_MB=25
MAX_PARSE_ROWS=100000
JSON_BODY_LIMIT=75mb

Vercel frontend:

VITE_API_URL=https://your-render-service.onrender.com

Vercel backend:

NODE_ENV=production
DATABASE_URL=postgresql://USER:PASSWORD@HOST.neon.tech/smart_balance_sheet?sslmode=require
FRONTEND_URL=https://your-frontend.vercel.app
MAX_UPLOAD_MB=25
MAX_PARSE_ROWS=100000
JSON_BODY_LIMIT=75mb

Main API Routes

  • POST /api/uploads uploads and parses CSV, Excel, or PDF files.
  • POST /api/balance-sheet recalculates a balance sheet from transactions.
  • POST /api/reports/pdf downloads a PDF report.
  • POST /api/reports/excel downloads an Excel report.

About

Web app for generating and managing balance sheets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages