How karllasutan-star/abakascan works
ABAKASCAN is an abaca-image grading application with a FastAPI backend. Its principal workflow accepts an image, validates it, performs material recognition and grade prediction, and exposes classification functionality alongside account and history services. The backend also supports registration, email verification, login, password recovery, profiles, and administration. The tree contains native Flutter platform shells but no Dart application source, so the client workflow cannot be traced here; some route-to-service links are supported by the source index rather than full excerpts.
Main entry points: main.py FastAPI application · classifications.py Classification routes · auth.py Current-user auth · user.py User records
Components 19
API and routes
- FastAPI application
backend/app/main.py - Account routes
backend/app/routes/auth.py - Profile routes
backend/app/routes/profile.py - Classification routes
backend/app/routes/classifications.py - Admin routes
backend/app/routes/admin.py
Identity and access
- Token and OTP security
backend/app/core/security.py - Current-user auth
backend/app/core/auth.py - User records
backend/app/models/user.py - Verification email
backend/app/services/email_service.py
Image classification
- Image validation
backend/app/services/image_service.py - Material and grade inference
backend/app/services/inference_service.py - Classification history
backend/app/services/classification_service.py - Classification records
backend/app/models/classification.py
Persistence and operations
- Administration service
backend/app/services/admin_service.py - Expired-account cleanup
backend/app/services/account_cleanup_service.py - Database connection
backend/app/database/database.py
Other components
- App user
- PostgreSQL
- SMTP service
Connections 28
- App user → FastAPI application: uses API
- FastAPI application → Account routes: registers routes
backend/app/main.py - FastAPI application → Profile routes: registers routes
backend/app/main.py - FastAPI application → Classification routes: registers routes
backend/app/main.py - FastAPI application → Admin routes: registers routes
backend/app/main.py - FastAPI application → Database connection: creates tables
backend/app/main.py - FastAPI application → Expired-account cleanup: runs cleanup
backend/app/main.py - Account routes → User records: reads and writes
backend/app/routes/auth.py - Account routes → Token and OTP security: uses token and OTP
backend/app/routes/auth.py - Account routes → Verification email: sends email
backend/app/routes/auth.py - Verification email → SMTP service: sends messages
- Profile routes → Current-user auth: requires user
backend/app/routes/profile.py - Profile routes → User records: reads user
backend/app/routes/profile.py - Current-user auth → Token and OTP security: decodes token
backend/app/core/auth.py - Current-user auth → User records: loads user
backend/app/core/auth.py - Classification routes → Current-user auth: requires user
backend/app/routes/classifications.py - Classification routes → Image validation: validates image
backend/app/routes/classifications.py - Classification routes → Material and grade inference: requests prediction
backend/app/routes/classifications.py - Classification routes → Classification history: uses history service
backend/app/routes/classifications.py - Classification history → Image validation: uses image helper
backend/app/services/classification_service.py - Classification routes → Classification records: records results
- Admin routes → Current-user auth: requires user
backend/app/routes/admin.py - Admin routes → Administration service: calls service
backend/app/routes/admin.py - Administration service → User records: queries users
backend/app/services/admin_service.py - Administration service → Classification records: queries records
backend/app/services/admin_service.py - Expired-account cleanup → User records: cleans accounts
backend/app/services/account_cleanup_service.py - Database connection → PostgreSQL: connects to
backend/app/database/database.py - Database connection → PostgreSQL: uses settings
backend/app/database/database.py