{"id":13554509,"url":"https://github.com/KrauseFx/FxLifeSheet","last_synced_at":"2025-04-03T07:31:40.412Z","repository":{"id":34526049,"uuid":"178828146","full_name":"KrauseFx/FxLifeSheet","owner":"KrauseFx","description":"Tracking the key metrics of my life","archived":false,"fork":false,"pushed_at":"2024-01-13T17:25:43.000Z","size":3127,"stargazers_count":1106,"open_issues_count":26,"forks_count":73,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-27T06:38:29.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://howisFelix.today?","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KrauseFx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-04-01T09:19:29.000Z","updated_at":"2025-03-24T00:55:53.000Z","dependencies_parsed_at":"2024-01-13T18:53:53.524Z","dependency_job_id":"d937ab58-7c66-46b0-8fb0-2c2fc6815091","html_url":"https://github.com/KrauseFx/FxLifeSheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FFxLifeSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FFxLifeSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FFxLifeSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FFxLifeSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KrauseFx","download_url":"https://codeload.github.com/KrauseFx/FxLifeSheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246956490,"owners_count":20860447,"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":[],"created_at":"2024-08-01T12:02:49.280Z","updated_at":"2025-04-03T07:31:39.894Z","avatar_url":"https://github.com/KrauseFx.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# FxLifeSheet\n\n[![Twitter: @KrauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)\n\n---\n\n### See the outcome on [howisFelix.today](https://howisFelix.today/)\n\n\u003cimg src=\"https://raw.githubusercontent.com/KrauseFx/howisFelix.today/master/screenshots/Desktop-1.png\" /\u003e\n\n\u003ch3 align=center\u003eSee the resulting work on \u003ca href=\"https://howisFelix.today/\"\u003ehowisFelix.today\u003c/a\u003e\n\u003cp /\u003e\n \n  \n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/KrauseFx/howisFelix.today/master/screenshots/iPhone-1.png\" /\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/KrauseFx/howisFelix.today/master/screenshots/iPhone-2.png\" /\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/KrauseFx/howisFelix.today/master/screenshots/iPhone-3.png\" /\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n \n---\n\n\u003cimg src=\"https://raw.githubusercontent.com/KrauseFx/howisFelix.today/master/screenshots/Overview-Portrait-1.png\" /\u003e\n\n---\n\n## Goals\n\n**To answer questions about my life, like**\n\n- How does living in different cities affect other factors like fitness, productivity and happiness?\n- How does sleep affect my day, my fitness level, and happiness?\n- How does the weather, and the different seasons affect my life?\n- Are there any trends over the last few years?\n- How does computer time, work and hours in meetings affect my personal life?\n\n**Key decisions for this project:**\n\n- Use a single database, owned and hosted by me, with all the data I've collected over the years\n- Be able to [easily add and remove questions](https://github.com/KrauseFx/FxLifeSheet/blob/master/lifesheet.json) on the fly, as I learn what's beneficial to track\n- Full control of how the data is visualized\n- Works well for frequent flyers with mixed time zones\n- 100% fully open source, MIT licensed and self-hosted\n\n---\n\n### This repo contains\n\n- The [Telegram bot](https://github.com/KrauseFx/FxLifeSheet/blob/master/worker.ts) for entering data manually\n- The [data visualization](https://github.com/KrauseFx/FxLifeSheet/tree/master/visual_playground), check out the results on [howisFelix.today](https://howisFelix.today)\n- The [database info](https://github.com/KrauseFx/FxLifeSheet/blob/master/db/create_tables.sql)\n\n---\n\n### Questions to answer\n\nThere are many questions that can be answered using this data, here are some main ones I want to look into over the next few months\n\n#### Mood/Happines related:\n\n- How does the city I'm in influence my level of happiness?\n- How does the weather/climate influence my mood\n- How does travel affect my mood?\n- How do certain macro nutrition goals affect my mood?\n- What amount of hours of sleep have the best influence on mood?\n\n#### Fitness related\n\n- How do certain macro goals influence my lean body mass and fat levels?\n- How does my daily kcal intake affect my social life?\n- How does alcohol affect my training and fitness progress?\n- Do more daily steps influence\n  - my mood\n  - the amount of audio books I'm reading\n  - feeling connected with family \u0026 friends as often calling them\n- What are the areas in life that suffer while cutting (kcal deficit):\n  - mood\n  - stress\n  - productivity\n  - energy\n\n#### Travel\n\n- What are the areas in life that suffer when I travel? Investigate:\n  - fitness progress\n  - productivity\n  - stress\n  - health\n  - sleep\n  - feeling connected with friends\n\n#### Productivity\n\n- How many hours did I spend on my phone and laptop over the months?\n- Do I stick to my yearly book goals and how do other factors influence how much I'm reading?\n- Am I more productive when I set the goals for the day the night before?\n\n## Implementation\n\n**Assumptions**\n\n- The user is in random time zones at random times and switches often, therefore the bot can't know about your daily schedule. This puts a lot of focus on averages, as it doesn't matter if a value was entered at 11pm that day, or 8am the next one, the numbers will even out, as only daily, weekly and monthly averages are considered when rendering graphs.\n\nThis repo contains the Telegram bot that is responsible for collecting the data.\n\nThere are 2 ways to input data: by the user telling the bot to ask for all the values, and by a regular interval of the bot asking you (similar to the deprecated [mood bot](https://github.com/krausefx/mood))\n\n### Configuration\n\n[`lifesheet.json`](./lifesheet.json)\n\nAvailable values for `schedule`:\n\n- `eightTimesADay`\n- `daily`\n- `weekly`\n- `manual`\n\n\n### User initiates data inputs \n\n#### Mood\n\nUsing `fourTimesADay`, this will replace the mood bot\n\n- How are you feeling today?\n\n#### Morning\n\n`/awake`\n\nThis will trigger the morning questions, like:\n\n- Sleep duration\n- Sleep quality\n- Body weight\n\n#### Evening\n\n`/asleep`\n\nThis will trigger the end-of-day questions like\n\n- Fitness related:\n  - Alcohol intake\n  - Macro adherence\n  - Hunger issues?\n  - Fatigu/Lethargy?\n  - Feel stressed?\n  - Caffeine intake?\n  - How healthy do you feel today?\n  - Number of steps\n- Productivity related\n  - Did I solve actual programming/technical problems?\n- Social\n  - Felt like enough time by myself?\n  - Felt like enough in control of my own time and schedule?\n  - Felt like enough socializing?\n  - Felt like enough going out, bars, restaurants, dancing etc.\n- Personal growth\n  - Learned new skills or things?\n  - Went out of my comfort zone?\n  - Number of minutes of Audible\n- Other\n  - Meditated\n  - Note: what was the main thing I did today?\n  - Boolean: Did I set goals for the next day?\n  - Do you feel excited about what's ahead in the future?\n\n#### Week\n\n`/week`\n\nThis will trigger questions that take longer to reply, so they're only done weekly\n\n- Fitness related\n  - Current macros\n    - g of Carbs\n    - g of Protein\n    - g of Fat\n  - Body measurements\n  - Overall training adherence\n  - Note: Comments on fitness\n- Productivity\n  - Overall happiness with life progress of the week, do I go into the right direction?\n  - Number of open Trello tasks (from [howisFelix.today](https://howisFelix.today))\n  - Number of emails in Inbox less than 5?\n  - Average daily hours on computer\n  - Average daily iOS screen time (minus MyFitnessPal and Strong app)\n- Social\n  - Felt like spent enough time with family?\n  - Had deep conversations with close friends?\n- Other\n  - Did I travel, this includes every city more than 1h away, this is relevant for both fitness and productivity\n  - Note of all locations I was at (cities)\n  - Got out of my comfort zone \u0026 experienced/tried new things?\n  - Do you feel like having to travel somewhere?\n  - Do you feel like you're missing out on things?\n  - Played computer games by myself\n  - Played computer games with friends or family?\n\n## Telegram\n\n### Insert for available commands\n\n```\nskip - Skip a question that was asked\nreport - Generate one page report\ntrack - Track a specific value only\nmood - Track your mood\nawake - First thing in the morning\nasleep - Right before going to sleep\nweek - Once per week metrics\nskip_all - Remove all queued questions\n```\n\n## Development\n\n### Running locally\n\n```\nnpm run dev\n```\n\n\n### Debugging\n\nAfter using `npm run dev`, open [chrome://inspect](chrome://inspect) to use the Chrome Dev Tools\n\n### Setup\n\n### Environment variables\n\n`.keys` file or however you manage your secret env variables:\n\n```\nexport TELEGRAM_BOT_TOKEN=\"\"\nexport TELEGRAM_USER_ID=\"\"\nexport TELEGRAM_CHAT_ID=\"\"\n\nexport DATABASE_URL=\"\"\n\nexport LIFESHEET_JSON_URL=\"\"\n```\n\n### Scheduler\n\nNot using Heroku any more, in railway.app, just add this as its own service\n\n```\nnpm run scheduler\n```\n\n### Postgres\n\nCreate a new Postgres database, and run the SQL queries defined in [db/create_tables.sql](db/create_tables.sql)\n\n\u003cimg src=\"screenshots/Database1.png\" /\u003e\n\u003cimg src=\"screenshots/Database2.png\" /\u003e\n\n### Data Visualization\n\nTo analyze the data, check out the `visual_playground` subfolder https://github.com/KrauseFx/FxLifeSheet/tree/master/visual_playground\n\n## Origins\n\nThe original implementation abused Google Sheets as a database, and I used Google Data Studio to visualize the data. Both implementations ended up not working pretty quickly.\n\n\u003cimg src=\"screenshots/Dashboard1.png\" /\u003e\n\u003cimg src=\"screenshots/Dashboard2.png\" /\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKrauseFx%2FFxLifeSheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKrauseFx%2FFxLifeSheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKrauseFx%2FFxLifeSheet/lists"}