{"id":21215275,"url":"https://github.com/jonasdoesthings/plavatar-rest","last_synced_at":"2025-03-15T00:24:35.715Z","repository":{"id":180229284,"uuid":"664801148","full_name":"JonasDoesThings/plavatar-rest","owner":"JonasDoesThings","description":"placeholder + avatar = plavatar - a stateless microservice","archived":false,"fork":false,"pushed_at":"2024-07-10T19:08:54.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T16:30:11.498Z","etag":null,"topics":["api","avatar","avatar-generator","golang","hacktoberfest","microservice","placeholder","placeholder-avatar","placeholder-image"],"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/JonasDoesThings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"buy_me_a_coffee":"jonasdoesthings"}},"created_at":"2023-07-10T19:25:52.000Z","updated_at":"2024-07-10T19:07:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef869962-dd8a-4ec9-8f09-7476e41a9226","html_url":"https://github.com/JonasDoesThings/plavatar-rest","commit_stats":null,"previous_names":["jonasdoesthings/plavatar-rest"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasDoesThings%2Fplavatar-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasDoesThings%2Fplavatar-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasDoesThings%2Fplavatar-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasDoesThings%2Fplavatar-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonasDoesThings","download_url":"https://codeload.github.com/JonasDoesThings/plavatar-rest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243664503,"owners_count":20327484,"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","avatar","avatar-generator","golang","hacktoberfest","microservice","placeholder","placeholder-avatar","placeholder-image"],"created_at":"2024-11-20T21:36:15.585Z","updated_at":"2025-03-15T00:24:35.670Z","avatar_url":"https://github.com/JonasDoesThings.png","language":"Go","funding_links":["https://buymeacoffee.com/jonasdoesthings"],"categories":[],"sub_categories":[],"readme":"# plavatar-rest\nA stateless REST microservice wrapping [plavatar](https://github.com/JonasDoesThings/plavatar) for you (docker image available).\n\n**If you are looking for the local golang plavatar library instead** of this webservice wrapper, [jump to the main plavatar library repo here](https://github.com/jonasDoesThings/plavatar).\n\n![docs/assets/readme-demo.png](docs/assets/readme-demo.png)\n\n## API Endpoints\n* `baseurl:port/laughing/\u003csize\u003e/\u003cname\u003e`\n* `baseurl:port/smiley/\u003csize\u003e/\u003cname\u003e`\n* `baseurl:port/happy/\u003csize\u003e/\u003cname\u003e`\n* `baseurl:port/gradient/\u003csize\u003e/\u003cname\u003e`\n* `baseurl:port/marble/\u003csize\u003e/\u003cname\u003e`\n* `baseurl:port/solid/\u003csize\u003e/\u003cname\u003e`\n* `baseurl:port/pixel/\u003csize\u003e/\u003cname\u003e` (*currently only available as square*)\n\nWithout name:\n* `baseurl:port/laughing/\u003csize\u003e` and so on\n\nWith query params:\n* `baseurl:port/laughing/\u003csize\u003e/\u003cname\u003e?format=svg`\n* `baseurl:port/laughing/\u003csize\u003e/\u003cname\u003e?format=svg\u0026shape=square`\n* `baseurl:port/laughing/\u003csize\u003e/\u003cname\u003e?shape=square` and so on\n\n## Parameters\n* `size` the image's size in pixels. has to be min 16, max 1024\n* `name` **optional**, the random number generator seed to use. given the same name the same picture will be returned\n### Query Params\n* `format`**optional**, either png (default) or svg. svg returns the raw svg\n* `shape` **optional**, either circle (default) or square.\n\n## **If possible, use format=SVG.**\nNot only is format=SVG extremely faster, it also saves you a lot of bandwidth and latency. (A generated SVG is only ~2% the size of a 512px PNG)\n\n## Docker Image\nYou can use our auto-built docker image `ghcr.io/jonasdoesthings/plavatar-rest:latest`.  \nAll versions and details can be found here:\nhttps://github.com/JonasDoesThings/plavatar-rest/pkgs/container/plavatar-rest\n\n## Configuration\nYou can optionally supply a config file if you are not happy with the preset settings.  \nBy the default the program looks for a config file at `\u003crunning_folder\u003e/config/plavatar.json`. If you want to use an\nalternative location you can override this behaviour using the argument `--config \u003cpath_to_config\u003e`. If there's neither\na config in the `config/` folder, nor you supply a path with `--config` the default configuration will be used.\n\n### Default configuration file\n\n```json\n{\n  \"dimensions\": {\n    \"min\": 128,\n    \"max\": 512\n  },\n  \"webserver\": {\n    \"gzip\": true,\n    \"http\": {\n      \"enabled\": true,\n      \"host\": \"0.0.0.0\",\n      \"port\": 7331\n    },\n    \"https\": {\n      \"enabled\": false,\n      \"host\": \"0.0.0.0\",\n      \"port\": 7332,\n      \"cert\": \"testing.crt\",\n      \"key\": \"testing.key\"\n    }\n  },\n  \"caching\": {\n    \"enabled\": true,\n    \"ttl\": \"8h\"\n  },\n  \"metrics\": {\n    \"enabled\": false,\n    \"auth\": {\n      \"enabled\": true,\n      \"username\": \"\",\n      \"password\": \"\"\n    }\n  }\n}\n```\n\n## Developing\nIf you want to use a local version of the plavatar library, you can add a [replace directive](https://go.dev/ref/mod#go-mod-file-replace) to the plavatar-rest go.mod file.\ne.g.\n```\nreplace (\n    github.com/jonasdoesthings/plavatar/v3 =\u003e ../plavatar/\n)\n```\nThis assumes that you have plavatar and plavata-rest both cloned locally next to each other.\n\n\n## Testing\nTo run the go tests, use `go test -v ./...` in the root directory of the project.\n\nTo generate a self-signed certificate for testing purposes you can\nuse `openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out testing.crt -keyout testing.key`\n\nFor benchmarking, you can use the provided [k6 script](https://github.com/grafana/k6) under `scripts/k6_plavatar_benchmark.js`.\n\n## Releasing\n1. Merge all changes into the next branch to test them out (commits to the next branch will trigger the build-and-release-nightly action that builds and publishes the docker image with tag \"next\").\n2. Rebase next into main.\n3. Create a tag following SemVer syntax prefixed with a `v` (e.g. `v3.4.2`).\n4. Push the tag, and it will trigger the build_and_release action which will automatically publish the tagged docker image.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasdoesthings%2Fplavatar-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasdoesthings%2Fplavatar-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasdoesthings%2Fplavatar-rest/lists"}