A modern Enterprise Resource Planning (ERP) system built with Next.js, featuring a monorepo structure powered by Turborepo. This project includes a frontend application, a backend API server, and shared packages for UI components and database access.
We Currently have 4 portals with 2 planned. The current portals are:
- QOAC Portal: For QOAC Team to assign KPIs to departments and review submissions.
- HOD Portal: For Heads of Departments to review and manage their KPIs.
- Faculty Portal: For faculty coordinators and members to fill out assigned KPIs.
- Developer team Portal: Postman replacement (TBA).
Future portals include (TBD):
- Admin Portal: For administrators to manage the entire system, including user roles and permissions.
- Student Portal: For students as a direct replacement to slcm.
- Qoac Dashboard should contain the following:
- Dashboard showing analytics (currently showing all submissions which is inefficient)
- Navbar with profile and search bar for searching submissions, etc.
- Sidebar with links to:
- KPI Builder (Currently build kpi rename it please)
- Assign KPI (Rename to Assign KPI to Department)
- Review KPI (Rename to Review Submissions)
- Generate Report
- Settings
- Pages:
- KPI Builder (Currently build kpi rename it please) (We are creating templates here)
Note: This page will interact with the
kpi,pillarstable in the database. And it will interact with the api's defined underapps/server/src/routes/kpi.ts,apps/server/src/routes/kpi.ts.- It will have the following components:
- KPI Builder (Kpi will be assigned todepartment_pillar in this stage):
- Create or select pillar component
- On creation or selection of pillar component, it will show the following:
- Existing KPI Metadata (with button to view/edit/delete)
- Create KPI button
- KPI Builder (Kpi will be assigned todepartment_pillar in this stage):
- It will have the following components:
- Assign KPI (Rename Title of page to Asssign KPI anddepartment_pillar to departments):
Note: This page will interact with the
kpi,department,pillarsandassigned_kpitables in the database. And it will interact with the api's defined underapps/server/src/routes/kpi.tsandapps/server/src/routes/department.ts.- Department Selector only at load
- On selection of department, it will show the following:
- Select Pillar and below it the following components:
- Existing Assigned KPI Metadata (with button to allocate/deallocate kpi to department)
- Button to edit some metadata of the KPI (Like Weightage, etc)
- Status of KPI will be shown as well
- Select Pillar and below it the following components:
- Review KPI (Rename Title of page to Review Submissions):
- Department Selector only at load
- On selection of department, it will show the following:
- Department specific analytics
- Select Pillar and below it the following components:
- Assigned KPI Metadata with the button to review which will load a page with following:
- Filled Data with spaces to add new generated columns to add comments, accept/reject/redo status and percentage completion.
- Button to download the report in excel/pdf format.
- Status of KPI will be shown as well
- Assigned KPI Metadata with the button to review which will load a page with following:
- Generate Report (Rename to generate report of Department filled KPI):
- Select Department and Pillar:
- Select KPI to generate report for:
- Gemini will generate the report with format specified(if needed) and button to download will be provided.
- Select KPI to generate report for:
- Select Department and Pillar:
- Settings (TBD):
- User Profile Settings
- Application Settings (if any)
- KPI Builder (Currently build kpi rename it please) (We are creating templates here)
Note: This page will interact with the
HOD (Add check in login to load according to department) (Faculty assignment of kpi will be added at a later stage)
- HOD Dashboard should contain the following:
- Dashboard showing analytics
- Navbar with profile and search bar for searching submissions, etc.
- KPI Management
- Sidebar with links to:
- KPI Management
- Settings
- Pages:
- KPI Management
- KPI Metadata with button that leads to a page with the following:
- Table to add data and make sure to check and show existing data. (Front-end done)
- Button to save the data. (Front-end done)
- Button to download the template in excel/pdf format. (Front-end done)
- Button to upload the data in excel/pdf format. (Front-end done)
- Button to generate the report in excel/pdf format. (Front-end done)
- KPI Metadata with button that leads to a page with the following:
- Assign KPI Coordinators:
- Show Existing Coordinators with button to add new coordinator.
- Button to edit and delete existing coordinators.
- Kpi Coordinator metadata to be shown as well in tabular format.
- KPI Management
- To Do:
- Generate report functionality
- Upload excel
- Download excel/pdf
KPI Coordinator Dashboard
- Faculty Coordinator Dashboard should contain the following:
- Dashboard showing if any kpi is left to be filled and relevant analytics.
- Navbar with profile and search bar for searching submissions, etc.
- KPI Management
- Sidebar with links to:
- Dashboard
- KPI Management
- Settings
- Pages:
- KPI Management
- KPI Metadata with button that leads to a page with the following:
- Table to add data and make sure to check and show existing data.
- Button to save the data.
- Button to download the template in excel/pdf format.
- Button to upload the data in excel/pdf format.
- KPI Metadata with button that leads to a page with the following:
- KPI Management
ERP-SYS/
├── apps/
│ ├── web/ # Frontend application (Next.js)
│ └── server/ # Backend API server (Node.js/Express or similar)
├── packages/ # Shared packages
│ ├── ui/ # Shared UI components
│ └── db/ # Shared database access (Prisma)
- Frontend: Built with Next.js 13+ using the App Router and React Server Components.
- Backend: API server for handling business logic and database interactions.
- Database: Prisma ORM with PostgreSQL.
- Authentication: Powered by NextAuth.js (Auth.js).
- Monorepo: Managed with Turborepo for efficient builds and dependency sharing.
- UI Components: Shared UI components using
shadcn/uiand Tailwind CSS. - Drag-and-Drop: Form builder with
@dnd-kit.
- Node.js: v18+ (LTS recommended)
- pnpm: v8+ (for monorepo dependency management)
-
Clone the repository:
git clone https://github.com/yourusername/ERP-SYS.git cd ERP-SYS -
Install dependencies:
pnpm install
-
Set up environment variables:
- Create a
.envfile in thedbfolder with the following template:DATABASE_URL="your-database-url" DIRECT_URL="your-direct-database-url"
DATABASE_URL: The main connection string for your database.DIRECT_URL: A direct connection string for bypassing connection pooling (if applicable).
- Create a
.envfile in theapp/webfolder with the following template:DATABASE_URL="your-database-url" DIRECT_URL="your-direct-database-url"
- Create a
-
Set up the database:
- Apply Prisma migrations:
pnpm --filter db prisma migrate dev
- (Optional) Open Prisma Studio to explore the database:
pnpm --filter db prisma studio
- Apply Prisma migrations:
-
Start the development servers:
- Start all apps:
pnpm run dev
- Or start specific apps:
pnpm --filter web dev pnpm --filter server dev
- Start all apps:
To add new components from shadcn/ui to the frontend:
pnpm dlx shadcn@latest add [component-name] -c apps/web- ORM: Prisma
- Database: PostgreSQL
- Schema: Multi-tenant architecture with role-based access control
The ERP-SYS database is built around a template-based KPI management system with the following key components:
- QAC (Quality of Academic and Career) - System administrators who create and manage templates
- Departments - Organizational units within the institution
- Users - Department members with role-based access (HOD, KPI Coordinator, Faculty)
- Pillar Templates - Organizational framework templates created by QAC
- KPI Templates - Performance indicator templates with form structures
- Departmentdepartment_pillar - Department-specific instances of pillar templates
- Department KPIs - Operational KPI tracking with performance data
- Template System: QAC creates reusable pillar and KPI templates
- Department Assignment: Templates are assigned to departments as working copies
- Role-Based Access: Three user roles with different permissions
- Performance Tracking: Comprehensive KPI status management and progress monitoring
- Form Builder Integration: JSON-based dynamic forms for data collection
- Data Isolation: Department-level data access controls
QAC Creates Templates → Assigns to Departments → Department Copies Created → Users Fill KPIs
- QAC: Full system access, template creation and management
- HOD: Department management, KPI assignment, user coordination
- KPI Coordinator: KPI fulfillment coordination within department
- Faculty: KPI data entry and completion
For detailed schema documentation, see SCHEMA_DOCUMENTATION.md.
Below is the high-level Entity-Relationship Diagram (ERD) for the database:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "feat: add your feature" - Push to the branch:
git push origin feature/your-feature-name
- Open a pull request.
