{"id":15067287,"url":"https://github.com/tobymurray/web-app-db","last_synced_at":"2026-02-16T04:35:57.652Z","repository":{"id":78725420,"uuid":"79067980","full_name":"tobymurray/web-app-db","owner":"tobymurray","description":"Basic database structure for web app development","archived":false,"fork":false,"pushed_at":"2018-03-18T21:55:27.000Z","size":30,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T05:47:16.745Z","etag":null,"topics":["database","nodejs","npm","postgresql","webapp"],"latest_commit_sha":null,"homepage":null,"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/tobymurray.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":"2017-01-16T00:03:57.000Z","updated_at":"2021-03-17T01:39:21.000Z","dependencies_parsed_at":"2023-06-14T21:00:43.248Z","dependency_job_id":null,"html_url":"https://github.com/tobymurray/web-app-db","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.375,"last_synced_commit":"444aad3cc6f52bade9f05696ef4023d4b721d513"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tobymurray/web-app-db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobymurray%2Fweb-app-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobymurray%2Fweb-app-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobymurray%2Fweb-app-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobymurray%2Fweb-app-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobymurray","download_url":"https://codeload.github.com/tobymurray/web-app-db/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobymurray%2Fweb-app-db/sbom","scorecard":{"id":891033,"data":{"date":"2025-08-11","repo":{"name":"github.com/tobymurray/web-app-db","commit":"444aad3cc6f52bade9f05696ef4023d4b721d513"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/tobymurray/.github/SECURITY.md:1","Info: Found linked content: github.com/tobymurray/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/tobymurray/.github/SECURITY.md:1","Info: Found text in security policy: github.com/tobymurray/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-ff9h-848c-4xfj","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T11:50:41.339Z","repository_id":78725420,"created_at":"2025-08-24T11:50:41.340Z","updated_at":"2025-08-24T11:50:41.340Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29500528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T03:57:51.541Z","status":"ssl_error","status_checked_at":"2026-02-16T03:55:59.854Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["database","nodejs","npm","postgresql","webapp"],"created_at":"2024-09-25T01:19:06.951Z","updated_at":"2026-02-16T04:35:57.617Z","avatar_url":"https://github.com/tobymurray.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web-app-db [![Build Status](https://travis-ci.org/tobymurray/web-app-db.svg?branch=master)](https://travis-ci.org/tobymurray/web-app-db)\nBasic PostgreSQL database structure for web app development. What this gives you:\n\n- 3 databases, one for development, one for testing, and one for production\n- Each database has its `public` schema removed\n- Each database is set up to be accessed by two users, an \"admin\" and a \"user\"\n- The admin is the owner of the database - able to create tables, add columns, generally change the schema and structure of the database\n    - This is the user you use for deploying and upgrading your app\n- The user has locked privileges so they're unable to modify the structure of the database. The user can add, remove and update rows in tables, but little else\n    - This is the user you use from within your web application while it's deployed\n\n## Why?\n\n1. Security: Injection isn't at the top of the [OWASP Top 10](https://www.owasp.org/index.php/OWASP_Top_Ten_Cheat_Sheet) because it's hard to take advantage of. If you do make a mistake, limit the possible damage. Respect the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)\n2. Easier deployment: It seems counterintuitive, but the separation of concerns actually makes things more clear. You never have to worry if your database user has the right privileges - if you're doing administrative work, use the administrator. If you're not, don't.\n\n## Installation\n### To install the published NPM module\n`npm -g install web-app-db` or\n`yarn global add web-app-db`\n\n### To install local module after cloning the repository\n`npm -g install .`\n\n## Usage\n\nFirst, create a `.web-app-db` configuration file. Example:\n\n```\n# The database user used by the application while it's running\nDB_USER=sample_user\nDB_PASSWORD=user_password\n\n# The database user used to deploy the application\nDB_ADMIN=sample_admin\nDB_ADMIN_PASSWORD=admin_password\n\n# The root name of the database - _production, _development, and _test will be appended\nDB_NAME=database_root\n\n# The schema name to use with the databases, if left empty it will default to the database root name\nDB_SCHEMA_NAME=schema_name\n\n# Host where the database server is running (IP address)\nDB_HOST=192.168.1.10\n\n# Port the database server is exposing for the database (defaults to 5432)\nDB_PORT=5432\n\n# The default database on your PostgreSQL server - usually postgres\nDEFAULT_DATABASE=postgres\n\n# The superuser you've initialized your server with - usually postgres\nDB_SUPERUSER_NAME=postgres\nDB_SUPERUSER_PASSWORD=password\n```\n\nIn the same directory as the `.web-app-db`, invoke this module with `web-app-db`.\n\n\nSee post here: https://technicallyrural.ca/2017/01/18/postgresql-for-web-apps/ for motivation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobymurray%2Fweb-app-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobymurray%2Fweb-app-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobymurray%2Fweb-app-db/lists"}