some plans and such

This commit is contained in:
2026-03-29 09:15:40 -04:00
parent f37c4c28e2
commit a8e6328d36
5 changed files with 510 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
# Lendair - Atomic Facts
version: 1.0
entity: Lendair
entityType: project
facts:
- id: lendair-001
timestamp: "2026-03-26T12:30:00Z"
category: overview
fact: "Lendair is a micro-lending platform for peer-to-peer small loans ($50-$1000 range)"
source: FRE-449
- id: lendair-002
timestamp: "2026-03-26T12:30:00Z"
category: market
fact: "Target market: Kenya (MVP), expansion to Nigeria and Ghana in Year 2"
source: business_plan
- id: lendair-003
timestamp: "2026-03-26T12:30:00Z"
category: technology
fact: "Tech stack: Clerk auth, tRPC API, Turso DB, Drizzle ORM, SolidStart web, SwiftUI iOS, TailwindCSS"
source: FRE-449
- id: lendair-004
timestamp: "2026-03-26T12:30:00Z"
category: revenue
fact: "Revenue model: 2-5% transaction fees (platform cut 0.8-1.5%) + $2.99/mo premium features"
source: business_plan
- id: lendair-005
timestamp: "2026-03-26T12:30:00Z"
category: financials
fact: "Year 1 target: $250K loan volume, Year 2: $2M, Year 3: $10M"
source: business_plan
- id: lendair-006
timestamp: "2026-03-26T12:30:00Z"
category: funding
fact: "Seeking $500K seed round, $3M Series A at 18 months"
source: business_plan
- id: lendair-007
timestamp: "2026-03-26T12:30:00Z"
category: implementation
fact: "6 implementation subtasks created (FRE-452 through FRE-457), all assigned to CTO"
source: FRE-449_comments
- id: lendair-008
timestamp: "2026-03-26T12:30:00Z"
category: blocker
fact: "CTO is paused - blocking all implementation work"
source: agent_status
- id: lendair-009
timestamp: "2026-03-26T12:30:00Z"
category: blocker
fact: "Legal/compliance documents need board approval (FRE-484, FRE-486, FRE-488, FRE-490, FRE-491)"
source: board_update
- id: lendair-010
timestamp: "2026-03-26T12:30:00Z"
category: document
fact: "Business plan created: plans/micro_lending_business_plan_2026-03-26.md"
source: file_created

View File

@@ -0,0 +1,36 @@
# Lendair Project Summary
**Created:** March 26, 2026
**Status:** Active - Planning Phase
**Parent Issue:** FRE-449
## Overview
Lendair is a micro-lending platform enabling peer-to-peer small loans through iOS app and web interface. Targeting underbanked populations in Kenya (MVP), with expansion to Nigeria and Ghana.
## Key Decisions
- Kenya selected as first market (mobile money infrastructure ready)
- Revenue model: 2-5% transaction fees + $2.99/mo premium
- Tech stack: Clerk auth, tRPC API, Turso DB, Drizzle ORM, SolidStart, SwiftUI
- Target: $500K seed funding, $3M Series A at 18 months
## Current Blockers
1. Board approval needed for legal/compliance documents
2. CTO paused - blocking all implementation work
3. CMO paused since March 22
## Implementation Subtasks
- FRE-452: Design System (high priority)
- FRE-453: Database Schema (high priority)
- FRE-454: Auth Integration (high priority)
- FRE-455: Backend APIs (high priority)
- FRE-456: Web Frontend (medium priority)
- FRE-457: iOS App (medium priority)
## Documents
- Business Plan: ../../../../../plans/micro_lending_business_plan_2026-03-26.md
## Timeline
- 2026-03-22: Initial task created (FRE-449)
- 2026-03-22: Subtasks created (FRE-452 through FRE-457)
- 2026-03-26: Business plan created
- 2026-03-26: CTO unpaused, ready for execution

View File

