Skip to content

deekshith-b48/poligap-kroolo

Repository files navigation

Poligap - AI-Powered Legal Compliance Platform

Powered by Kroolo

Next.js React TypeScript Tailwind CSS MongoDB

Poligap is an advanced AI-powered legal compliance and contract analysis platform that helps organizations ensure regulatory compliance and streamline contract review processes. Built with modern web technologies and enterprise-grade security features.

πŸš€ Features

Core Functionality

  • πŸ“‹ Compliance Check: Upload documents for compliance analysis against multiple standards (HIPAA, GDPR, CCPA, SOX, PCI DSS, ISO 27001, and more)
  • πŸ“„ Contract Review: AI-powered contract analysis with gap identification and suggestions
  • πŸ€– AI Agents: Manage and deploy specialized legal AI agents for different compliance scenarios
  • πŸ“Š Task Management: Organize and track compliance and legal tasks with advanced workflow management
  • πŸ’¬ Interactive Chat: AI-powered legal assistance and consultation with context-aware responses
  • βš™οΈ Comprehensive Settings: Manage compliance standards and platform configurations

Advanced Features

  • πŸ” Enterprise Search: Powerful search capabilities across documents and knowledge base
  • πŸ“ˆ Analytics Dashboard: Real-time compliance statistics and policy insights
  • πŸ” Role-based Access Control: Granular permissions and user management
  • πŸ”„ Real-time Collaboration: Live document editing and team collaboration features
  • πŸ“± Responsive Design: Optimized for desktop, tablet, and mobile devices
  • 🌐 Multi-platform Integration: Connect with popular tools like ClickUp, Jira, Zendesk, Gmail, and more

πŸ—οΈ Technology Stack

Frontend Architecture

  • Framework: Next.js 15.3.2 with App Router
  • UI Library: React 19.0.0 with TypeScript 5.0
  • Styling: Tailwind CSS 4.0 with custom design system
  • Component Library: Radix UI primitives with custom components
  • State Management: Zustand for global state, React Query for server state
  • Animations: Framer Motion for smooth transitions and interactions
  • Icons: Lucide React + React Icons

Backend & Database

  • Database: MongoDB 6.16.0 with Mongoose ODM
  • Caching: Redis (IORedis) for session management and caching
  • Authentication: PropelAuth + NextAuth.js for secure user management
  • File Storage: AWS S3 with presigned URLs
  • AI Integration: Google Gemini API + Portkey AI for advanced language processing

Development Tools

  • Build Tool: Next.js with Turbopack support
  • Type Safety: TypeScript with strict mode
  • Code Quality: ESLint + Prettier
  • Testing: Built-in Next.js testing capabilities
  • Package Manager: npm with lock file for consistent installs

Deployment & DevOps

  • Containerization: Docker with multi-stage builds
  • Orchestration: Kubernetes manifests for different environments (QA, UAT, Production)
  • CI/CD: GitHub Actions workflows
  • Monitoring: Built-in logging and error tracking
  • Scaling: Horizontal Pod Autoscaler (HPA) configurations

πŸ“ Project Structure

poligap-kroolo-main/
β”œβ”€β”€ πŸ“‚ src/
β”‚   β”œβ”€β”€ πŸ“‚ app/                    # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ (app)/             # Main application routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ ai-agents/     # AI agents management
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ chat/          # Interactive chat interface
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ compliance/    # Compliance checking tools
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ dashboard/     # Analytics dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ knowledge-base/ # Document management
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ search/        # Enterprise search
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ settings/      # Platform configuration
β”‚   β”‚   β”‚   └── πŸ“‚ tasks/         # Task management
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ api/               # API routes and endpoints
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ auth/              # Authentication pages
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ login/             # Login interface
β”‚   β”‚   └── πŸ“„ layout.tsx         # Root layout component
β”‚   β”œβ”€β”€ πŸ“‚ components/            # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ ui/                # Base UI components (buttons, forms, etc.)
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ common/            # Shared components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ auth/              # Authentication components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ knowledge-base/    # Document-related components
β”‚   β”‚   └── πŸ“‚ search/            # Search interface components
β”‚   β”œβ”€β”€ πŸ“‚ lib/                   # Utility libraries and configurations
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ db/                # Database connection and utilities
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ queries/           # Database queries and operations
β”‚   β”‚   β”œβ”€β”€ πŸ“„ mongodb.ts         # MongoDB connection setup
β”‚   β”‚   β”œβ”€β”€ πŸ“„ redis.ts           # Redis configuration
β”‚   β”‚   β”œβ”€β”€ πŸ“„ s3-config.ts       # AWS S3 setup
β”‚   β”‚   └── πŸ“„ gemini-api.ts      # AI API integration
β”‚   β”œβ”€β”€ πŸ“‚ stores/                # Zustand state management
β”‚   β”‚   β”œβ”€β”€ πŸ“„ auth-store.ts      # Authentication state
β”‚   β”‚   β”œβ”€β”€ πŸ“„ company-store.ts   # Company/organization state
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ai-agents-store.tsx # AI agents state
β”‚   β”‚   └── πŸ“„ user-store.ts      # User profile state
β”‚   β”œβ”€β”€ πŸ“‚ models/                # Database models and schemas
β”‚   β”‚   β”œβ”€β”€ πŸ“„ users.model.ts     # User data model
β”‚   β”‚   β”œβ”€β”€ πŸ“„ companies.model.ts # Company data model
β”‚   β”‚   β”œβ”€β”€ πŸ“„ members.model.ts   # Team member model
β”‚   β”‚   └── πŸ“„ feedback.model.ts  # User feedback model
β”‚   β”œβ”€β”€ πŸ“‚ types/                 # TypeScript type definitions
β”‚   β”œβ”€β”€ πŸ“‚ hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ πŸ“‚ utils/                 # Utility functions and helpers
β”‚   └── πŸ“‚ constants/             # Application constants and configurations
β”œβ”€β”€ πŸ“‚ public/                    # Static assets
β”‚   β”œβ”€β”€ πŸ“‚ assets/                # Images, icons, and media files
β”‚   └── πŸ“‚ fonts/                 # Custom font files
β”œβ”€β”€ πŸ“‚ k8s/                       # Kubernetes deployment manifests
β”‚   β”œβ”€β”€ πŸ“‚ prod-enterprise-search-manifest/
β”‚   β”œβ”€β”€ πŸ“‚ qa-enterprise-search-manifest/
β”‚   └── πŸ“‚ uat-enterprise-search-manifest/
β”œβ”€β”€ πŸ“„ package.json               # Dependencies and scripts
β”œβ”€β”€ πŸ“„ tsconfig.json              # TypeScript configuration
β”œβ”€β”€ πŸ“„ tailwind.config.ts         # Tailwind CSS configuration
β”œβ”€β”€ πŸ“„ next.config.ts             # Next.js configuration
└── πŸ“„ Dockerfile                 # Docker containerization

