EstateSync is a comprehensive, role-based Fund Management & Accounting System. It is designed to manage organizational funds, employee/team wallets, expense requests, approvals, allocations, and full financial transactional auditing.
The system operates with strict Role-Based Access Control (RBAC) and immutable PostgreSQL transactional logic to ensure that every rupee moved within the organization is tracked and that wallet balances never go negative.
- Frontend: Next.js, React, Tailwind CSS
- Backend: Node.js, Express.js
- Database: PostgreSQL
- ORM: Prisma
- Authentication: JSON Web Tokens (JWT) + bcrypt
- Hierarchical Wallets: Real-time wallet tracking for Admins, Managers, and Employees.
- Strict Atomic Transactions: Funds are transferred safely using Prisma
$transactionblocks to prevent race conditions. - Fund Requests: Employees can request funds from managers; managers can request from Admins.
- Expense Tracking: Users can upload categorized expenses which automatically deduct from their wallet balances.
- Real-Time Dashboards: Dynamic statistical aggregation to show organizational cash, manager budgets, and employee spends.
- Immutable Ledger: Every fund movement is recorded in a central
WalletTransactionledger.
- Node.js (v18+)
- PostgreSQL (Local or Cloud URL)
- Navigate to the
backenddirectory. - Create a
.envfile (if not already present). - Set your PostgreSQL database connection string and JWT secrets:
DATABASE_URL="postgresql://username:password@localhost:5432/estatesync?schema=public" JWT_SECRET="your_jwt_secret_here" JWT_REFRESH_SECRET="your_refresh_secret_here" PORT=4000
Open a terminal and run the following commands:
cd backend
npm installInitialize the Database: Push the Prisma schema to your database to create the tables:
npx prisma db pushSeed the Database: Run the seeder script. This will create the required roles, permissions, categories, and dummy users (along with their wallets).
node prisma/seed.jsThe seeder creates 6 test users. They all use the password password123.
admin@estatesync.localmanager@estatesync.localsales@estatesync.localmarketing@estatesync.localaccounting@estatesync.localother@estatesync.local
Start the Backend Server:
npm run devThe API will be available at http://localhost:4000.
Open a new terminal and run the following commands:
cd frontend
npm install
npm run devThe web application will be available at http://localhost:3000.
backend/prisma/schema.prisma- The core database schema and relationships.backend/src/controller/- Business logic for expenses, wallets, fund requests, and live dashboard stats.frontend/src/app/dashboards/- Next.js page routes for the role-specific dashboards.frontend/src/components/- Reusable React components (Forms, Tables, Stats).prd.md- The Product Requirements Document defining the exact behavior of the system.complete.md- The current feature completion tracking matrix.
- Token Expired Error on Frontend: JWT tokens currently expire after 24 hours. Simply click "Logout" in the sidebar and log back in to refresh your token.
- Prisma Schema Changes: If you modify
schema.prisma, runnpx prisma db pushto sync the changes to your database.