How sourcerer-io/sourcerer-app works
Sourcerer is a CLI app for building a visual software-engineer profile from local Git repositories. Its main workflow is to configure and select repositories, inspect commit history and diffs, derive language/library and contribution statistics, then send statistical data to Sourcerer’s API. The README also highlights broad language/library detection, repository summaries, and interesting facts. Several subsystem links below rely on README statements or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: CommitCrawler.kt Git commit crawler · Api.kt API contract · Main.kt CLI entry · FileConfigurator.kt Configuration
Components 22
CLI and setup
- CLI entry
src/main/kotlin/app/Main.kt - Console wizard
src/main/kotlin/app/ui/ConsoleUi.kt - Authentication
src/main/kotlin/app/ui/AuthState.kt - Email setup
src/main/kotlin/app/ui/EmailState.kt - Repository actions
src/main/kotlin/app/ui/AddRepoState.kt - Configuration
src/main/kotlin/app/config/FileConfigurator.kt - Logging and telemetry
src/main/kotlin/app/Logger.kt - Local file access
src/main/kotlin/app/utils/FileHelper.kt
Repository analysis
- Local repository model
src/main/kotlin/app/model/LocalRepo.kt - Repository discovery
src/main/kotlin/app/utils/RepoHelper.kt - Git commit crawler
src/main/kotlin/app/hashers/CommitCrawler.kt - Language extractors
src/main/kotlin/app/extractors/ExtractorInterface.kt - Library classifier
src/main/kotlin/app/extractors/ClassifierManager.kt - Language heuristics
src/main/kotlin/app/extractors/Heuristics.kt
Profile insights
- Repository hasher
src/main/kotlin/app/hashers/RepoHasher.kt - Fact and longevity analysis
src/main/kotlin/app/hashers/CodeLongevity.kt - Author distance analysis
src/main/kotlin/app/hashers/AuthorDistanceHasher.kt - Profile data models
src/main/kotlin/app/model
Server synchronization
- API contract
src/main/kotlin/app/api/Api.kt - Server client
src/main/kotlin/app/api/ServerApi.kt
Other components
- Engineer
- Sourcerer service
Connections 26
- Engineer → CLI entry: runs
README.md - CLI entry → Console wizard: starts wizard
src/main/kotlin/app/Main.kt - CLI entry → Configuration: loads settings
src/main/kotlin/app/Main.kt - Console wizard → Authentication: routes to
src/main/kotlin/app/ui/AuthState.kt - Authentication → Email setup: routes to
src/main/kotlin/app/ui/AuthState.kt - Authentication → API contract: authorizes
src/main/kotlin/app/ui/AuthState.kt - CLI entry → Repository actions: supports commands
src/main/kotlin/app/Main.kt - Configuration → Local repository model: stores selections
src/main/kotlin/app/config/FileConfigurator.kt - Repository actions → Repository discovery: manages repos
- Repository discovery → Git commit crawler: reads history
src/main/kotlin/app/utils/RepoHelper.kt - Email setup → Git commit crawler: checks commits
src/main/kotlin/app/ui/EmailState.kt - Git commit crawler → Profile data models: creates commit data
src/main/kotlin/app/hashers/CommitCrawler.kt - Git commit crawler → Language extractors: supplies diffs
- Language extractors → Library classifier: uses classifier
src/main/kotlin/app/extractors/ExtractorInterface.kt - Language heuristics → Language extractors: implements detection
src/main/kotlin/app/extractors/Heuristics.kt - Email setup → Repository hasher: starts hashing
- Repository hasher → Git commit crawler: crawls commits
- Repository hasher → API contract: uploads statistics
- Fact and longevity analysis → Git commit crawler: uses history
src/main/kotlin/app/hashers/CodeLongevity.kt - Fact and longevity analysis → API contract: submits facts
src/main/kotlin/app/hashers/CodeLongevity.kt - Author distance analysis → API contract: submits distances
src/main/kotlin/app/hashers/AuthorDistanceHasher.kt - Server client → API contract: implements
src/main/kotlin/app/api/ServerApi.kt - Server client → Configuration: reads credentials
src/main/kotlin/app/api/ServerApi.kt - API contract → Sourcerer service: exchanges profile data
README.md - CLI entry → Logging and telemetry: logs events
src/main/kotlin/app/Main.kt - Configuration → Local file access: uses file paths
src/main/kotlin/app/config/FileConfigurator.kt