How mr-mahfuj/devlens works
DevLens is a web application for authenticating users and analyzing Git or local repositories, with dashboards, report history, and comparison. The principal flow is repository selection in the frontend, API analysis, repository cloning and metric generation, then results rendered in the dashboard. Authentication, saved reports, comparisons, and distinct commit, issue, churn, and class-design analyses are also represented. Edges reflect shown imports/calls or README capabilities; unsampled route internals are linked only where documented, so some feature-to-service details remain uncertain.
Main entry points: commit.py Metric endpoints · api.js API client · main.py FastAPI application · auth.py Authentication routes
Components 27
Web client
- Page routing
frontend/src/App.jsx - Repository input
frontend/src/components/repository.jsx - API client
frontend/src/api.js - Metrics dashboard
frontend/src/ResultPage.jsx - Report comparison
frontend/src/pages/ComparePage.jsx - Saved report view
frontend/src/pages/ViewReportPage.jsx - Registration and login
frontend/src/pages/registration_pages/Registration.jsx
API and identity
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routes/auth.py - Analysis endpoint
backend/app/routes/analysis.py - Metric endpoints
backend/app/routes/commit.py - Report endpoints
backend/app/routes/reports.py
Repository analysis
- Source resolution
backend/app/utils/repo_source.py - Analysis orchestration
backend/features/spl1/repo_analysis_service.py - Code metrics analyzer
backend/features/spl1/Code Analyzer/repo_analyzer.py - Class design analysis
backend/features/spl2/Class_Component_Design/class_component_design.py - Churn analysis
backend/features/spl2/Code_Churn/churn_rate.py - Code ownership
backend/features/spl2/Code_Churn/code_ownership.py - Change heatmap
backend/features/spl2/Code_Churn/file_change_heatmap.py - Commit activity
backend/features/spl1/commit_activity.py - Commit message quality
backend/features/spl2/Commit_Message_Quality/commit_message_quality.py - Issue tracking
backend/features/spl2/issue_tracker.py
Report persistence
- SQL database
- Database sessions
backend/app/utils/database.py - User and report models
backend/app/models/user.py - Mongo report store
backend/app/utils/mongo.py
Other components
- Developer
Connections 33
- Developer → Page routing: uses
README.md - Page routing → Repository input: renders
- Repository input → API client: submits to
- API client → FastAPI application: HTTP requests
frontend/src/api.js - FastAPI application → Analysis endpoint: registers
backend/app/main.py - FastAPI application → Authentication routes: registers
backend/app/main.py - FastAPI application → Metric endpoints: registers
backend/app/main.py - FastAPI application → Report endpoints: registers
backend/app/main.py - Analysis endpoint → Source resolution: uses
backend/app/routes/analysis.py - Analysis endpoint → Analysis orchestration: invokes
backend/app/routes/analysis.py - Analysis orchestration → Code metrics analyzer: loads and runs
backend/features/spl1/repo_analysis_service.py - API client → Metrics dashboard: returns metrics
frontend/src/ResultPage.jsx - Metrics dashboard → API client: requests analyses
frontend/src/ResultPage.jsx - API client → Metric endpoints: requests metric APIs
frontend/src/api.js - Metric endpoints → Source resolution: uses source
backend/app/routes/commit.py - Metric endpoints → Class design analysis: provides design metrics
- Metric endpoints → Churn analysis: provides churn metrics
- Metric endpoints → Code ownership: provides ownership metrics
- Metric endpoints → Change heatmap: provides heatmap data
- Metric endpoints → Commit activity: provides activity metrics
- Metric endpoints → Commit message quality: provides quality metrics
- Metric endpoints → Issue tracking: provides issue metrics
- API client → Authentication routes: authenticates
- Registration and login → API client: calls auth API
frontend/src/pages/registration_pages/Registration.jsx - Authentication routes → User and report models: queries and stores
backend/app/routes/auth.py - Authentication routes → Database sessions: opens sessions
backend/app/routes/auth.py - Database sessions → SQL database: connects
backend/app/utils/database.py - FastAPI application → Database sessions: initializes schema
backend/app/main.py - API client → Report endpoints: saves and compares
frontend/src/api.js - Report endpoints → Mongo report store: uses report store
backend/app/routes/reports.py - Report endpoints → User and report models: uses repository models
backend/app/routes/reports.py - Report comparison → API client: requests comparison
frontend/src/pages/ComparePage.jsx - Saved report view → Metrics dashboard: reuses metric views
frontend/src/pages/ViewReportPage.jsx