Skip to main content

Code Style Guidelines

Naming Conventions

TypeFrontend (TypeScript)Backend (Python)
Variables/FunctionscamelCasesnake_case
Classes/InterfacesPascalCasePascalCase
ConstantsUPPER_SNAKE_CASEUPPER_SNAKE_CASE
Fileskebab-casesnake_case

Frontend Code Style

  • Use React.FC to define components
  • Use StyleSheet.create to create styles
  • Prefer theme colors, avoid hardcoding
  • Icons must use lucide-react-native uniformly

Backend Code Style

  • SQLAlchemy 2.0 select() syntax
  • Pydantic v2 data validation
  • Encapsulate complex queries in the Service layer
  • Error handling: HTTPException + global exception handler

Error Handling

  • Frontend: try-catch + Toast/Alert notifications
  • Backend: HTTPException + global exception handler for unified response format