How hovosukiasyan/project-summarizer works
Identification of Project Type and Purpose
• This is an open-source CLI tool (exporter) written in Python.
• Purpose: scan a target project folder, filter files, send code to OpenRouter AI for formatting/correction, and generate a structured Markdown export (project_export.md) plus logs.
High-Level File Structure Analysis
• Top-level files:
• export.py – main script containing orchestration logic
• requirements.txt – Python dependencies (requests, python-dotenv)
• .gitignore / .env – configuration and VCS ignores
• No subdirectories, so logical modules live inside export.py (or could be refactored into separate modules).
Key Insights from README
• Core steps:
a. Load environment configuration (.env)
b. Recursively collect files from FOLDER_PATH
c. Apply filters (ignore patterns, max size)
d. Call OpenRouter API for AI processing
e. Generate project_export.md
f. Log to export_log.txt
• Dependencies and external service: OpenRouter API.
Main Components
a. Configuration Loader
• Reads .env variables (API key, model, folder path, size limit) via python-dotenv.
b. File System Module
• FileCollector: recursive directory walker
• FileFilter: applies ignore rules (.git, node_modules, large files)
c. AI Processing Module
• AIClient: wraps HTTP calls to OpenRouter API via requests
d. Export Module
• MarkdownGenerator: formats project tree and code snippets
• FileWriter: writes project_export.md
e. Logging Module
• Logger: writes export_log.txt for errors and processing details
f. External Service
• OpenRouter API (model inference endpoint)
Relationships and Data Flow
• Start: export.py (CLI entry)
→ Configuration Loader
→ FileCollector
→ FileFilter
→ AIClient (requests to OpenRouter)
→ MarkdownGenerator
→ FileWriter
→ Logger
• Error paths from FileFilter or API errors into Logger.
Important Architectural Patterns
• Pipeline pattern: data flows through sequential stages (collect → filter → process → export).
• Single responsibility: each module has one clear function.
• Separation of concerns: configuration, I/O, processing, and logging are distinct.
Technologies and Frameworks
• Python 3.6+
• requests for HTTP
• python-dotenv for configuration
• OpenRouter API
• Markdown (.md) as output format
Final Advice
• Error flows explicitly (e.g., “on API failure → Logger”).