How souptik-mu/leafdoc works
LeafDoc is a React/Spring Boot application with a separately runnable FastAPI ML service. The documented user journey is to use the frontend, authenticate through the backend, and use backend-backed features; however, the sampled frontend is still the Vite starter screen, so no frontend API calls are evidenced. The backend tree identifies authentication and ML components, while the README documents MySQL, email, and OTP capabilities. Backend implementation excerpts were not provided, and the ML prediction handler currently only reports uploaded-file metadata; uncertain wiring is therefore omitted.
Main entry points: AuthController.java Auth endpoints · UserRepository.java User repository · server.py FastAPI server · main.tsx React entry
Components 17
Web interface
- React entry
LeafDocFrontend/src/main.tsx - Application UI
LeafDocFrontend/src/App.tsx
Spring backend
- Auth endpoints
LeafDocBackend/src/main/java/com/example/leafdoc/controllers/AuthController.java - Auth service
LeafDocBackend/src/main/java/com/example/leafdoc/service/AuthService.java - Auth DTOs
LeafDocBackend/src/main/java/com/example/leafdoc/DTO - JWT security
LeafDocBackend/src/main/java/com/example/leafdoc/security - Security config
LeafDocBackend/src/main/java/com/example/leafdoc/confiurations/SecurityConfig.java - ML endpoints
LeafDocBackend/src/main/java/com/example/leafdoc/controllers/MlController.java - ML client logic
LeafDocBackend/src/main/java/com/example/leafdoc/service/MlService.java - Email and OTP
LeafDocBackend/src/main/java/com/example/leafdoc/service
ML service
- FastAPI server
ml-service/app/server.py - ML configuration
ml-service/app/config.py - Model module
ml-service/app/ml/model.py
Persistence and identity
- User entity
LeafDocBackend/src/main/java/com/example/leafdoc/entity/User.java - User repository
LeafDocBackend/src/main/java/com/example/leafdoc/repository/UserRepository.java - MySQL
Other components
- User
Connections 14
- User → React entry: opens
- React entry → Application UI: renders
- User → Auth endpoints: authenticates
- Auth endpoints → Auth service
- Auth endpoints → Auth DTOs: accepts and returns
- Auth service → User repository
- User repository → User entity: persists
- User repository → MySQL: reads and writes
- Security config → JWT security: configures
- User → ML endpoints: requests diagnosis
- ML endpoints → ML client logic
- ML client logic → FastAPI server: calls configured service
- User → FastAPI server: uploads image
- FastAPI server → ML configuration: reads settings