How kakaotechcampus-4/ktc4-pusan-4 works
PreeT helps sole proprietors judge card expenses for tax deductibility. The user uploads a card statement, reviews unresolved merchant-category suggestions, supplies business context and answers only needed follow-up questions, then sees cited decisions, annual-limit effects, summaries, and a tax-adviser export. Judgment is deterministic; AI supports merchant suggestions, the Really assistant, and rule-candidate drafting. The README documents these product flows and corpus sync; sampled code confirms selected judgment, query, classification-review, and AI-server behavior. Other links are limited to documented relationships because their implementations were not sampled.
Main entry points: App.tsx PreeT web app · ClassificationReviewService.java Category review · decisions.py AI category suggestions · agent.py Really assistant
Components 25
User experience
- PreeT web app
frontend/src/App.tsx - Statement parser
frontend/src/parser/pipeline.ts
Transactions and classification
- Transaction API
backend/src/main/java/com/ktc4/pusan4/transaction/api/UploadBatchController.java - Transaction records
backend/src/main/java/com/ktc4/pusan4/judgment/persistence/TransactionRecordEntity.java - Merchant classifier
backend/src/main/java/com/ktc4/pusan4/merchant/classify/MerchantClassifier.java - Category review
backend/src/main/java/com/ktc4/pusan4/transaction/persistence/ClassificationReviewService.java
Expense judgment
- Business context
backend/src/main/java/com/ktc4/pusan4/user/persistence/BusinessContextService.java - Rules judgment engine
backend/src/main/java/com/ktc4/pusan4/judgment/domain/JudgmentEngine.java - Judgment records
backend/src/main/java/com/ktc4/pusan4/judgment/persistence/JudgmentEntity.java - Follow-up questions
backend/src/main/java/com/ktc4/pusan4/judgment/persistence/QuestionQueryService.java - Results and export
backend/src/main/java/com/ktc4/pusan4/judgment/persistence/JudgmentQueryService.java
AI and rule operations
- AI category suggestions
ai/classify/decisions.py - Really assistant
ai/assistant/agent.py - Assistant API tools
ai/assistant/tools.py - Rule candidates
ai/pipeline/candidates.py - Law corpus sync
ai/pipeline/law_sync.py - Rule-card promotion
ai/pipeline/promote.py - AI service
ai/app/main.py
Identity and support
- Authentication
backend/src/main/java/com/ktc4/pusan4/auth/AuthService.java - User and business data
backend/src/main/java/com/ktc4/pusan4/user/persistence/UserService.java - Redis token store
backend/src/main/java/com/ktc4/pusan4/auth/RedisRefreshTokenStore.java
Other components
- Business owner
- National law API
- LLM provider
- GitHub rules PR
Connections 31
- Business owner → PreeT web app: uses
README.md - PreeT web app → Statement parser: reads statement
README.md - Statement parser → Transaction API: submits transactions
README.md - Transaction API → Transaction records: stores transactions
- Transaction records → Merchant classifier: classifies merchants
- Merchant classifier → AI category suggestions: requests suggestions
- AI category suggestions → AI service: served by
ai/app/main.py - AI category suggestions → LLM provider: requests categories
- PreeT web app → Category review: confirms categories
README.md - Category review → Transaction records: updates classifications
backend/src/main/java/com/ktc4/pusan4/transaction/persistence/ClassificationReviewService.java - Category review → Rules judgment engine: rejudges transactions
backend/src/main/java/com/ktc4/pusan4/transaction/persistence/ClassificationReviewService.java - PreeT web app → Business context: sets business context
README.md - Rules judgment engine → Judgment records: persists decisions
- PreeT web app → Follow-up questions: answers questions
README.md - Follow-up questions → Judgment records: reads judgments
backend/src/main/java/com/ktc4/pusan4/judgment/persistence/QuestionQueryService.java - PreeT web app → Results and export: views and exports
README.md - Results and export → Judgment records: queries judgments
backend/src/main/java/com/ktc4/pusan4/judgment/persistence/JudgmentQueryService.java - PreeT web app → Really assistant: asks questions
README.md - Really assistant → Assistant API tools: uses tools
ai/assistant/agent.py - Assistant API tools → AI service: runs in
- Really assistant → LLM provider: generates answers
- Rule candidates → Law corpus sync: retrieves law sources
README.md - Law corpus sync → National law API: syncs statutes
README.md - Business owner → PreeT web app: reviews candidates
README.md - PreeT web app → Rule candidates: approves candidates
README.md - Rule candidates → Rule-card promotion: approved drafts
README.md - Rule-card promotion → GitHub rules PR: opens rules PR
README.md - Business owner → PreeT web app: signs in
README.md - PreeT web app → Authentication: authenticates
- Authentication → User and business data: manages accounts
backend/src/main/java/com/ktc4/pusan4/auth/AuthService.java - Authentication → Redis token store: stores refresh tokens
README.md