{"id":15095942,"url":"https://github.com/scblur869/pg-widget-api","last_synced_at":"2026-01-06T16:56:31.578Z","repository":{"id":248597617,"uuid":"829146533","full_name":"scblur869/pg-widget-api","owner":"scblur869","description":"api written for postgres PQX library","archived":false,"fork":false,"pushed_at":"2024-07-18T01:12:12.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T17:44:18.611Z","etag":null,"topics":["api-rest","gin-gonic","golang","microservces","postgresql","pqx"],"latest_commit_sha":null,"homepage":"","language":"Go","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/scblur869.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-07-15T21:20:08.000Z","updated_at":"2024-07-18T01:12:15.000Z","dependencies_parsed_at":"2024-11-16T15:45:15.709Z","dependency_job_id":null,"html_url":"https://github.com/scblur869/pg-widget-api","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"70066aa58027109de86fd533220c053d490c1c21"},"previous_names":["scblur869/pg-widget-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scblur869%2Fpg-widget-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scblur869%2Fpg-widget-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scblur869%2Fpg-widget-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scblur869%2Fpg-widget-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scblur869","download_url":"https://codeload.github.com/scblur869/pg-widget-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245852629,"owners_count":20683067,"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":["api-rest","gin-gonic","golang","microservces","postgresql","pqx"],"created_at":"2024-09-25T15:44:07.121Z","updated_at":"2026-01-06T16:56:31.549Z","avatar_url":"https://github.com/scblur869.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PG-Widget-API\n\n## Purpose\n\nTo provide a simple api / http microservice that supports a few common postgres data handling functions.\nThis api is written in GO for its simplicity and speed of use. It leverages a single database handler to support reciever functions.\n\n### Files \u0026 Libs\n\n#### libs\n\n- \u003chttps://github.com/gin-gonic/gin\u003e   -- http api framework for GO\n- \u003chttps://github.com/jackc/pgx\u003e  -- postgres library written in GO\n\n#### files\n\n- **services** folder contains receiver and utility functions to support endpoint functions\n- **structs** contains structs for the widget model\n- **images** supports this README\n- *.env* - local environment file for testing\n- *compose.yml* - a simple docker-compose file to spin up postgres database container and creates the widgetDB and table\n- *init.sql* - file that creates the widgetdb/widget table structure used by compose\n- *Dockerfile* - docker file for building the pg-api container\n- *key.txt* - key file created on every start up. this file is stored in the container should be used if you want to secure an endpoint accessabilty\n- *sample-data.sh* - a set of curl statements to load up some sample data\n\n```bash\nsh sample-data.sh\n```\n\n### Building and Deploying\n\n#### Api\n\n![building the api](images/console.png)\n\n#### Postgres\n\n(old docker-compsoe v1)\n\n```docker\ndocker-compose up -d  \n```\n\n(new docker compose v2)\n\n![spinning up the postgres container](images/compose.png)\n\n#### Testing the api\n\n#### add new\n\n```console\ncurl --location 'localhost:4000/api/v1/addNew' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"wid005\",\n    \"category\": \"square\",\n    \"color\" : \"purple\"\n}'\n```\n\n#### list widgets\n\n```console\ncurl --location 'localhost:4000/api/v1/getAll'\n```\n\nenjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscblur869%2Fpg-widget-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscblur869%2Fpg-widget-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscblur869%2Fpg-widget-api/lists"}