Flutter Android app and FastAPI backend for the SGP 7 LifeLens project.
- Build the Android app UI.
- Add manual entry screens for expenses, calendar/tasks, sleep, and screen time.
- Show dashboard scores, trends, and recommendations.
- Connect the Flutter app to Mark's FastAPI backend.
- Add local demo login/signup.
- Add Health Connect and screen-time integrations for Android.
For Samsung A15 USB testing, forward the backend port once after connecting the
phone. This lets the app use http://127.0.0.1:8000 instead of changing the
backend URL whenever the laptop IP changes.
cd C:\7thsem\lifelens_mobile
flutter pub get
adb reverse tcp:8000 tcp:8000
flutter runThe app currently calls the backend at:
http://127.0.0.1:8000
If you are not using USB debugging, set the backend URL from the Profile screen
to your laptop's Wi-Fi IP, for example http://172.20.10.3:8000.
Create a backend virtual environment:
cd C:\7thsem\lifelens_mobile\backend
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reloadOpen API docs:
http://localhost:8000/docs
The backend reads .env.local first, then .env.
Use .env.local for real credentials:
DATABASE_URL=postgresql://postgres:YOUR_PASSWORD@db.cmfmdusouqphyhnnqsyq.supabase.co:5432/postgres?sslmode=require
BURNOUT_MODEL_PATH=app/ml/artifacts/burnout_model.joblib
OVERSPEND_MODEL_PATH=app/ml/artifacts/overspend_model.joblibDo not push .env.local.
Health Connect:
- Steps
- Sleep
Screen time:
- Total screen time
- Most used apps
For screen time, open the app's Usage Access Settings button and allow LifeLens.
Google Sign-In is supported through the secure backend token flow. Complete the
one-time Cloud Console and Render configuration in
docs/11_Google_Sign_In_Setup.md, then run
the app with --dart-define=GOOGLE_WEB_CLIENT_ID=....
The Flutter app now uses SQLite through sqflite.
Local tables store:
- users
- expenses
- planner tasks
- health records
- most-used apps
- score snapshots
- backend URL settings
This keeps the app usable even before backend sync succeeds.
- Backend sync with local fallback
- Productivity and spending trend charts
- Expense category breakdown
- Sleep and screen-time trend charts
- Local notifications for high stress, overspending, high screen time, and low sleep