Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

448 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ZAAD - Business Documents & Management Dashboard

A modern, full-featured admin dashboard built with Next.js for managing business documents, employees, companies, invoices, and transactions. Designed to streamline business operations with a comprehensive suite of management tools.

πŸ“‹ Overview

ZAAD is an enterprise-level business management platform that provides organizations with centralized control over their operations. The system enables management of multiple companies, employee records, financial transactions, and critical business documents with advanced filtering, search, and reporting capabilities.

Version: 1.3.1


🎯 Key Features

πŸ‘₯ User Management

  • Role-based access control (Partner, Employee)
  • User authentication with JWT tokens
  • Secure password management with bcryptjs
  • User activity logging and audit trails
  • User history tracking

🏒 Company Management

  • Comprehensive company profile management
  • License and emirate tracking
  • Document management for companies
  • Platform credentials storage
  • Multi-emirate support
  • Mainland/Freezone classification

πŸ‘¨β€πŸ’Ό Employee Management

  • Employee records with detailed information
  • Employment status tracking
  • Employee activity monitoring
  • Bulk employee operations

πŸ’° Financial Management

  • Invoice creation and management
  • Transaction tracking
  • Multiple payment method support
  • Self-deposit functionality
  • Self-service payment modal
  • Expense and income tracking
  • Financial reporting with charts

πŸ“Š Analytics & Reporting

  • Interactive charts and data visualization (ApexCharts)
  • Last 12 months trends
  • Last 7 days analytics
  • Custom date range reporting
  • Statistical dashboards
  • Real-time data updates

πŸ“ Advanced Features

  • Document management and storage
  • Search functionality across all records
  • Confirmation modals for critical operations
  • Print-to-PDF capabilities
  • Dark mode support
  • Real-time notifications (React Hot Toast)
  • Responsive design with Tailwind CSS

πŸ› οΈ Technology Stack

Frontend

  • Framework: Next.js 14.2.3
  • React: 18.x
  • Language: TypeScript 5
  • Styling: Tailwind CSS 3.4 + PostCSS
  • State Management: React Query (TanStack Query 5.63)
  • Charts: ApexCharts with React integration
  • Notifications: React Hot Toast
  • Print: React to Print

Backend

  • Runtime: Node.js
  • API: Next.js API Routes
  • Authentication: JWT (jsonwebtoken)
  • Password Security: bcryptjs
  • Database: MongoDB (Mongoose ODM)
  • Caching: Redis
  • HTTP Client: Axios

Development Tools

  • Type Checking: TypeScript
  • Code Quality: ESLint
  • Code Formatting: Prettier with Tailwind plugin
  • Package Manager: PNPM

πŸ“ Project Structure

zaad/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                      # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ (logged)/            # Protected routes
β”‚   β”‚   β”‚   β”œβ”€β”€ accounts/        # Account management
β”‚   β”‚   β”‚   β”œβ”€β”€ company/         # Company management pages
β”‚   β”‚   β”‚   β”œβ”€β”€ employee/        # Employee management pages
β”‚   β”‚   β”‚   β”œβ”€β”€ settings/        # User settings
β”‚   β”‚   β”‚   └── users/           # User management
β”‚   β”‚   β”œβ”€β”€ api/                 # API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ company/
β”‚   β”‚   β”‚   β”œβ”€β”€ employee/
β”‚   β”‚   β”‚   β”œβ”€β”€ invoice/
β”‚   β”‚   β”‚   β”œβ”€β”€ payment/
β”‚   β”‚   β”‚   β”œβ”€β”€ search/
β”‚   β”‚   β”‚   └── users/
β”‚   β”‚   β”œβ”€β”€ login/               # Authentication page
β”‚   β”‚   β”œβ”€β”€ layout.tsx           # Root layout
β”‚   β”‚   └── middleware.ts        # Route protection
β”‚   β”œβ”€β”€ components/              # Reusable React components
β”‚   β”‚   β”œβ”€β”€ Tables/              # Data tables
β”‚   β”‚   β”œβ”€β”€ Forms/               # Form components
β”‚   β”‚   β”œβ”€β”€ Charts/              # Chart components
β”‚   β”‚   β”œβ”€β”€ Modals/              # Modal dialogs
β”‚   β”‚   β”œβ”€β”€ Header/              # Navigation header
β”‚   β”‚   β”œβ”€β”€ Sidebar/             # Navigation sidebar
β”‚   β”‚   └── common/              # Common utilities
β”‚   β”œβ”€β”€ models/                  # Mongoose schemas
β”‚   β”‚   β”œβ”€β”€ users.ts
β”‚   β”‚   β”œβ”€β”€ companies.ts
β”‚   β”‚   β”œβ”€β”€ employees.ts
β”‚   β”‚   β”œβ”€β”€ invoice.ts
β”‚   β”‚   β”œβ”€β”€ records.ts
β”‚   β”‚   └── userActivity.ts
β”‚   β”œβ”€β”€ helpers/                 # Utility functions
β”‚   β”‚   β”œβ”€β”€ calculateLast12Months.ts
β”‚   β”‚   β”œβ”€β”€ getUserFromCookie.ts
β”‚   β”‚   β”œβ”€β”€ userActivityLogger.ts
β”‚   β”‚   └── processDocuments.ts
β”‚   β”œβ”€β”€ hooks/                   # Custom React hooks
β”‚   β”œβ”€β”€ contexts/                # React contexts
β”‚   β”œβ”€β”€ providers/               # Provider components
β”‚   β”œβ”€β”€ types/                   # TypeScript type definitions
β”‚   β”œβ”€β”€ utils/                   # General utilities
β”‚   β”œβ”€β”€ db/                      # Database connections
β”‚   β”œβ”€β”€ css/                     # Stylesheets
β”‚   └── libs/                    # Shared libraries
β”œβ”€β”€ public/                       # Static assets
└── Configuration files
    β”œβ”€β”€ next.config.mjs
    β”œβ”€β”€ tsconfig.json
    β”œβ”€β”€ tailwind.config.ts
    β”œβ”€β”€ postcss.config.js
    └── package.json

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ or higher
  • PNPM package manager
  • MongoDB instance (local or cloud)
  • Redis instance (for caching)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd zaad
  2. Install dependencies

    pnpm install
  3. Environment Configuration Create a .env.local file in the root directory:

    # MongoDB
    MONGODB_URI=mongodb://localhost:27017/zaad
    
    # Redis
    REDIS_URL=redis://localhost:6379
    
    # JWT Secret
    JWT_SECRET=your_jwt_secret_key_here
    
    # API Configuration
    NEXT_PUBLIC_API_URL=http://localhost:3000
  4. Run development server

    pnpm dev

    Open http://localhost:3000 in your browser.

  5. Build for production

    pnpm build
    pnpm start

