Live Demo: https://trustaudit-wxd7.onrender.com
Real-time 43B(h) compliance engine that turns WhatsApp challan photos into tax deduction shields.
TrustAudit automates the critical "Date of Acceptance" extraction from paper challans sent via WhatsApp, ensuring MSME payments comply with India's Section 43B(h) -- the provision that disallows entire deductions if payments exceed 45 days.
Under Section 43B(h) of the Income Tax Act, if a buyer fails to pay an MSME vendor within 45 days of acceptance, the entire invoice amount becomes non-deductible -- a 30% overnight tax liability cliff. Most Indian enterprises still manage this with spreadsheets and paper trails.
TrustAudit provides a CFO dashboard that:
- Ingests challan photos via a WhatsApp webhook (driver sends photo -> Vision AI extracts date)
- Monitors deadlines with real-time countdown timers per invoice
- Calculates risk exposure with a live Tax Savings Simulator
- Provides evidence trails linking WhatsApp messages to extracted data for audit compliance
| Layer | Technology |
|---|---|
| Backend | Python 3.11+, FastAPI, SQLAlchemy, SQLite |
| Frontend | React 19, Vite 6, Tailwind CSS 4, Recharts |
| Animations | Framer Motion |
| Icons | Lucide React |
| Toasts | Sonner |
| Deployment | Render.com (free tier) |
trustaudit/
backend/
app/
__init__.py
main.py # FastAPI entry + static file serving
database.py # SQLAlchemy engine + session
models.py # Invoice ORM model
routes.py # API endpoints (/invoices, /stats, /webhook)
schemas.py # Pydantic request/response models
seed.py # Database seeder (5 demo invoices)
simulate_driver.py # Demo script: simulates WhatsApp upload
requirements.txt
uploads/ # Challan image storage
frontend/
src/
App.jsx # Root: layout, polling, Sonner toasts
index.css # Design system (glassmorphism, glow effects)
main.jsx # React entry point
lib/cn.js # clsx + tailwind-merge utility
components/
Dashboard.jsx # Main grid: chart, simulator, table
ComplianceChart.jsx # AreaChart with gradient fills
TaxSimulator.jsx # 43B(h) risk model with slider
ActivityTicker.jsx # Live transaction stream feed
InvoiceDetailSheet.jsx # Evidence drawer (WhatsApp + extracted data)
AnimatedCounter.jsx # Smooth number interpolation
vite.config.js
package.json
render.yaml # Render.com deployment blueprint
start.sh # Local dev: runs both servers
README.md
- Python 3.11+
- Node.js 20+
- npm 10+
# Clone the repository
git clone https://github.com/itsloganmann/TrustAudit.git
cd TrustAudit
# Backend
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python seed.py # Seed database with demo invoices
uvicorn app.main:app --reload --port 8000 &
# Frontend (new terminal)
cd frontend
npm install
npm run devOpen http://localhost:5173 -- the Vite dev server proxies /api requests to the FastAPI backend.
chmod +x start.sh
./start.shThe simulation script mimics a driver uploading a challan photo via WhatsApp:
cd backend
source venv/bin/activate
python simulate_driver.pyWhat happens:
- Picks a random PENDING invoice from the database
- Prints:
Simulating Driver Upload via WhatsApp... - Sends the challan image to the
/api/webhook/whatsappendpoint - The dashboard updates in real-time (row flips from red to green)
- A Sonner toast appears: "Tax Shield Secured: INR X deduction protected."
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/invoices |
List all invoices with computed deadline fields |
GET |
/api/stats |
Aggregate stats (portfolio value, risk, savings) |
GET |
/api/activity |
Recent activity/event log |
POST |
/api/webhook/whatsapp |
WhatsApp challan upload webhook |
GET |
/health |
Health check |
GET |
/docs |
Interactive API documentation (Swagger) |
- Push this repo to GitHub
- Go to render.com/new
- Select Blueprint and connect this repository
- Render reads
render.yamland deploys automatically
The build process:
- Installs Node.js dependencies and builds the React frontend
- Installs Python dependencies and seeds the database
- Starts FastAPI serving both the API and the static frontend
# Build frontend
cd frontend && npm install && npm run build
# Run production server
cd ../backend
pip install -r requirements.txt
python seed.py
uvicorn app.main:app --host 0.0.0.0 --port 8000The app will be available at http://localhost:8000 with the frontend served from /frontend/dist.
- Background: Deep slate gradient (
slate-950toslate-900) - Surfaces: Glassmorphism (
bg-white/[0.03]+backdrop-blur-md+border-white/[0.06]) - Accent (Verified): Emerald (
#10b981) with glow text-shadow - Accent (Risk): Rose (
#f43f5e) with glow text-shadow - Font: Inter / system sans-serif,
tracking-tighton headers - Icons: Lucide React (zero emojis)
Click any invoice row to open a full-width slide-out panel showing:
- Left: Mock WhatsApp conversation with the driver (chat bubbles, embedded challan photo)
- Right: AI-extracted verification data with green checkmarks
Interactive slider modeling the 43B(h) "cliff" -- drag past 45 days to see deductions instantly disallowed. The number glows emerald (safe) or rose (danger).
Server-log aesthetic activity feed with Framer Motion animations. New events slide in from the top with spring physics.
When the simulation script verifies an invoice, a toast fires: "Tax Shield Secured: INR 4,50,000 deduction protected."
MIT
Built for Berkeley SkyDeck Demo