{"id":29196622,"url":"https://github.com/flancer32/pwa_bwl","last_synced_at":"2025-09-09T12:46:58.091Z","repository":{"id":54388074,"uuid":"340967443","full_name":"flancer32/pwa_bwl","owner":"flancer32","description":"Bruderschaft Weight Loss","archived":false,"fork":false,"pushed_at":"2023-03-31T09:45:57.000Z","size":1438,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-21T13:53:00.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flancer32.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}},"created_at":"2021-02-21T18:00:18.000Z","updated_at":"2024-04-21T13:53:00.817Z","dependencies_parsed_at":"2022-08-13T14:10:36.857Z","dependency_job_id":null,"html_url":"https://github.com/flancer32/pwa_bwl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flancer32/pwa_bwl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fpwa_bwl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fpwa_bwl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fpwa_bwl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fpwa_bwl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flancer32","download_url":"https://codeload.github.com/flancer32/pwa_bwl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fpwa_bwl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263083718,"owners_count":23411165,"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":"2025-07-02T06:07:46.961Z","updated_at":"2025-07-02T06:07:55.012Z","avatar_url":"https://github.com/flancer32.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @flancer32/pwa_bwl\n\n\"_Bruderschaft Weight Loss_\" is the Progressive Web Application (PWA) to monitor weight changes in a group with a friends.\n\n* Pilot version: https://bwl.pilot.teqfw.com/ - reset automatically on every commit to `main`;\n* Live version: https://bwl.wiredgeese.com/ - updated manually, you need invitation to sign up (there is no username-password sign-in in the app, one-time link is sent to user email for sign-in).\n\n## Setup Application for Development\n\n```shell\n$ git clone git@github.com:flancer32/pwa_bwl.git\n$ cd pwa_bwl\n$ bash ./bin/deploy/dev.sh\n```\n\nLook up for dependencies sources in `./own_modules/`.\n\n## Configuration\n\n```shell\n$ cd ./cfg\n$ cp init.json local.json\n$ nano local.json\n...\n```\n\n### Configure DB\n\nUse `mysql2` or `pg` client to connect to RDBMS:\n```json\n{\n  \"db\": {\n    \"main\": {\n      \"client\": \"mysql2|pg\",\n      \"connection\": {\n        \"host\": \"127.0.0.1\",\n        \"user\": \"...\",\n        \"password\": \"...\",\n        \"database\": \"...\"\n      }\n    }\n  }\n}\n```\n\n### Configure Network\n\nNodeJS `http2` server will use `server.port` and `web.urlBase` for the work:\n```json\n{\n  \"server\": {\n    \"port\": 3000\n  },\n  \"web\": {\n    \"urlBase\": \"project.com\"\n  }\n}\n```\n\n### Configure Proxy Server\n\nI use Apache Web server to secure HTTP requests/responses with TLS and redirect it to/from NodeJS `http2` server:\n\n```apacheconf\n\u003cVirtualHost *:80\u003e\n    ServerName project.com\n\n    LogLevel warn\n    ErrorLog  /var/log/apache2/bwl_error.log\n    CustomLog /var/log/apache2/bwl_access.log combined\n\n    # Redirect all to HTTPS\n    RewriteEngine on\n    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]\n\u003c/VirtualHost\u003e\n\n\u003cVirtualHost *:443\u003e\n    ServerName project.com\n\n    LogLevel warn\n    ErrorLog  /var/log/apache2/error.log\n    CustomLog /var/log/apache2/access.log combined\n\n    SSLCertificateFile /etc/letsencrypt/live/project.com/fullchain.pem\n    SSLCertificateKeyFile /etc/letsencrypt/live/project.com/privkey.pem\n    Include /etc/letsencrypt/options-ssl-apache.conf\n\n    # Redirect all requests to HTTP2 server.\n    RewriteEngine  on\n    RewriteRule    \"^/(.*)$\"  \"h2c://localhost:3000/$1\"  [P]\n\n\u003c/VirtualHost\u003e\n```\n\nUse [letsencrypt.org](https://letsencrypt.org/) to issue TLS certificate for free (you need real domain name like `bwl.your-domain.com`). This is simple config for your Apache for this case:\n\n```apacheconf\n\u003cVirtualHost *:80\u003e\n    ServerName bwl.your-domain.com\n\n    LogLevel warn\n    ErrorLog  /var/log/apache2/error.log\n    CustomLog /var/log/apache2/access.log combined\n\n    DocumentRoot /var/www/html\n    \u003cDirectory /var/www/html/\u003e\n        AllowOverride All\n        Require all granted\n    \u003c/Directory\u003e\n\u003c/VirtualHost\u003e\n```\n\n\n# Run Application\n\n\n## Recreate Database\n\nAll data will be lost:\n```shell\n$ npm run db-reset\n```\n\nData will be backed up before and restored after:\n```shell\n$ npm run db-upgrade\n```\n\n## Start/Stop Application\n\n```shell\n$ npm run start\n$ npm run stop\n```\n\n### Get All Available Commands\n\n```shell\n$ node ./bin/tequila.mjs --help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflancer32%2Fpwa_bwl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflancer32%2Fpwa_bwl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflancer32%2Fpwa_bwl/lists"}