{"id":15683640,"url":"https://github.com/galeone/fitsleepinsights","last_synced_at":"2025-05-07T14:06:22.595Z","repository":{"id":231854583,"uuid":"559662427","full_name":"galeone/fitsleepinsights","owner":"galeone","description":"Custom dashboard for Fitbit users. RAG support (gemini-based) for chatting with your data and getting insights about your fitness activities and sleep data","archived":false,"fork":false,"pushed_at":"2025-03-15T17:04:11.000Z","size":844,"stargazers_count":21,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T14:06:09.140Z","etag":null,"topics":["gemini","go","golang","rag","vertex-ai"],"latest_commit_sha":null,"homepage":"https://fitsleepinsights.app/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galeone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-30T19:50:25.000Z","updated_at":"2025-03-15T23:21:34.000Z","dependencies_parsed_at":"2024-04-17T19:47:24.984Z","dependency_job_id":null,"html_url":"https://github.com/galeone/fitsleepinsights","commit_stats":null,"previous_names":["galeone/fitsleepinsights"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Ffitsleepinsights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Ffitsleepinsights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Ffitsleepinsights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Ffitsleepinsights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galeone","download_url":"https://codeload.github.com/galeone/fitsleepinsights/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252892503,"owners_count":21820648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gemini","go","golang","rag","vertex-ai"],"created_at":"2024-10-03T17:07:58.020Z","updated_at":"2025-05-07T14:06:22.543Z","avatar_url":"https://github.com/galeone.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fit Sleep Insights\n\nWeb application that connects with your [Fitbit](https://www.fitbit.com/) account and tries to do explainable predictions of your sleep quality - using all the available data.\n\n- What makes you sleep well?\n- What are the activities you should perform and when?\n- What you should avoid?\n- What increases your deep sleep?\n\nThese are some of the question this project tries to answer.\n\nThe goal is to understand what behaviors/activities are good/bad for *your* sleep. People are different, and what makes a person sleep well could make some one else sleep a nightmare. For this reason, the prediction are made *per user* - no data is aggregated. \n\n## Technicalities\n\nThe application is made of different parts\n\n- A Fitbit API client. Folder `fitbit`\n- A storage. The storage requires a dedicated setup (we use TimescaleDB/PostgreSQL). Folder `storage`.\n- The predictive models\n- The web application\n\nThe web application, together with the `client` and the `database` asks the user permission on the Fitbit account.\n\n### Docker-Compose\n\nYou can chose to configure the application via the `docker-compose.yaml` file, and executed it trough `docker compose` - or you can configure (without depending on Docker) the various components of the application locally.\n\nBelow you can find the steps to setup the application locally.\n\n### Database setup\n\n1. Install PostgreSQL\n\n2. Create the user and the database. Note: on MacoOS skip the `sudo -i -u postgres ` part of the commands.\n\n```bash\nsudo -i -u postgres createuser -U postgres fitsleepinsights\nsudo -i -u postgres createdb -U postgres fitsleepinsights fitsleepinsights\n```\n\n3. Grant the create privilege (required from PostgreSQL 15+), and make it superuser (required for the vector extension):\n\n```\npsql -U postgres -d fitsleepinsights -c \"GRANT USAGE, CREATE ON SCHEMA public TO fitsleepinsights;\"\npsql -U postgres -d fitsleepinsights -c \"ALTER USER fitsleepinsights WITH SUPERUSER;\"\n```\n\n4. Install pgvector: https://github.com/pgvector/pgvector\n\nDone. On startup the application creates the schema if not present.\n\n### Configuration\n\nPlace a `.env` file in the runtime path. This is the content:\n\n```env\n# Register the application\n# https://dev.fitbit.com/build/reference/web-api/developer-guide/getting-started/\n# for obtainign these values.\nFITBIT_CLIENT_ID=\"\"\nFITBIT_CLIENT_SECRET=\"\"\nFITBIT_REDIRECT_URL=\"\"\n\n# Use the same values used in the Database setup section\nDB_HOST=localhost\nDB_PORT=5432\nDB_USER=fitsleepinsights\nDB_PASS=fitsleepinsights\nDB_NAME=fitsleepinsights\n\n\n# Web application settings\nDOMAIN=fitsleepinsights.app\nPORT=8989\n\n# Vertex AI\nVAI_LOCATION=\"europe-west6\"\nVAI_PROJECT_ID=\"project id\"\nVAI_SERVICE_ACCOUNT_KEY=\"full path\"\n```\n\n\n### Running\n\nYup, running is important. There are 2 ways of running the application, depending on how you configured it.\n\nIf you installed the database and configured the `.env` file you need simply to run it.\n\n```bash\ngo run main.go\n```\n\nIf you configured the `docker-compose.yaml` file, than you can:\n\n```bash\n./run.sh up\n# and to stop it\n./run.sh down\n```\n\nOr you can install it with `go install` and execute `fitsleepinsights`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaleone%2Ffitsleepinsights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaleone%2Ffitsleepinsights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaleone%2Ffitsleepinsights/lists"}