Skip to content

sameezy667/Flagr

Repository files navigation

FLAGR

🚩 Finally understand what you're agreeing to - making legal jargon actually readable

license last-commit repo-top-language repo-language-count

React TypeScript Vite


📋 Table of Contents


🔍 Overview

Flagr is a modern, intelligent document analysis and chat platform built with React and TypeScript. It combines the power of AI-driven document processing with an intuitive chat interface, enabling users to upload, analyze, and interact with their documents through natural language conversations.

The platform leverages advanced language models to provide comprehensive document insights, making it easier for users to extract meaningful information from complex documents through an interactive chat experience. Whether you're dealing with legal contracts, technical documentation, or research papers, Flagr transforms dense text into understandable, actionable insights.


✨ Features

🔥 Core Capabilities

  • 📄 Document Upload & Parsing - Support for multiple document formats with intelligent content extraction
  • 🤖 AI-Powered Analysis - Advanced document analysis using state-of-the-art language models
  • 💬 Interactive Chat Interface - Natural language conversations about your documents
  • 🔐 User Authentication - Secure login and user profile management
  • 💾 Local Storage Integration - Persistent data storage for chat history and user preferences
  • 📊 Analysis Results Visualization - Comprehensive display of document insights and analysis results

🛠️ Technical Features

  • ⚡ Modern React Architecture - Built with React 18+ and TypeScript for type safety
  • 🎨 Responsive Design - Mobile-first approach with adaptive UI components
  • 🔧 Modular Component Structure - Well-organized, reusable components for maintainability
  • 🚀 Fast Development - Powered by Vite for lightning-fast development and builds
  • 🔌 API Integration - Seamless integration with multiple AI service providers

🏗️ Project Structure

└── Flagr/
    ├── App.tsx                          # Main application component
    ├── README.md                        # Project documentation
    ├── components/                     
    │   ├── AnalysisLoadingView.tsx     
    │   ├── AnalysisModal.tsx           
    │   ├── AnalysisResultsView.tsx     
    │   ├── ChatInput.tsx               
    │   ├── ChatMessage.tsx            
    │   ├── ChatPanel.tsx               
    │   ├── ChatView.tsx               
    │   ├── InitialView.tsx             
    │   ├── LoginPage.tsx               
    │   ├── Sidebar.tsx                
    │   └── UserProfile.tsx          
    ├── constants.tsx                   
    ├── index.html                     
    ├── index.tsx                      
    ├── metadata.json                   
    ├── package-lock.json              
    ├── package.json                   
    ├── services/                      
    │   ├── documentParser.ts           # Document parsing and content extraction utilities
    │   ├── firebaseService.ts          # Firebase integration for backend services
    │   ├── geminiService.ts.bak        # Gemini AI service (backup)
    │   ├── llama-api.services.ts       # Llama API integration for AI-powered analysis
    │   └── storageService.ts           # Local storage management and data persistence
    ├── tsconfig.json                  
    ├── types.ts                       
    ├── vite-env.d.ts                  
    └── vite.config.ts                  

📂 Project Index

FLAGR/
__root__
types.ts TypeScript type definitions for the entire application
constants.tsx Application-wide constants and configuration values
App.tsx Main React application component and routing logic
package.json NPM package configuration and dependencies
vite.config.ts Vite build tool configuration
index.tsx React application entry point and root rendering
components
InitialView.tsx Landing page and welcome screen component
LoginPage.tsx User authentication and login interface
ChatView.tsx Main chat conversation display component
ChatPanel.tsx Chat interface container and management
ChatInput.tsx Message input component with file upload
ChatMessage.tsx Individual chat message display component
AnalysisModal.tsx Document analysis configuration modal
AnalysisLoadingView.tsx Loading state display during analysis
AnalysisResultsView.tsx Analysis results display and visualization
Sidebar.tsx Navigation sidebar and menu component
UserProfile.tsx User profile management and settings
services
documentParser.ts Document parsing and content extraction utilities
llama-api.services.ts Llama API integration for AI-powered analysis
storageService.ts Local storage management and data persistence
firebaseService.ts Firebase integration for backend services

