-
Notifications
You must be signed in to change notification settings - Fork 31
added the the flask server code and the updated flutter code #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,21 +4,21 @@ class ApiConstants { | |||||||||||||||||||||||||||||
| // Gemini API configuration (new primary API) | ||||||||||||||||||||||||||||||
| static const String geminiApiEndpoint = | ||||||||||||||||||||||||||||||
| 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| static final String geminiApiKey = dotenv.env['GEMINI_API_KEY']!; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // New: Centralized endpoint for chat functionalities | ||||||||||||||||||||||||||||||
| static const String chatApiEndpoint = | ||||||||||||||||||||||||||||||
| 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // API endpoints for squat analysis server | ||||||||||||||||||||||||||||||
| static final String squatServerUpload = | ||||||||||||||||||||||||||||||
| '${dotenv.env['NGROK_FORWARDING_URL']!}/upload'; | ||||||||||||||||||||||||||||||
| static final String squatServerResult = | ||||||||||||||||||||||||||||||
| '${dotenv.env['NGROK_FORWARDING_URL']!}/result'; | ||||||||||||||||||||||||||||||
| // WORKING: Your exercise detection server (local ip v4 address used) | ||||||||||||||||||||||||||||||
| static const String exerciseServerUpload = 'http://127.0.0.0:5000/upload'; | ||||||||||||||||||||||||||||||
| static const String exerciseServerResult = 'http://127.0.0.0:5000/result'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| static const String pushupServerUpload = exerciseServerUpload; | ||||||||||||||||||||||||||||||
| static const String pushupServerResult = exerciseServerResult; | ||||||||||||||||||||||||||||||
| static const String squatServerUpload = exerciseServerUpload; | ||||||||||||||||||||||||||||||
| static const String squatServerResult = exerciseServerResult; | ||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocking: invalid loopback IP (127.0.0.0) will fail requests. Use 127.0.0.1 (or env-provided base URL). Current constants will never reach the local Flask server. Apply: - static const String exerciseServerUpload = 'http://127.0.0.0:5000/upload';
- static const String exerciseServerResult = 'http://127.0.0.0:5000/result';
+ static const String exerciseServerUpload = 'http://127.0.0.1:5000/upload';
+ static const String exerciseServerResult = 'http://127.0.0.1:5000/result';Recommended: read a base URL from .env (EXERCISE_SERVER_BASE_URL) and derive all four endpoints. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // API headers for Gemini | ||||||||||||||||||||||||||||||
| static Map<String, String> get geminiHeaders => { | ||||||||||||||||||||||||||||||
| 'Content-Type': 'application/json', | ||||||||||||||||||||||||||||||
| 'x-goog-api-key': geminiApiKey, | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
| static Map<String, String> get geminiHeaders => {'Content-Type': 'application/json', 'x-goog-api-key': geminiApiKey}; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Unify endpoint and harden API key access.
Also applies to: 22-24
🤖 Prompt for AI Agents