Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

BMM Analyzer - Business Motivation Model Document Analysis

A secure Django application for extracting Business Motivation Model (BMM) elements from technical documents using Perplexity AI.

Features

  • Extract BMM elements (Drivers, Assessments, Goals, Objectives, Strategies, Requirements) from uploaded documents
  • Support for PDF, DOCX, and TXT file formats
  • Secure single-user authentication with Django admin
  • Perplexity AI integration for intelligent extraction using state-of-the-art language models
  • Confidence scoring and validation workflow
  • Export results as PDF reports or JSON data

Quick Start

Prerequisites

Installation

  1. Clone the repository and navigate to the project directory

  2. Create and activate a virtual environment:

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit .env and add your Perplexity API key
  1. Run migrations:
python manage.py migrate
  1. Create a superuser:
python manage.py createsuperuser
# Or use the provided script: python create_superuser.py
  1. Run the development server:
python manage.py runserver
  1. Access the application:

Project Structure

bmm_analyzer/
├── bmm_analyzer/      # Main Django project settings
├── analysis/          # Core BMM analysis app
├── accounts/          # User authentication
├── static/            # Static files (CSS, JS)
├── templates/         # HTML templates
├── media/documents/   # Uploaded documents storage
├── requirements.txt   # Python dependencies
├── .env              # Environment variables (create from .env.example)
└── README.md         # This file

Security Features

  • Environment-based configuration for sensitive data
  • Secure file upload with validation and scanning
  • CSRF protection enabled
  • Security headers configured
  • Session-based authentication
  • Rate limiting on API operations

Configuration

Key settings in .env:

  • PERPLEXITY_API_KEY: Your Perplexity AI API key (required)
  • SECRET_KEY: Django secret key (auto-generated for development)
  • DEBUG: Set to False for production
  • MAX_UPLOAD_SIZE: Maximum file upload size in bytes (default: 10MB)
  • ALLOWED_FILE_EXTENSIONS: Comma-separated list of allowed file types

Testing Perplexity AI Connection

After setting up your API key, test the connection:

python manage.py test_perplexity

This will verify your API key and perform a sample BMM extraction.

Development

The application currently has:

  • ✅ Django project structure with apps
  • ✅ Database models for BMM analysis
  • ✅ Secure configuration with environment variables
  • ✅ Perplexity AI integration for BMM extraction
  • ⏳ File upload functionality (in progress)
  • ⏳ Text extraction pipeline
  • ⏳ Background task processing
  • ⏳ UI templates
  • ⏳ Authentication system
  • ⏳ Export functionality

Usage

Quick Start with Sample Data

  1. Load the provided sample documents:
python manage.py load_sample_data
  1. Run a quick demonstration:
python demo_extraction.py
  1. Access the admin interface at http://localhost:8090/admin/

    • Username: admin
    • Password: admin123
  2. View the pre-loaded analyses:

    • Example: Pre-Analyzed Security Requirements - Shows extracted BMM elements
    • Cybersecurity Policy Analysis - Ready to process
    • Digital Transformation Strategy Analysis - Ready to process
    • NIST Authentication Standards Analysis - Ready to process

Understanding BMM Elements

See USAGE_GUIDE.md for detailed explanations of:

  • What each BMM element type means
  • How to interpret extraction results
  • Best practices for document analysis

Basic Workflow

  1. Create a new Document Analysis
  2. Upload a technical document (PDF, DOCX, or TXT)
  3. Configure extraction preferences
  4. Process the document to extract BMM elements
  5. Review and validate results
  6. Export findings as PDF or JSON

Git Repository Setup

Initial Setup

git init
git add .
git commit -m "Initial commit: BMM Analyzer application"
git remote add origin YOUR_REPOSITORY_URL
git push -u origin main

Important Security Notes

  • The .env file is excluded from Git (contains API keys)
  • Always use .env.example as a template
  • Generate a new SECRET_KEY for production deployments
  • Review SECURITY.md for security best practices

Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this project.

License

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

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages