Skip to content

deekshith-b48/Kroolo-poligap

Repository files navigation

POLIGAP - AI-Powered Compliance Platform

POLIGAP is a comprehensive, multi-tenant, AI-powered compliance platform that helps organizations identify, analyze, and remediate compliance gaps across various regulatory frameworks including GDPR, HIPAA, ISO27001, SOC2, PCI-DSS, and CCPA.

πŸš€ Features

Core Functionality

  • Multi-Framework Support: GDPR, HIPAA, ISO27001, SOC2, PCI-DSS, CCPA
  • Document Upload & Analysis: Drag-and-drop interface with real-time processing
  • AI-Powered Gap Analysis: Intelligent identification of compliance gaps
  • Automated Remediation Plans: AI-generated action plans with timelines and resources
  • Task Management: Comprehensive task tracking with assignments and deadlines
  • Real-Time Reporting: Dynamic dashboards with compliance metrics and trends
  • Multi-Tenant Architecture: Organization-based data isolation and management

Key Components

  1. Dashboard: Real-time compliance overview with key metrics
  2. Document Upload: Secure file upload with format validation
  3. Compliance Analysis: AI-powered gap analysis with detailed results
  4. Task Management: Track remediation tasks with progress monitoring
  5. Reports: Generate and schedule compliance reports
  6. Authentication: OAuth integration with Google, GitHub, Microsoft

πŸ›  Technology Stack

Frontend

  • Next.js 14.2.5 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Recharts - Data visualization library
  • Lucide React - Icon library

Backend

  • Node.js - Runtime environment
  • NextAuth.js - Authentication solution
  • MongoDB - Primary database for user/org/task data
  • AstraDB - Vector database for document storage and AI operations

AI & ML

  • OpenAI GPT-4 - Natural language processing and analysis
  • HuggingFace Transformers - Additional ML model support
  • Custom NLP Pipeline - Compliance-specific text analysis

Authentication & Security

  • OAuth 2.0 - Google, GitHub, Microsoft providers
  • JWT - Secure session management
  • RBAC - Role-based access control
  • Data Encryption - End-to-end security

πŸ“ Project Structure

src/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ compliance/           # Compliance analysis APIs
β”‚   β”‚   β”œβ”€β”€ documents/            # Document management APIs
β”‚   β”‚   └── remediation/          # Remediation plan APIs
β”‚   β”œβ”€β”€ dashboard/                # Dashboard pages
β”‚   β”‚   β”œβ”€β”€ compliance/           # Compliance analysis page
β”‚   β”‚   β”œβ”€β”€ documents/upload/     # Document upload page
β”‚   β”‚   β”œβ”€β”€ reports/              # Reports management
β”‚   β”‚   └── tasks/                # Task management
β”‚   └── auth/                     # Authentication pages
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ ui/                       # Base UI components
β”‚   β”œβ”€β”€ layout/                   # Layout components
β”‚   └── dashboard/                # Dashboard-specific components
β”œβ”€β”€ lib/                          # Utility libraries
β”‚   β”œβ”€β”€ auth.ts                   # NextAuth configuration
β”‚   β”œβ”€β”€ database.ts               # Database connections
β”‚   β”œβ”€β”€ api-client.ts             # API client utilities
β”‚   └── utils.ts                  # Helper functions
└── types/                        # TypeScript type definitions
    └── index.ts                  # Core type definitions

πŸ”§ Installation & Setup

Prerequisites

  • Node.js 18+
  • npm or yarn
  • MongoDB instance
  • AstraDB account
  • OAuth app credentials (Google, GitHub, Microsoft)

Environment Variables

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

# Next.js
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-nextauth-secret

# Database
MONGODB_URI=mongodb://localhost:27017/poligap
ASTRA_DB_APPLICATION_TOKEN=your-astra-token
ASTRA_DB_ID=your-astra-db-id
ASTRA_DB_REGION=your-astra-region

# OAuth Providers
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
MICROSOFT_CLIENT_ID=your-microsoft-client-id
MICROSOFT_CLIENT_SECRET=your-microsoft-client-secret

# AI Services
OPENAI_API_KEY=your-openai-api-key
HUGGINGFACE_API_KEY=your-huggingface-api-key

Installation Steps

  1. Clone the repository

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

    npm install
  3. Set up environment variables

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

    npm run dev
  5. Open in browser Navigate to http://localhost:3000

πŸ” Authentication Setup

Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URIs: http://localhost:3000/api/auth/callback/google

