Development Documentation
Comprehensive development guide for the Vertical Farm platform.
๐ Documentation Structure
Document | Purpose | When to Use |
---|---|---|
Contributing Guide | Complete onboarding and workflow | Starting development, understanding process |
Coding Standards | Style guide and design patterns | Writing new code, reviewing PRs |
Testing Guide | Testing strategy and implementation | Writing tests, debugging failures |
Debugging Guide | Debugging techniques and tools | Troubleshooting issues |
Pull Request Guide | PR process and best practices | Creating or reviewing PRs |
๐ Quick Start Path
For New Contributors
- Start Here โ Contributing Guide
- Environment setup
- Development workflow
-
How to claim and complete tasks
-
Understand Standards โ Coding Standards
- Architecture patterns (Service Layer is MANDATORY!)
- Frontend patterns (Next.js 15, React 19)
-
Backend patterns (FastAPI, Python 3.13)
-
Write Tests โ Testing Guide
- Test organization
- Writing effective tests
-
Coverage requirements
-
Submit Work โ Pull Request Guide
- PR creation process
- Review guidelines
- Merge requirements
๐๏ธ Technology Stack
Frontend
- Framework: Next.js 15 (App Router)
- UI Library: React 19
- Language: TypeScript
- Styling: Tailwind CSS with custom design system
- State: Supabase client, React Context
- Testing: Jest, React Testing Library, Playwright
Backend
- Framework: FastAPI
- Language: Python 3.13
- Database: PostgreSQL via Supabase
- Authentication: JWT + Supabase Auth
- Testing: pytest, pytest-asyncio
- Type Checking: mypy, Pydantic
Infrastructure
- Database: Supabase (PostgreSQL + Auth + Realtime)
- Deployment: Docker, GitHub Actions
- Monitoring: Datadog (production)
- Edge: Cloudflare Workers
๐ฏ Critical Architecture Rules
๐จ Service Layer Pattern (MANDATORY)
NEVER bypass the service layer for data operations!
// โ
CORRECT - Always use service layer
const farmService = FarmService.getInstance()
const farms = await farmService.getFarmsByUser(userId)
// โ WRONG - Never direct database calls in components
const { data } = await supabase.from('farms').select('*') // FORBIDDEN!
๐ Security Requirements
- RLS (Row Level Security) on every database table
- JWT authentication for all API endpoints
- Input validation at service layer
- Never expose service keys to frontend
โก Performance Standards
- API Response: <200ms (p95)
- Page Load: <2 seconds
- Test Execution: <5 minutes
- Bundle Size: Monitor and optimize
๐ Development Workflow
graph LR
A[Claim Task] --> B[Plan Work]
B --> C[Write Code]
C --> D[Write Tests]
D --> E[Self Review]
E --> F[Create PR]
F --> G[Code Review]
G --> H[Address Feedback]
H --> I[Merge]
I --> J[Deploy]
๐งช Quality Gates
All code must pass:
- โ Linting (ESLint, Black, isort)
- โ Type Checking (TypeScript, mypy)
- โ Unit Tests (>80% coverage)
- โ Integration Tests (critical paths)
- โ Code Review (at least 1 approval)
- โ CI/CD Pipeline (all checks green)
๐ ๏ธ Developer Tools
Required Tools
- Git - Version control
- Docker - Containerization
- Node.js 18+ - Frontend runtime
- Python 3.13+ - Backend runtime
- Supabase CLI - Local database
Recommended IDE Setup
- Cursor IDE or VS Code
- Extensions:
- Python (Pylance)
- ESLint
- Prettier
- Tailwind CSS IntelliSense
- GitLens
MCP Servers (for Cursor)
- GitHub MCP server
- Sequential Thinking MCP server
- Context7 MCP Server
- Playwright MCP server
- Supabase MCP server
๐ Current Status
Test Coverage
Component | Target | Current | Status |
---|---|---|---|
Backend | 80% | 75% | ๐ก |
Frontend | 70% | 45% | ๐ด |
E2E | 100% | 80% | ๐ก |
Code Quality Metrics
- Linting Compliance: 95%
- Type Coverage: 90%
- Documentation: 85%
- PR Review Time: <24 hours
๐จ Common Issues
Service Layer Violations
// Problem: Direct Supabase call in component
// Solution: Move to service layer
// See: coding-standards.md#service-layer-pattern
Test Failures
# Problem: Tests failing locally
# Solution: Check test database setup
# See: testing-guide.md#troubleshooting
Merge Conflicts
# Problem: Conflicts with main branch
# Solution: Rebase and resolve
# See: pull-request-guide.md#handling-conflicts
๐ Additional Resources
Internal Documentation
External Resources
๐ค Getting Help
- Check Documentation - Most answers are here
- Search Issues - Someone may have had the same problem
- Ask Team - Post in discussions or Discord
- Create Issue - If you've found a bug or need a feature
๐ Continuous Improvement
We regularly review and update our development practices:
- Weekly: Team sync on blockers
- Monthly: Process improvements
- Quarterly: Architecture review
- Annually: Tech stack evaluation
This documentation is maintained by the development team. Last updated: January 2025
Have suggestions? Submit a PR to improve our docs!