πŸ“š Available Scripts

Command Description
pnpm dev Start development server with hot reload
pnpm build Build application for production
pnpm start Start production server
pnpm lint Run ESLint to check code quality

πŸ” Security Features

  • Authentication: JWT-based token system with secure cookie storage
  • Authorization: Role-based access control (RBAC)
  • Password Security: bcryptjs encryption for password hashing
  • Route Protection: Middleware-based route protection
  • Soft Deletes: deletedAt timestamp for data integrity
  • Activity Logging: Comprehensive user action logging

🎨 UI/UX Features

  • Responsive Design: Mobile-first approach with Tailwind CSS
  • Dark Mode: Built-in dark mode support
  • Interactive Charts: Real-time data visualization
  • Loading States: Skeleton loaders for better UX
  • Toast Notifications: Non-intrusive alerts and confirmations
  • Print Support: PDF export functionality for documents
  • Accessibility: Semantic HTML and ARIA labels

πŸ“Š Data Models

User Schema

  • Username, Full Name, Password (hashed)
  • Role (Partner/Employee)
  • Status and soft delete support
  • Timestamps (created, updated)

Company Schema

  • Name, License Number, Company Type
  • Contact Information (phones, email)
  • Location (Emirates, Mainland/Freezone)
  • Document Management (with expiry tracking)
  • Platform Credentials Storage
  • Timestamps

Employee Schema

  • Personal information
  • Employment details
  • Activity tracking

Invoice Schema

  • Invoice details and line items
  • Payment tracking
  • Status management

Records Schema

  • Transaction records
  • Document records
  • Status and metadata

πŸ”„ API Endpoints

Authentication

  • POST /api/users/login - User login
  • POST /api/users/logout - User logout

Companies

  • GET /api/company - List all companies
  • POST /api/company - Create new company
  • GET /api/company/[id] - Get company details
  • PUT /api/company/[id] - Update company
  • DELETE /api/company/[id] - Delete company

Employees

  • GET /api/employee - List all employees
  • POST /api/employee - Create new employee
  • GET /api/employee/[id] - Get employee details
  • PUT /api/employee/[id] - Update employee

Search

  • GET /api/search - Global search across all records

Additional modules include Invoice, Payment, and User management endpoints.


🀝 Contributing

Contributions are welcome! Please follow these guidelines:

  1. Create a feature branch (git checkout -b feature/amazing-feature)
  2. Commit your changes (git commit -m 'Add amazing feature')
  3. Push to the branch (git push origin feature/amazing-feature)
  4. Open a Pull Request

πŸ“ License

This project is private and proprietary.


πŸ’Ό Career Highlights

This project demonstrates proficiency in:

βœ… Full-Stack Development: Complete end-to-end application development βœ… Modern React Architecture: Server components, hooks, context API, and state management βœ… TypeScript: Strict type safety and advanced TypeScript patterns βœ… API Design: RESTful API design with proper routing and middleware βœ… Database Design: Schema design with MongoDB and Mongoose βœ… Authentication & Security: JWT tokens, password hashing, role-based access βœ… Performance Optimization: React Query for efficient data fetching and caching βœ… UI/UX Development: Responsive design, dark mode, accessibility βœ… Data Visualization: Complex charts and analytics βœ… DevOps & Deployment: Production-ready build pipeline


πŸ“ž Contact & Support

For questions or support regarding this project, please contact the project owner.


Last Updated: February 2026 Maintained By: Development Team

Releases

Packages

Used by

Contributors

Languages