GitHub OAuth

  1. Go to GitHub Settings > Developer settings > OAuth Apps
  2. Create a new OAuth App
  3. Set Authorization callback URL: http://localhost:3000/api/auth/callback/github

Microsoft OAuth

  1. Go to Azure Portal
  2. Register a new application
  3. Configure redirect URI: http://localhost:3000/api/auth/callback/microsoft

πŸ“Š Database Schema

MongoDB Collections

  • users: User profiles and authentication data
  • organizations: Multi-tenant organization data
  • documents: Uploaded document metadata
  • compliance_analyses: Analysis results and gap data
  • tasks: Compliance task management
  • remediation_plans: AI-generated action plans
  • reports: Generated compliance reports

AstraDB Collections

  • document_embeddings: Vector embeddings for document search
  • compliance_knowledge: Framework-specific compliance knowledge base
  • analysis_cache: Cached analysis results for performance

πŸ€– AI Integration

Document Analysis Pipeline

  1. Text Extraction: PDF/DOCX content extraction
  2. Preprocessing: Text cleaning and normalization
  3. Embedding Generation: Vector embeddings for semantic search
  4. Gap Identification: AI-powered compliance gap detection
  5. Remediation Planning: Automated action plan generation

Supported Frameworks

  • GDPR: Articles 30, 7, 15-22, 35, 28
  • HIPAA: Security Rule, Privacy Rule, Breach Notification
  • ISO27001: Information Security Management System
  • SOC2: Trust Services Criteria
  • PCI-DSS: Payment Card Industry Standards
  • CCPA: California Consumer Privacy Act

🚦 API Reference

Authentication

  • POST /api/auth/signin - User sign in
  • POST /api/auth/signout - User sign out
  • GET /api/auth/session - Get current session

Documents

  • POST /api/documents/upload - Upload documents
  • GET /api/documents - List documents
  • DELETE /api/documents/:id - Delete document

Compliance

  • POST /api/compliance/analyze - Run compliance analysis
  • GET /api/compliance/results/:id - Get analysis results
  • GET /api/compliance/frameworks - List supported frameworks

Tasks

  • POST /api/tasks - Create task
  • GET /api/tasks - List tasks
  • PUT /api/tasks/:id - Update task
  • DELETE /api/tasks/:id - Delete task

Reports

  • POST /api/reports/generate - Generate report
  • GET /api/reports - List reports
  • GET /api/reports/:id/download - Download report

πŸ§ͺ Testing

# Run unit tests
npm run test

# Run integration tests
npm run test:integration

# Run E2E tests
npm run test:e2e

# Generate coverage report
npm run test:coverage

πŸ“¦ Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Configure environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Docker

# Build Docker image
docker build -t poligap .

# Run container
docker run -p 3000:3000 --env-file .env.local poligap

Manual Deployment

# Build for production
npm run build

# Start production server
npm start

πŸ”§ Configuration

Framework Configuration

Customize compliance frameworks in src/lib/frameworks/:

  • Add new frameworks
  • Modify existing requirements
  • Configure analysis rules

UI Customization

  • Theme configuration: tailwind.config.js
  • Component styling: src/components/ui/
  • Custom branding: src/styles/globals.css

πŸ“ˆ Performance Optimization

  • Caching: Redis for API response caching
  • CDN: Static asset delivery via CDN
  • Database Indexing: Optimized MongoDB indexes
  • Lazy Loading: Component-level code splitting
  • Image Optimization: Next.js automatic image optimization

πŸ›‘ Security Features

  • Data Encryption: AES-256 encryption at rest
  • Secure Headers: CSRF, XSS protection
  • Input Validation: Comprehensive input sanitization
  • Audit Logging: Complete action audit trail
  • Access Control: Role-based permissions

🀝 Contributing

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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ—Ί Roadmap

Q1 2024

  • βœ… Core platform development
  • βœ… Multi-framework support
  • βœ… AI-powered gap analysis
  • βœ… Task management system

Q2 2024

  • πŸ”„ Advanced reporting features
  • πŸ”„ API integrations (Slack, Teams)
  • πŸ”„ Mobile application
  • πŸ”„ Advanced analytics

Q3 2024

  • πŸ“‹ Custom framework builder
  • πŸ“‹ Workflow automation
  • πŸ“‹ Third-party integrations
  • πŸ“‹ Enterprise features

Q4 2024

  • πŸ“‹ Machine learning improvements
  • πŸ“‹ Predictive compliance
  • πŸ“‹ Global compliance support
  • πŸ“‹ Advanced security features

Built with ❀️ by the POLIGAP Team

For more information, visit poligap.com

Kroolo-poligap

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages