Skip to content

Repository files navigation

LifeLens

Flutter Android app and FastAPI backend for the SGP 7 LifeLens project.

Mir's scope

  • 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.

Flutter Run

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 run

The 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.

Backend Run

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 --reload

Open API docs:

http://localhost:8000/docs

Local Environment

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.joblib

Do not push .env.local.

Android Permissions

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

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=....

Local App Data

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.

Dashboard Features

  • 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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages