{"id":16695088,"url":"https://github.com/davidmyersdev/mood","last_synced_at":"2025-04-05T03:43:06.847Z","repository":{"id":39693808,"uuid":"218679541","full_name":"davidmyersdev/mood","owner":"davidmyersdev","description":"Keeping track of emotions over time for better mental health awareness","archived":false,"fork":false,"pushed_at":"2023-01-19T15:37:02.000Z","size":219,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T23:50:01.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/davidmyersdev.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}},"created_at":"2019-10-31T03:46:06.000Z","updated_at":"2021-06-03T15:09:18.000Z","dependencies_parsed_at":"2023-02-11T07:16:06.729Z","dependency_job_id":null,"html_url":"https://github.com/davidmyersdev/mood","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/davidmyersdev%2Fmood","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fmood/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fmood/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmyersdev%2Fmood/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidmyersdev","download_url":"https://codeload.github.com/davidmyersdev/mood/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284918,"owners_count":20913691,"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-10-12T17:05:15.173Z","updated_at":"2025-04-05T03:43:06.829Z","avatar_url":"https://github.com/davidmyersdev.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mood\n\nKeeping track of emotions over time for better mental health awareness.\n\n## development\n\nClone the repo to your machine, and run the following commands.\n\n```shell\n# build docker containers / start app\ndocker-compose up -d\n\n# create and migrate database\ndocker-compose exec web bin/rails db:create db:migrate\n\n# generate credentials (see secrets below)\ndocker-compose exec web bin/rails g credentials\n```\n\n### secrets\n\n#### with `config/credentials.yml.enc`\n\nThe last command above will generate `config/master.key` and `config/credentials.yml.enc`. The credentials file is encrypted, but you can view the contents with a rails command.\n\n```shell\n# dump the decrypted contents of config/credentials.yml.enc to the terminal\ndocker-compose exec web bin/rails credentials:show\n```\n\nThe output should look similar to this.\n\n```yaml\nsecret_key_base: arandomstring\nvapid_private_key: yourprivatekey\nvapid_public_key: yourpublickey\nvapid_subject: https://yourdomain.example\n```\n\nThese secrets are all necessary to run the app. The `secret_key_base` is used by Rails, but the VAPID keys are necessary to send web push notifications. This process will generate a new set of VAPID keys for you. For more information about VAPID, [check out the spec](https://tools.ietf.org/html/rfc8292).\n\n#### with `.env` (used by docker-compose) or env vars\n\n```shell\nALLOWED_ORIGINS=yourdomain.example\nAPP_URL=https://yourdomain.example\nRACK_ENV=development\nRAILS_ENV=development\nRAILS_TIME_ZONE=Eastern Time (US \u0026 Canada)\nSECRET_KEY_BASE=arandomstring\nSENTRY_CLIENT_DSN=https://yoursentryclientdsn.example\nSENTRY_DSN=https://yoursentryserverdsn.example\nVAPID_PRIVATE_KEY=yourprivatekey\nVAPID_PUBLIC_KEY=yourpublickey\nVAPID_SUBJECT=https://yourdomain.example\n```\n\n### testing\n\n#### Insomnia REST Client\n\nThere is a workspace export file in this repo at `insomnia.json`. To update this file, create a manual export of the workspace with your changes at `insomnia-export.json`, and run the following command.\n\n```bash\ncat insomnia-export.json | jq --sort-keys \u003e insomnia.json\n```\n\nInsomnia exports are minified by default, and there is no guarantee on key order. This will make the diffs easier to reason about.\n\n## hosting\n\nDo the following to host this app.\n\n### origins\n\nThis app uses CORS restriction, so you need to specify which domains are allowed to contact this API.\n\n```shell\n# this env var must be available in the rails app\nALLOWED_ORIGINS='app1.example,app2.example'\n```\n\nAs documented above, you can specify multiple domains with a `,` delimiter.\n\n### secrets\n\nYou can generate a new credentials file for production by using the same generator from the development section above. This will generate a `config/master.key` file. If you would prefer to use an environment variable for the master key, you can configure it like this.\n\n```shell\n# used to decrypt your credentials file\nRAILS_MASTER_KEY=arandomstring\n```\n\n#### with env vars\n\nYou can forgo the credentials file entirely by using environment variables.\n\n```shell\nALLOWED_ORIGINS=yourdomain.example\nAPP_URL=https://yourdomain.example\nDATABASE_URL=postgres://username:password@yourdatabasehost.example:5432\nRACK_ENV=production\nRAILS_ENV=production\nRAILS_TIME_ZONE=Eastern Time (US \u0026 Canada)\nSECRET_KEY_BASE=arandomstring\nSENTRY_CLIENT_DSN=https://yoursentryclientdsn.example\nSENTRY_DSN=https://yoursentryserverdsn.example\nVAPID_PRIVATE_KEY=yourprivatekey\nVAPID_PUBLIC_KEY=yourpublickey\nVAPID_SUBJECT=https://yourdomain.example\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmyersdev%2Fmood","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidmyersdev%2Fmood","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmyersdev%2Fmood/lists"}