TIMELINE
APR 2026 – JUN 2026
PROJECT TYPE
Independent Project
ROLE
Sole Developer
STACK
Python • Flask • SQLite • Gemini AI
ARCHITECTURE
Multi-Tenant SaaS ERP
MODULES
7 core modules
Project Overview
ERPilot AI is a multi-tenant ERP platform for small businesses. One deployment serves many companies, and each company gets its own employees, inventory, suppliers, sales orders, reports, and notifications behind a single dashboard. It also includes an AI assistant powered by Gemini 2.5 Flash. Instead of building a report or writing a query, a manager can ask a question like which products are low on stock, and get an answer based on that company's live data. The whole system is built in Python and Flask, as an independent project after graduation.
Key achievements
- Built a multi-tenant ERP from scratch, with every query scoped to the signed-in company.
- Covered employees, inventory, suppliers, sales, reports, and notifications in one dashboard.
- Connected Gemini 2.5 Flash to live company data so staff can ask questions in plain English.
- Enforced Admin, Manager, and Employee permissions with a reusable role decorator.
- Made sales checkout deduct and restore stock atomically, with low-stock alerts.
- Wrote 37 pytest cases covering auth, CRUD, stock logic, exports, and role restrictions.
Problem Statement
Small businesses often run employees, stock, suppliers, and sales out of separate spreadsheets. Numbers drift out of sync, reports take manual effort, and nobody has one clear view of the business. Getting answers from that data usually needs someone who can write queries, which most operations teams cannot do.
Solution Approach
ERPilot AI puts the core business modules in one application. A company registers once, gets its own workspace, and manages staff, products, suppliers, and orders from a shared dashboard. Every record carries a tenant ID, so companies stay separate even though they share one database. Sales and inventory are connected: placing an order checks stock and deducts it in the same step, and cancelling or deleting an order puts the stock back. Low stock raises a notification. On top of this data, the AI assistant lets people ask questions in plain language and get answers without writing any SQL.
Architecture Overview
ERPilot AI is a Flask application organized into blueprints, with one shared database where every record belongs to a tenant.
- Flask blueprints split the app into nine modules: auth, dashboard, employees, inventory, suppliers, sales, reports, notifications, and the AI assistant.
- A before-request guard blocks every route except login, register, and the landing page, and a role decorator checks permissions on each action.
- Every table carries a tenant ID, and every query filters on the tenant stored in the user's session.
- The AI module loads the tenant's data as JSON, sends it to Gemini 2.5 Flash as context, and retries up to three times on rate limits or outages.
- Reports are generated on demand, with openpyxl for Excel files and ReportLab for PDFs.
- Docker Compose runs the app on Gunicorn next to a PostgreSQL container, while local development uses SQLite.
Tech Stack
Backend
- Python
- Flask
- SQLite
Frontend
- HTML
- CSS
- JavaScript
- Bootstrap 5
- Chart.js
AI
- Google Gemini AI
Reporting
- OpenPyXL
- ReportLab
Security
- Role-Based Access
- Password Hashing
- Session Auth
Deploy & Test
- Docker Compose
- Gunicorn
- PostgreSQL
- Pytest
Key Features
- Company self-registration that creates a new tenant and its first admin.
- Tenant-scoped data, so one company never sees another company's records.
- Employee directory with departments, designations, and unique employee IDs.
- Inventory catalog with SKUs, reorder levels, and low-stock alerts.
- Supplier directory for vendor contacts and addresses.
- Sales orders that check and deduct stock at checkout and restore it on cancel or delete.
- Dashboard with KPI cards, a monthly revenue chart, stock distribution, and an activity timeline.
- AI assistant that answers questions about the company's own data in plain English.
- Retry handling for Gemini rate limits and outages, plus a log of every AI query.
- CSV, Excel, and PDF exports for employees, inventory, suppliers, and sales.
- Notification bell for new orders and inventory changes.
- Role-based permissions for Admin, Manager, and Employee users.
Lessons Learned
Retrospective
The biggest lesson was how much a multi-tenant system depends on discipline. Isolation here comes from filtering every query by tenant, so a single missed filter would leak data between companies. That pushed me to keep tenant lookups in one place and to write tests for the places where mistakes would hurt most. Sales and inventory taught me to treat stock as something that has to stay correct. Creating, editing, cancelling, and deleting an order each change stock differently, and getting those paths consistent took more care than building the screens. The AI assistant was easier to build than to trust. Sending the company's data as context and keeping the temperature low gave steady answers, but the model can still be slow or rate limited, so retries and query logging mattered as much as the prompt. If I extended this project, I would move secrets fully into environment variables, add a proper audit trail for every write, and switch production to PostgreSQL with migrations.
System Screenshots & Wireframes
01. Authentication Entry Portal














