Talal Sharabi 72ed9a2ff5 feat(hr): Complete HR module with Employee Portal, Loans, Leave, Purchase Requests, Contracts
- Database: Add Loan, LoanInstallment, PurchaseRequest, LeaveEntitlement, EmployeeContract models
- Database: Extend Attendance with ZK Tico fields (sourceDeviceId, externalId, rawData)
- Database: Add Employee.attendancePin for device mapping
- Backend: HR admin - Loans, Purchase Requests, Leave entitlements, Employee contracts CRUD
- Backend: Leave reject, bulk attendance sync (ZK Tico ready)
- Backend: Employee Portal API - scoped by employeeId (loans, leaves, purchase-requests, attendance, salaries)
- Frontend: Employee Portal - dashboard, loans, leave, purchase-requests, attendance, salaries
- Frontend: HR Admin - new tabs for Leaves, Loans, Purchase Requests, Contracts (approve/reject)
- Dashboard: Add My Portal link
- No destructive schema changes; additive migrations only

Made-with: Cursor
2026-03-04 19:44:09 +04:00

Z.CRM System

نظام إدارة علاقات العملاء - نظام إدارة شامل

Enterprise-grade CRM system with 6 integrated modules:

  1. Contact Management - إدارة جهات الاتصال
  2. CRM - إدارة علاقات العملاء
  3. Inventory & Assets - إدارة المستودعات والأصول
  4. Tasks & Projects - إدارة المهام والمشاريع
  5. HR Management - إدارة الموارد البشرية
  6. Marketing - إدارة التسويق

Tech Stack

Backend

  • Node.js + Express + TypeScript
  • PostgreSQL with Prisma ORM
  • JWT Authentication
  • Role-based Access Control (RBAC)

Frontend

  • Next.js 14 with TypeScript
  • Tailwind CSS
  • RTL Support (Arabic/English)
  • React Query for data fetching

Installation

# Install all dependencies
npm run install-all

# Setup database
cd backend
cp .env.example .env
# Edit .env with your database credentials
npx prisma migrate dev
npx prisma generate
npx prisma db seed

Development

# Run both backend and frontend
npm run dev

# Or run separately
npm run dev:backend  # Backend on port 5000
npm run dev:frontend # Frontend on port 3000

Production

npm run build
npm start

Project Structure

z_crm/
├── backend/           # Express API server
│   ├── src/
│   │   ├── modules/
│   │   │   ├── contacts/      # Module 1
│   │   │   ├── crm/           # Module 2
│   │   │   ├── inventory/     # Module 3
│   │   │   ├── projects/      # Module 4
│   │   │   ├── hr/            # Module 5
│   │   │   └── marketing/     # Module 6
│   │   ├── shared/
│   │   ├── auth/
│   │   └── config/
│   ├── prisma/
│   └── tests/
├── frontend/          # Next.js application
│   ├── src/
│   │   ├── app/
│   │   ├── components/
│   │   ├── modules/
│   │   └── lib/
│   └── public/
└── docs/             # Documentation

Key Features

  • Unified ID system for all contacts
  • Duplicate detection and merging
  • Complete audit logging
  • Hierarchical organizational structure
  • Multi-level approval workflows
  • Role-based permissions from HR module
  • 360° contact history
  • Full Arabic & English support
  • Document versioning
  • Soft delete (archiving)
  • Advanced search & filtering

Security

  • JWT-based authentication
  • HR module controls all system access
  • Field-level permissions
  • Complete audit trail
  • Data masking for sensitive info
  • No default delete - archive only

License

Proprietary - © مجموعة أتمتة

Description
Z.ERP is the new easy arabic ERP powered by AI
Readme 3.1 MiB
Languages
TypeScript 96.4%
JavaScript 1.6%
Shell 1.4%
CSS 0.4%
Dockerfile 0.2%