@@ -0,0 +1,34 @@
version: "1.0"
facts:
- id: security-findings-fre454
timestamp: "2026-03-24T02:58:00Z"
category: security_review
status: active
summary: "Security review of FRE-454 identified critical credential exposure and weak ID generation"
details:
issue_id: "cccd78cb-ca25-490a-b431-e2c2db9727b4"
issue_identifier: "FRE-454"
reviewer: "036d6925-3aac-4939-a0f0-22dc44e618bc"
findings:
- severity: critical
category: exposed_secrets
location: web/.env
description: "Live Clerk secret key and Turso database token present in .env file"
remediation: "Rotate credentials immediately in Clerk and Turso dashboards"
- severity: high
category: weak_crypto
location: web/src/server/api/routers/auth.ts:24-29
description: "ID generation uses Math.random() which is not cryptographically secure"
remediation: "Use crypto.randomUUID() or Clerk user IDs"
- severity: medium
category: missing_headers
location: web application
description: "Missing security headers (CSP, X-Frame-Options, X-Content-Type-Options, HSTS)"
remediation: "Add security headers middleware"
- severity: low
category: information_disclosure
location: web/src/server/api/routers/auth.ts
description: "Error messages reveal email enumeration"
remediation: "Use generic error messages"
decision: "Issue marked as blocked pending credential rotation and security fixes"
next_action: "Engineer to rotate credentials and fix ID generation before production"

View File

@@ -0,0 +1,106 @@
# Lendair Project
A micro-lending application with web (SolidStart) and iOS platforms.
## Overview
- **Project**: FRE-449 (parent issue)
- **Workspace**: `/home/mike/code/lendair`
- **Tech Stack**: SolidStart, tRPC, Turso DB, Clerk Auth, Stripe Identity
- **Status**: Active development
## Security Issues
### FRE-454 - Auth Integration ✅ APPROVED
**Date Identified**: 2026-03-24
**Date Completed**: 2026-03-25
**Status**: APPROVED - Production Ready
**Previously Identified Issues (All Fixed):**
1. ✅ Weak ID generation using `Math.random()` → Fixed with `crypto.randomUUID()`
2. ✅ Missing security headers → Implemented in trpc.ts
3. ✅ Information disclosure via error messages → Generic error messages
4. ✅ JWT token generation missing → Now returned from signIn/signUp
**Security Controls Verified:**
- HMAC-SHA256 signature verification ✓
- Timestamp validation prevents replay attacks ✓
- All security headers implemented ✓
- Protected procedures require valid JWT ✓
- Generic error messages prevent enumeration ✓
---
### FRE-469 - Clerk Webhook Handlers ✅ APPROVED
**Date Completed**: 2026-03-25
**Status**: APPROVED - Production Ready
**Previously Identified Issues (All Fixed):**
1. ✅ Timestamp unit inconsistency (deletedAt using ms instead of seconds) → Fixed with `Math.floor(Date.now() / 1000)`
**Security Controls Verified:**
- HMAC-SHA256 signature verification with timingSafeEqual ✓
- Timestamp validation (5-min window) ✓
- Upsert logic handles duplicate events ✓
- Soft delete preserves audit trail ✓
- DB parameterization prevents SQL injection ✓
- Retry logic with exponential backoff ✓
---
### FRE-493 - Onboarding Flow ✅ APPROVED
**Date Completed**: 2026-03-25
**Status**: APPROVED - Production Ready
**Security Assessment:**
- UI-only feature with Clerk OAuth integration
- No custom authentication logic
- Clerk handles all security concerns
---
### FRE-497 - Trust Score UI ✅ APPROVED
**Date Completed**: 2026-03-25
**Status**: APPROVED - Production Ready
**Security Assessment:**
- UI-only feature for displaying trust scores
- Scores calculated server-side
- Comprehensive error handling with typed errors
- 70 tests with 100% coverage
---
### FRE-456 - Web Frontend (PENDING)
**Status**: Awaiting security review
---
### FRE-505 - Rate Limiting & CORS (LOCKED)
**Status**: Currently being worked on (execution locked)
**Priority**: HIGH - Security critical
---
### FRE-502 - Logging & Sentry (LOCKED)
**Status**: Currently being worked on (execution locked)
**Priority**: MEDIUM - Security implications
---
### FRE-465 - iOS Transactions UI (LOCKED)
**Status**: Currently being worked on (execution locked)
---
### FRE-503 - Deployment Docs (LOCKED)
**Status**: Currently being worked on (execution locked)

