How keilevv/leaf_classifier works
Leaf Classifier lets users submit leaf images, receive model predictions, and review or edit saved classifications; administrators manage classifications, users, species, and classifier models. The frontend calls a backend API, which coordinates persistence and the separate Python classifier. The README also documents distinct species, history, settings, and model-management capabilities. The graph uses sampled frontend hooks and service code plus documented capabilities and tree paths; several route-to-controller links are omitted because those implementations were not sampled.
Main entry points: app.ts API application · PlantClassifierService.ts Classification workflow · App.jsx Pages and routes · Services API services
Components 23
Web application
- Pages and routes
frontend/src/App.jsx - Authentication hook
frontend/src/hooks/useAuth.js - Classifier hook
frontend/src/hooks/useClassifier.js - Admin hook
frontend/src/hooks/useAdmin.js - API services
frontend/src/Services
Backend API
- API application
backend/src/app.ts - Auth routes
backend/src/routes/auth.ts - Classifier routes
backend/src/routes/plantClassifier.ts - Admin routes
backend/src/routes/admin.ts - Authentication
backend/src/services/AuthService.ts - Classification workflow
backend/src/services/PlantClassifierService.ts - Administration
backend/src/services/AdminService.ts - Species management
backend/src/routes/species.ts - User management
backend/src/routes/user.ts - Classification data access
backend/src/repositories/ClassificationRepository.ts - Authentication data access
backend/src/repositories/AuthRepository.ts - Administration data access
backend/src/repositories/AdminRepository.ts
Classifier service
- Prediction service
classifier/app/routes/predict.py - Model management
classifier/app/routes/retrain.py
External services
- PostgreSQL
- Cloudflare R2
- Google sign-in
Other components
- User
Connections 24
- User → Pages and routes: uses
- Pages and routes → Authentication hook: authenticates through
- Pages and routes → Classifier hook: uploads and reviews
- Pages and routes → Admin hook: administers through
- Authentication hook → API services: requests auth
- Classifier hook → API services: requests predictions
- Admin hook → API services: requests administration
- API services → API application: calls API
- API application → Auth routes: mounts
- API application → Classifier routes: mounts
- API application → Admin routes: mounts
- API application → Species management: mounts
- API application → User management: mounts
- Authentication → Authentication data access: reads and creates users
- Authentication data access → PostgreSQL: queries
- Classification workflow → Prediction service: sends image for prediction
- Classification workflow → Cloudflare R2: stores image
- Classification workflow → Classification data access: creates and queries records
- Classification data access → PostgreSQL: queries
- Administration → Administration data access: reads and updates records
- Administration data access → PostgreSQL: queries
- Administration → Cloudflare R2: renames stored images
- Classification workflow → Model management: requests model operations
- Auth routes → Google sign-in: supports sign-in