Currently, the /analyze endpoint handles both file upload and BirdNET audio analysis in a single step. This issue proposes separating those concerns into two endpoints: one for file upload and one for analysis.
Motivation
- Improve modularity and separation of concerns
- Support future enhancements like:
- Queuing analysis jobs for background processing
- Make the system more scalable, testable, and maintainable
Proposed Changes
Example Flow
POST /upload → returns { "file_id": "abc123.wav" }
POST /analyze with payload { "file_id": "abc123.wav" } → returns analysis results
Benefits
- Enables analysis reuse without re-uploading
- Makes it easier to support asynchronous/background tasks
- Future-proof design for large-scale or multi-user systems
- Cleaner code and route logic
Currently, the
/analyzeendpoint handles both file upload and BirdNET audio analysis in a single step. This issue proposes separating those concerns into two endpoints: one for file upload and one for analysis.Motivation
Proposed Changes
Create a new
POST /uploadendpoint:.wavor.zip)file_idor file path for later referenceUpdate
POST /analyzeendpoint:file_idor file pathExample Flow
POST /upload→ returns{ "file_id": "abc123.wav" }POST /analyzewith payload{ "file_id": "abc123.wav" }→ returns analysis resultsBenefits