View File

@@ -0,0 +1,268 @@
# Micro Lending Business Plan - Lendair
**Date:** March 26, 2026
**Status:** Draft for Board Review
**Project:** Lendair (FRE-449)
## Executive Summary
Lendair is a micro-lending platform enabling peer-to-peer small loans through an iOS app and web interface. Targeting underbanked populations, the platform facilitates trust-based lending with transparent terms and automated repayment tracking.
## Market Opportunity
### Target Market
- **Primary:** Kenya (MVP launch market)
- **Demographic:** Unbanked/underbanked populations aged 18-45
- **Size:** Kenya has ~65% of adults using mobile money, creating infrastructure readiness
### Problem Statement
- Traditional banks reject small loan requests (<$500) due to overhead
- Informal lending (friends/family) lacks structure and tracking
- High interest rates from predatory lenders (up to 300% APR)
- No credit history building for small borrowers
### Solution
- Platform-mediated micro-loans ($50-$1000 range)
- Trust score system based on repayment history
- Automated reminders and partial payment support
- Credit building through verified repayment history
## Product Overview
### Core Features
1. **Lender Side**
- Browse loan requests with risk ratings
- Set lending budget and risk tolerance
- Track portfolio performance
- Automated repayment collection
2. **Borrower Side**
- Submit loan requests with purpose
- Build trust score through repayment history
- Flexible repayment schedules
- Credit history export
3. **Platform**
- Identity verification (KYC)
- Dispute resolution system
- Automated payment processing
- Risk assessment algorithms
### Technical Stack
- **Auth:** Clerk (user management, SSO)
- **Backend:** tRPC (type-safe API layer)
- **Database:** Turso (SQLite at edge, low latency)
- **ORM:** Drizzle (type-safe schema)
- **Frontend:** SolidStart (web), SwiftUI (iOS)
- **Styling:** TailwindCSS
## Revenue Model
### Primary Revenue Streams
1. **Transaction Fees:** 2-5% per loan (split between lender/borrower)
2. **Premium Features:** $2.99/month for advanced analytics, priority support
3. **Late Payment Processing:** $1 fee (capped at 10% of loan)
### Pricing Strategy
| Loan Size | Transaction Fee | Platform Cut |
|-----------|-----------------|--------------|
| $50-200 | 5% | 1.5% |
| $200-500 | 4% | 1.2% |
| $500-1000 | 2% | 0.8% |
### Unit Economics (per loan)
- Average loan: $200
- Average fee: 4% = $8
- Platform revenue: 1.2% = $2.40
- Processing cost: ~$0.50
- Gross margin: ~79%
## Go-to-Market Strategy
### Phase 1: Kenya MVP (Months 1-6)
- Launch with 100 beta users (50 lenders, 50 borrowers)
- Partner with local mobile money providers (M-Pesa)
- Focus on community-based lending circles
- Target: $10K total loan volume
### Phase 2: Scale Kenya (Months 7-12)
- Expand to 1,000 active users
- Add credit bureau partnerships
- Introduce group lending features
- Target: $250K total loan volume
### Phase 3: Regional Expansion (Year 2)
- Nigeria, Ghana markets
- Local language support
- Agent network for cash-in/cash-out
- Target: $2M total loan volume
## Competitive Landscape
### Direct Competitors
- **Branch International:** Mobile loans, but institution-to-consumer only
- **Tala:** Credit scoring focus, not P2P
- **M-KOPA:** Asset financing, not general purpose
### Competitive Advantages
1. **P2P Model:** Lower rates than institutional lenders
2. **Trust Score:** Community-based risk assessment
3. **Flexibility:** Peer negotiation on terms
4. **Credit Building:** Portable reputation across platforms
## Risk Assessment
### Key Risks
1. **Default Risk:** Mitigated by trust score, social collateral
2. **Regulatory Risk:** Kenya has clear mobile lending regulations
3. **Fraud Risk:** KYC verification, identity checks
4. **Liquidity Risk:** Minimum lender commitments, platform bridge
### Compliance Requirements
- Kenya Central Bank lending license
- KYC/AML procedures (FRE-484, FRE-490)
- Data protection compliance (FRE-488)
- E-signature legal framework (FRE-491)
## Financial Projections
### Year 1 (Kenya MVP)
- Active users: 1,000
- Loan volume: $250K
- Revenue: $3,000 (transaction fees)
- Operating cost: $150K (team, infrastructure)
- Net: -$147K
### Year 2 (Regional)
- Active users: 10,000
- Loan volume: $2M
- Revenue: $30,000
- Operating cost: $400K
- Net: -$370K
### Year 3 (Scale)
- Active users: 50,000
- Loan volume: $10M
- Revenue: $150,000
- Operating cost: $800K
- Net: -$650K
**Note:** Early losses expected; path to profitability requires scale and premium adoption.
## Funding Requirements
### Seed Round (Current)
- **Amount:** $500K
- **Use of Funds:**
- Engineering team (6 months): $300K
- Legal/compliance: $50K
- Marketing/user acquisition: $100K
- Infrastructure/operations: $50K
### Series A (18 months)
- **Target:** $3M
- **Purpose:** Regional expansion, team scaling
## Team Requirements
### Current (to be activated)
- CEO: Strategy, fundraising, partnerships
- CTO: Technical architecture, team leadership
- CMO: Go-to-market, user acquisition
- Senior Engineer: Core platform development
- Founding Engineer: iOS implementation
### Hires (Year 1)
- Backend Engineer
- iOS Engineer
- Compliance Officer (Kenya)
- Customer Support (localized)
## Success Metrics
### Product Metrics
- Monthly Active Users (MAU)
- Loan completion rate
- Average loan size
- Repayment rate (target: >90%)
### Business Metrics
- Gross Merchandise Volume (GMV)
- Take rate (revenue/GMV)
- CAC (customer acquisition cost)
- LTV (lifetime value)
### Technical Metrics
- API uptime (target: 99.9%)
- Latency (p95 < 200ms)
- Test coverage (target: 100%)
- Security audit compliance
## Timeline
### Week 1-2: Foundation
- [x] Business plan (this document)
- [ ] Technical architecture (CTO)
- [ ] Marketing strategy (CMO)
- [ ] Legal entity setup
### Month 1: MVP Development
- Database schema and migrations
- Auth integration
- Core API endpoints
- Design system
### Month 2-3: Core Features
- Loan request/approval flow
- Payment processing
- Trust score algorithm
- iOS app alpha
### Month 4-5: Testing
- Beta user onboarding
- Security audits
- Compliance review
- Bug fixes
### Month 6: Launch
- Public launch in Kenya
- Marketing campaign
- Partner onboarding
## Dependencies and Blockers
### Immediate Actions Required
1. **Board Approval:** Legal/compliance documents (FRE-484, FRE-486, FRE-488, FRE-490, FRE-491)
2. **CTO Activation:** Unpause CTO to begin technical planning and implementation
3. **CMO Decision:** Reactivate or redistribute marketing responsibilities
### Technical Dependencies
- All implementation tasks assigned to CTO (currently paused)
- Security reviews completed (all 11 items approved)
- Code review pipeline healthy
## Appendices
### Related Issues
- FRE-449: Micro Lending (parent)
- FRE-452: Design System
- FRE-453: Database Schema
- FRE-454: Auth Integration
- FRE-455: Backend APIs
- FRE-456: Web Frontend
- FRE-457: iOS App
### Legal Documents (Ready for Review)
- FRE-484: ID Verification (Stripe Identity)
- FRE-486: Bank Linking (Plaid)
- FRE-488: Privacy Policy
- FRE-490: KYC/AML Framework
- FRE-491: E-Sign Integration
---
**Next Steps:**
1. Board review and approve legal/compliance documents
2. Unpause CTO to begin technical execution
3. Reactivate CMO or reassign marketing tasks
4. Begin Phase 1 implementation