🚀 Getting Started

📋 Prerequisites

Before getting started with Flagr, ensure your development environment meets the following requirements:

  • Node.js: Version 16.0 or higher
  • NPM: Version 8.0 or higher (or Yarn 1.22+)
  • Operating System: Windows 10+, macOS 10.15+, or Linux
  • Browser: Modern browser with ES2020 support (Chrome 88+, Firefox 85+, Safari 14+)

⚙️ Installation

Install Flagr using the following steps:

  1. Clone the repository:
git clone https://github.com/sameezy667/Flagr.git
  1. Navigate to the project directory:
cd Flagr
  1. Install dependencies:

Using npm:

npm install

Using yarn:

yarn install
  1. Set up environment variables (if needed):
cp .env.example .env
# Edit .env with your configuration

💻 Usage

Run Flagr in development mode:

Using npm:

npm run dev

Using yarn:

yarn dev

Build for production:

npm run build
# or
yarn build

Preview production build:

npm run preview
# or
yarn preview

The application will be available at http://localhost:5173 (or the port specified in your configuration).

🛣️ Project Roadmap

🔄 In Progress

  • Enhanced Document Analysis - Advanced parsing for multiple file formats (PDF, DOCX, TXT)
  • Real-time Collaboration - Multi-user document sharing and collaboration
  • Advanced Search - Full-text search across uploaded documents

🎯 Upcoming Features

  • Document Summarization - AI-powered document summaries and key insights
  • Export Functionality - Export chat conversations and analysis results
  • Mobile App - React Native mobile application
  • API Documentation - Comprehensive API documentation and SDK
  • Integration Plugins - Third-party integrations (Google Drive, Dropbox, etc.)
  • Advanced Analytics - Usage analytics and performance metrics

🔮 Future Enhancements

  • Voice Input - Speech-to-text for hands-free interaction
  • Multi-language Support - Internationalization and localization
  • Custom AI Models - Support for custom-trained language models
  • Workflow Automation - Automated document processing workflows

🤝 Contributing

We welcome contributions from the community! Here's how you can help make Flagr better:

🔗 Quick Links

🛠️ Development Workflow

Contributing Guidelines
  1. 🍴 Fork the Repository

    # Fork the project to your GitHub account
  2. 📥 Clone Locally

    git clone https://github.com/YOUR-USERNAME/Flagr.git
    cd Flagr
  3. 🌿 Create a Feature Branch

    git checkout -b feature/amazing-new-feature
  4. ⚙️ Set Up Development Environment

    npm install
    npm run dev
  5. ✨ Make Your Changes

    • Write clean, well-documented code
    • Follow the existing code style
    • Add tests for new functionality
    • Update documentation as needed
  6. 🧪 Test Your Changes

    npm run test
    npm run lint
    npm run type-check
  7. 💾 Commit Your Changes

    git add .
    git commit -m "feat: add amazing new feature"

    Follow Conventional Commits format:

    • feat: for new features
    • fix: for bug fixes
    • docs: for documentation changes
    • style: for formatting changes
    • refactor: for code refactoring
    • test: for test additions/modifications
  8. 🚀 Push to GitHub

    git push origin feature/amazing-new-feature
  9. 🔄 Submit a Pull Request

    • Create a PR with a clear title and description
    • Reference any related issues
    • Include screenshots for UI changes
    • Ensure all checks pass

📊 Contributor Recognition

Contributor Graph


📄 License

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


🙏 Acknowledgments

🛠️ Technologies & Libraries

  • React - UI library for building interactive interfaces
  • TypeScript - Type-safe JavaScript development
  • Vite - Fast build tool and development server
  • Firebase - Backend services and authentication
  • Llama API - AI language model integration

🎨 Design & Assets

🌟 Special Thanks

  • IEEE RAS team for inspiring and motivating us to build this project for the PIXEL PALETTES hackathon
  • The open-source community for inspiration and support

📚 Resources & Inspiration


Made with ❤️ by the Flagr Team

⭐ Star this project | 🐛 Report Bug | 💬 Join Discussion

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages