How muhafiq/wise-api-services works
WISE is a Flask API for wound identification and related user services. Its principal workflow exposes a prediction endpoint alongside account access, saved diagnosis history, and nearby-hospital lookup. The sampled code shows application setup, registration/login/logout, profile and password-reset behavior, and hospital lookup logic; prediction and history resource internals were not sampled, so their internal wiring is intentionally omitted. The README also confirms a TensorFlow model and Google Cloud Storage configuration, but does not establish which request handlers use them.
Main entry points: __init__.py API routes · user.py User endpoints · app.py Flask app · auth.py Auth endpoints
Components 24
API application
- Flask app
app/app.py - API routes
app/api/__init__.py - Error handlers
app/api/error_handler.py
Identity and profiles
- Auth endpoints
app/api/resources/auth.py - User endpoints
app/api/resources/user.py - User validation
app/api/schemas/users.py - User data
app/models/users.py - Revoked tokens
app/models/token_blacklist.py - Reset tokens
app/utils/token.py - Reset email
app/services/mailer.py
Wound records
- Wound prediction
app/api/resources/predict.py - Diagnosis history
app/api/resources/history.py - Medical records
app/models/medical_records.py - Injury classes
app/models/injury_classes.py - Record validation
app/api/schemas/medical_records.py - Class validation
app/api/schemas/injury_classes.py
Care discovery
- Hospital endpoint
app/api/resources/hospital.py - Hospital lookup
app/utils/hospital.py
Shared infrastructure
- SQL database
- Flask extensions
app/extentions.py - Cloud Storage
- TensorFlow model
Other components
- API client
- Overpass API
Connections 23
- API client → Flask app: sends requests
- Flask app → API routes: registers routes
- Flask app → Flask extensions: initializes
- Flask app → Error handlers: registers handlers
- API routes → Auth endpoints: dispatches auth
- API routes → User endpoints: dispatches users
- API routes → Wound prediction: dispatches prediction
- API routes → Diagnosis history: dispatches history
- API routes → Hospital endpoint: dispatches lookup
- Auth endpoints → User validation: validates input
- User endpoints → User validation: validates input
- User validation → User data: checks uniqueness
- Auth endpoints → User data: reads and creates
- Auth endpoints → Revoked tokens: records revocation
- API routes → Revoked tokens: checks revocation
- User endpoints → User data: reads and updates
- User endpoints → Reset tokens: generates and validates
- User endpoints → Reset email: sends reset email
- Flask extensions → SQL database: configures ORM
- Flask extensions → TensorFlow model: loads model
- Flask extensions → Cloud Storage: creates client
- Hospital lookup → Overpass API: queries hospitals
- Medical records → Injury classes: references class