{"id":20835559,"url":"https://github.com/johnandersen777/smartplanter","last_synced_at":"2025-06-30T06:36:08.056Z","repository":{"id":82523152,"uuid":"124815507","full_name":"johnandersen777/smartplanter","owner":"johnandersen777","description":"IoT Smart Planter","archived":false,"fork":false,"pushed_at":"2018-06-13T16:58:32.000Z","size":311,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T09:14:43.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://web.cecs.pdx.edu/~jsa3/smartplanter/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnandersen777.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":"2018-03-12T01:09:59.000Z","updated_at":"2020-03-15T09:46:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"1dfa499a-34ac-4211-a9de-3e09a9775676","html_url":"https://github.com/johnandersen777/smartplanter","commit_stats":null,"previous_names":["johnandersen777/smartplanter"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/johnandersen777/smartplanter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fsmartplanter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fsmartplanter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fsmartplanter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fsmartplanter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnandersen777","download_url":"https://codeload.github.com/johnandersen777/smartplanter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fsmartplanter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262724868,"owners_count":23354353,"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-11-18T00:25:51.441Z","updated_at":"2025-06-30T06:36:08.025Z","avatar_url":"https://github.com/johnandersen777.png","language":"JavaScript","readme":"# Smart Planter PWA Client\n\nIoT Smart Planter PWA Client\n\n## Dependencies\n\n`nodejs` and `npm` are required to run webpack to build the JavaScript client in\nthis project. If you do not have `node` / `npm` installed you can install it\nwith the following script.\n\n```console\ncurl -L https://gist.github.com/pdxjohnny/75dee455b7ddb7334b88/raw/9828b128a6d927e9457cd0d92c8b51660a79ffbe/node-user.sh | bash \u0026\u0026 source ${HOME}/.bashrc\n```\n\n## Setup\n\n```console\ncd ~/public_html/\ngit clone git@github.com:pdxjohnny/smartplanter smartplanterdev\ncd smartplanterdev\n./scripts/setup.sh\n```\n\nThe smartplanter app is now accessible at\n`echo https://web.cecs.pdx.edu/~$USER/smartplanter/dist/`\n\n## VAPID Keys for Push Notifications\n\nThese are currently committed to the repo. To re-generate run the create-vapid\nscript.\n\nKeys are only committed to the repo now because storage of them in a secure way\nwould be complex to manage. Under no circumstances should they become publicly\navailable. If this application is to become production ready they must be stored\nin a secure location and deployment should account for their retrieval at time\nof application stand up.\n\n```console\n./scripts/create-vapid\n```\n\n## Favicons\n\nGenerated with [RealFaviconGenerator](https://realfavicongenerator.net/)\n\n## Force HTTPS with htaccess\n\nPut this htaccess file in your public_html folder.\n\n```console\ncat \u003e ~/public_html/.htaccess \u003c\u003c'EOF'\nRewriteEngine On\nRewriteCond %{HTTPS} !=on\nRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\nEOF\n```\n\n## API\n\n### Create User\n\nEndpoint returns a JSON with user ID and a JWT which should be used in the\nAuthorization header.\n\n```console\ncurl 'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/createuser/?password=test'\n# export TOKEN=`result of token in the above JSON reponse`\n```\n\n### Login\n\n```console\ncurl 'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/login/?id=42\u0026password=test'\n# export TOKEN=`result of token in the above JSON reponse`\n```\n\n### Create Resource\n\n```console\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  -d 'Hello World'\n  'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/sync/'\n```\n\n### Update Resource\n\n```console\ncurl -X PUT \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -d 'Hello World'\n  'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/sync/?resource=\u003ccreated ID\u003e'\n```\n\n### Get Resource\n\n```console\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/sync/?resource=\u003ccreated ID\u003e'\n```\n\nYou should see `Hello World`\n\n### Create Planter\n\n```console\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/createplanter/'\n# export PTOKEN=`result of token in the above JSON reponse`\n```\n\n### Update Planter\n\n```console\ncurl -X PUT \\\n  -H \"Authorization: Bearer $PTOKEN\" \\\n  -d 'Hello World'\n  'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/sync/'\n```\n\n### Get Planter\n\n```console\ncurl -H \"Authorization: Bearer $PTOKEN\" \\\n  'https://web.cecs.pdx.edu/~jsa3/smartplanter/api/sync/'\n```\n\n## TODO\n\n- Push notifications (WebPush incompatibility with php 7.0 only compatible with\n  7.1 and above, fork and fix)\n- Offline compatibility (All libs use fetch and the mixed content hack doesn't\n  work with that)\n- UX Improvements, notification of planter received changes\n- Increase bcrypt cost to something secure\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnandersen777%2Fsmartplanter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnandersen777%2Fsmartplanter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnandersen777%2Fsmartplanter/lists"}