πŸ”§ Key Components & Features

Authentication System

  • PropelAuth Integration: Enterprise-grade authentication
  • Role-based Access: Granular permission system
  • Session Management: Redis-based session storage
  • Multi-organization Support: Company-based user isolation

AI-Powered Features

  • Document Analysis: Automated compliance checking
  • Contract Review: Gap analysis and recommendations
  • Interactive Chat: Context-aware legal assistance
  • Custom AI Agents: Specialized bots for different compliance needs

Data Management

  • MongoDB Integration: Flexible document storage
  • File Upload System: AWS S3 integration with presigned URLs
  • Real-time Updates: WebSocket connections for live collaboration
  • Search Capabilities: Full-text search across documents

UI/UX Excellence

  • Design System: Consistent component library
  • Dark/Light Mode: Theme switching with next-themes
  • Responsive Design: Mobile-first approach
  • Accessibility: WCAG compliant components
  • Performance: Optimized loading and caching strategies

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • MongoDB instance (local or cloud)
  • Redis server
  • AWS S3 bucket (for file storage)
  • Environment variables (see .env.example)

Installation

  1. Clone the repository

    git clone https://github.com/deekshith-b48/poligap-kroolo.git
    cd poligap-kroolo
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env.local
    # Edit .env.local with your configuration
  4. Run the development server

    npm run dev
    # or with Turbopack for faster builds
    npm run dev:turbo
  5. Open your browser Navigate to http://localhost:3000

Environment Configuration

Create a .env.local file with the following variables:

# Database
MONGODB_URI=mongodb://localhost:27017/poligap
REDIS_URL=redis://localhost:6379

# Authentication
PROPELAUTH_API_KEY=your_propelauth_api_key
PROPELAUTH_VERIFIER_KEY=your_verifier_key
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret

# AWS S3
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-s3-bucket-name

# AI Services
GOOGLE_GEMINI_API_KEY=your_gemini_api_key
PORTKEY_API_KEY=your_portkey_api_key

# Application
NODE_ENV=development

πŸ“œ Available Scripts

  • npm run dev - Start development server
  • npm run dev:turbo - Start development server with Turbopack
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint
  • npm run type-check - Run TypeScript type checking

🐳 Docker Deployment

Build Docker Image

docker build -t poligap-kroolo .

Run Container

docker run -p 3000:3000 --env-file .env.local poligap-kroolo

☸️ Kubernetes Deployment

The project includes Kubernetes manifests for different environments:

Deploy to Development

kubectl apply -f k8s/qa-enterprise-search-manifest/

Deploy to Production

kubectl apply -f k8s/prod-enterprise-search-manifest/

πŸ” Security Features

  • Data Encryption: All data encrypted in transit and at rest
  • RBAC: Role-based access control with granular permissions
  • Input Validation: Comprehensive validation using Zod schemas
  • CSRF Protection: Built-in CSRF protection
  • Rate Limiting: API rate limiting and abuse prevention
  • Audit Logging: Comprehensive audit trails for compliance

πŸ“Š Performance Optimizations

  • Code Splitting: Automatic code splitting with Next.js
  • Image Optimization: Next.js Image component with optimization
  • Caching Strategy: Multi-layer caching (Redis, browser, CDN)
  • Bundle Analysis: Webpack bundle analyzer integration
  • Performance Monitoring: Built-in performance metrics

🀝 Contributing

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

πŸ“„ License

This project is proprietary software developed by Kroolo. All rights reserved.

πŸ†˜ Support

For support and questions:

πŸ™ Acknowledgments

  • Built with ❀️ by the Kroolo team
  • Powered by Next.js and React
  • UI components by Radix UI
  • Styling by Tailwind CSS
  • AI capabilities by Google Gemini

Made with πŸ’™ by Kroolo - Empowering businesses with AI-driven compliance solutions.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages