Follow SETUP.md first to get the development environment running.
dusty-app/
├── backend/ Python FastAPI backend
│ ├── app/
│ │ ├── api/ Route handlers
│ │ ├── core/ Configuration
│ │ ├── models/ Data schemas
│ │ └── services/ Business logic
│ └── tests/ Backend tests
├── frontend/ React TypeScript frontend
│ ├── src/
│ │ ├── components/ React components
│ │ ├── pages/ Page components
│ │ ├── services/ API clients
│ │ └── types/ TypeScript types
│ └── public/ Static assets
└── docs/ Documentation
- Define route in
backend/app/api/routes/
@router.post("/new-endpoint")
async def new_endpoint(data: RequestModel):
return {"result": "success"}- Create service in
backend/app/services/
class NewService:
async def process(self, data):
return processed_data- Add schema in
backend/app/models/schemas.py
class RequestModel(BaseModel):
field: str- Register router in
backend/app/main.py
app.include_router(new_router, prefix="/api", tags=["new"])- Create component in
frontend/src/components/
export default function NewComponent() {
return <div>Component</div>
}- Add types in
frontend/src/types/index.ts
export interface NewData {
field: string
}- Create API service in
frontend/src/services/api.ts
export async function fetchNewData(): Promise<NewData> {
const response = await api.get('/new-endpoint')
return response.data
}- Use React Query hook
const { data, isLoading } = useQuery({
queryKey: ['newData'],
queryFn: fetchNewData
})Formatting: Black
black backend/appLinting: Ruff
ruff check backend/appType Checking: mypy (optional)
mypy backend/appFormatting: Prettier (via npm script)
npm run formatLinting: ESLint
npm run lintRun all tests
cd backend
pytestRun with coverage
pytest --cov=app --cov-report=htmlTest structure
def test_parse_esx():
parser = ESXParser()
result = await parser.parse_esx(sample_data, "test.esx")
assert result["file_id"]
assert result["metadata"]["estimate_found"]Run tests
npm testComponent test example
test('uploads file on drop', async () => {
render(<HomePage />)
const file = new File(['content'], 'test.esx')
// Test dropzone interaction
})Add logging
import logging
logger = logging.getLogger(__name__)
logger.info(f"Processing file: {filename}")VS Code launch.json
{
"name": "FastAPI",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": ["app.main:app", "--reload"]
}React DevTools: Install browser extension
Network inspection: Browser DevTools → Network tab
React Query DevTools: Already configured in development
Mock responses for testing without API calls:
class MockAIMapper(AIMapper):
async def suggest_mappings(self, codes, context):
return {
"XM-ROOF-001": "SYMB-RF-001",
"XM-WALL-002": "SYMB-WL-002"
}Test with real API:
- Ensure
.envhas validOPENAI_API_KEY - Use small test datasets to minimize cost
- Log all prompts and responses
- Track token usage
Currently using in-memory storage. To add SQLite:
- Create models in
backend/app/models/database.py
from sqlalchemy import Column, String
class Conversion(Base):
__tablename__ = "conversions"
id = Column(String, primary_key=True)- Initialize database
from sqlalchemy.ext.asyncio import create_async_engine
engine = create_async_engine(settings.DATABASE_URL)- Add migration support (Alembic)
- Use
async/awaitfor I/O operations - Stream large files instead of loading to memory
- Cache AI responses in database
- Add Redis for distributed caching
- Use
React.lazy()for code splitting - Memoize expensive computations
- Virtualize long lists
- Optimize images and assets
Check Python version
python --version # Should be 3.11+Reinstall dependencies
pip install -r requirements.txt --upgradeClear node_modules
rm -rf node_modules
npm installCheck Node version
node --version # Should be 18+Check backend is running: http://localhost:8000/health
Check CORS configuration in backend/app/main.py:
allow_origins=["http://localhost:5173"]Branch naming
feature/descriptionbugfix/descriptiondocs/description
Commit messages
feat: add roofplan XML generationfix: correct facet area calculationdocs: update API documentation
When handing off to Claude Code or another developer:
- Point to specific files needing work
- Reference TODO.md for context
- Highlight integration points in ARCHITECTURE.md
- Share test cases for validation
"Need help implementing the diagram canvas. Check:
frontend/src/components/diagrams/(create this)- Use Konva.js per package.json
- Integrate with ConversionPage.tsx
- See TODO.md Phase 5 for requirements"
- FastAPI Docs: https://fastapi.tiangolo.com/
- React Query: https://tanstack.com/query/latest
- TailwindCSS: https://tailwindcss.com/docs
- OpenAI API: https://platform.openai.com/docs
- Symbility Docs: (Contact CoreLogic for API/schema docs)