Thank you for your interest in contributing to RentRadar! This document provides guidelines and instructions for contributing.
- Development Setup
- Project Structure
- Branch Strategy
- Commit Conventions
- Development Workflow
- Code Standards
- Testing
- Pull Request Process
- Node.js >= 20
- pnpm >= 9
- Python >= 3.10 (for the ops agent only)
- macOS / Linux / Windows
# Clone the repository
git clone https://github.com/Jerry2003826/unihack3-13.git
cd unihack3-13
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your API keys (at minimum: GEMINI_API_KEY, GOOGLE_MAPS_API_KEY)
# Start development servers
pnpm devpnpm dev:web # Frontend at http://localhost:3000
pnpm dev:api # API at http://localhost:3001If you want to work on the knowledge base features:
# Start Qdrant vector database
docker run -d --name qdrant -p 127.0.0.1:6333:6333 qdrant/qdrant:latest
# Index knowledge documents
pnpm --filter api run knowledge:indexInspect/
├── apps/
│ ├── web/ # Next.js frontend (React 19, Tailwind v4)
│ └── api/ # Next.js API routes (Gemini, Maps, RAG)
├── packages/
│ ├── contracts/ # Shared Zod schemas and TypeScript types
│ └── ui/ # Shared UI components
├── agentic-workflow/ # Python autonomous ops agent
└── tests/ # E2E tests (Playwright)
| Directory | Purpose |
|---|---|
apps/api/src/lib/agents/ |
AI agent implementations (geo, community, search, maps) |
apps/api/src/lib/vision/ |
Vision analysis, 3D reconstruction, live scan |
apps/api/src/lib/knowledge/ |
RAG pipeline (Cohere + Qdrant) |
apps/api/src/lib/providers/ |
External service integrations (Gemini, MiniMax, Google Maps) |
apps/web/src/lib/ |
Frontend state management, utilities, hooks |
packages/contracts/src/ |
Shared schemas, scoring, paperwork logic |
| Branch | Purpose |
|---|---|
main |
Production-ready code, deployed to VPS |
feat/* |
New feature development |
fix/* |
Bug fixes |
docs/* |
Documentation updates |
chore/* |
Tooling, config, dependency updates |
mainmust always build cleanly (pnpm buildpasses)- All feature branches should be rebased onto
mainbefore merging - Direct pushes to
mainare acceptable for hotfixes and documentation
We follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation changes |
chore |
Build process, tooling, config |
refactor |
Code restructuring without behavior change |
test |
Adding or updating tests |
perf |
Performance improvement |
web, api, contracts, ui, ops, ci
feat(api): add smart gateway for dynamic model switching
fix(web): prevent report page crash on missing intelligence data
docs: update README with engineering deep-dive section
chore(api): remove deprecated zod-to-json-schema dependency
test(contracts): add scoring edge case tests
-
Create a branch from
main:git checkout -b feat/my-feature
-
Make changes following the code standards below.
-
Run checks locally:
pnpm build # Ensure TypeScript compiles pnpm test:unit # Run unit tests pnpm lint # Lint all packages
-
Commit with a conventional commit message.
-
Push and create a PR against
main.
- Strict mode enabled — no
anyunless absolutely necessary (cast with comment) - All AI responses validated through Zod schemas
- Use
callGeminiJson()for structured model outputs (never raw string parsing) - Every agent function returns typed results with optional
fallbackReason
- Components:
PascalCase.tsx(e.g.,RoomSceneViewer.tsx) - Utilities:
camelCase.ts(e.g.,liveGuidance.ts) - Tests:
<module>.test.ts(co-located with source) - API routes:
route.tsinside kebab-case directories
- No single AI failure should crash a request
- Every route handler wraps AI calls in try-catch with typed fallback responses
- Use
withTimeout()wrapper for all external API calls - Rate limit all public endpoints with sliding window +
429 + Retry-After
pnpm test:unit # Run all unit tests
pnpm test:unit -- --watch # Watch modeUnit tests use Vitest and cover: scoring algorithms, checklist logic, live scan helpers (IoU, focus confirmation), room state machines, knowledge query, search relevance, and more.
pnpm test:e2e # Run Playwright testsE2E tests cover: demo smoke flow, manual upload flow, comparison flow.
- Place test files next to the source file:
myModule.ts→myModule.test.ts - Use descriptive test names:
"only auto-records critical or high severity live observations" - Test both success paths and edge cases / error paths
- Ensure
pnpm buildandpnpm test:unitpass locally - Write a clear PR description explaining what and why
- Reference any related issues
- Request review from a team member
- Squash-merge into
mainwhen approved
Open an issue or reach out to the maintainers. We appreciate all contributions!