{"id":18769292,"url":"https://github.com/score-spec/sample-app-gif","last_synced_at":"2025-12-10T14:30:14.301Z","repository":{"id":242445537,"uuid":"804960554","full_name":"score-spec/sample-app-gif","owner":"score-spec","description":"The sample app used for the gif and video embedded in the docs","archived":false,"fork":false,"pushed_at":"2024-07-24T14:14:10.000Z","size":5920,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T07:25:12.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/score-spec.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":"2024-05-23T15:53:04.000Z","updated_at":"2024-07-24T14:14:12.000Z","dependencies_parsed_at":"2024-12-29T07:33:58.333Z","dependency_job_id":null,"html_url":"https://github.com/score-spec/sample-app-gif","commit_stats":null,"previous_names":["score-spec/sample-app-gif"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/score-spec%2Fsample-app-gif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/score-spec%2Fsample-app-gif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/score-spec%2Fsample-app-gif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/score-spec%2Fsample-app-gif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/score-spec","download_url":"https://codeload.github.com/score-spec/sample-app-gif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239671416,"owners_count":19677873,"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-07T19:15:27.229Z","updated_at":"2025-12-10T14:30:14.253Z","avatar_url":"https://github.com/score-spec.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sample-app-gif\n\nThe sample app used for the gif and video embedded in the docs. The purpose is for it to be complex enough to show the core value propositions of Score:\n\n- Convert to more than one deployment format\n- Provision ingress and database resources with dynamic credentials\n- Launch locally or remotely\n- Show evidence that the request was routed correctly and hit the target database\n\nAll with as few lines of code as possible. We're going to for simple and short rather than _correct_.\n\nThis starts a simple server connected to a Postgres database, and then on each request returns something like:\n\n```\nHTTP/1.1 200 OK\nServer: nginx/1.25.4\nDate: Thu, 23 May 2024 16:39:34 GMT\nContent-Type: text/plain; charset=utf-8\nContent-Length: 127\nConnection: keep-alive\nX-Env: docker\n\nSQL VERSION: PostgreSQL 16.1 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014, 64-bit%\n```\n\n- Cleaned .cast file: [score-demo.cast](score-demo.cast)\n- Modified .cast file with new timings: [score-demo.modified.cast](score-demo.modified.cast)\n- Output gif: [score-demo.gif](score-demo.gif)\n\n    ![score-demo.gif](score-demo.gif)\n\n## How to record the sample gif\n\nUse \u003chttps://docs.asciinema.org/\u003e.\n\nPreparation:\n\n```\n$ docker compose down -v\n$ kubectl --context kind-kind delete -f manifests.yaml\n$ rm -rfv .score-compose .score-k8s compose.yaml manifests.yaml\n$ docker pull ghcr.io/score-spec/sample-app-gif:sha-2533037\n\n$ kind delete cluster\n$ ./setup-kind.sh\n```\n\nInstructions to record:\n\n**NOTE**: for best results you should manually type as many of these as you can\n\n```\n$ asciinema rec score-demo.cast --overwrite -c sh\n\n$ cat score.yaml\n$ score-compose init\n$ score-compose generate score.yaml\n$ docker compose up -d \u003c/dev/null | cat\n$ curl -i http://${host}:8080\n$ docker compose logs sample-main\n$ clear\n\n$ score-k8s init\n$ score-k8s generate score.yaml\n$ kubectl apply -f manifests.yaml\n$ kubectl wait deployments/sample --for=condition=Available\n$ export host=$(score-k8s resources get-outputs 'dns.default#sample.dns' --format '{{ .host }}') \u0026\u0026 printenv host\n$ curl -i http://${host}\n\n$ kubectl delete -f manifests.yaml\n```\n\nThen manually clean up the cast file as needed to remove any mistakes or bad lines. To adjust the timings and highlight the prompt segment, install and run \u003chttps://github.com/astromechza/asciinema-adjuster\u003e:\n\n```\n$ asciinema-adjuster score-demo.cast 'sh-3.2$ ' \u003e score-demo.modified.cast\n```\n\nThen run `agg` to render the gif. `agg` can be installed from \u003chttps://docs.asciinema.org/manual/agg/\u003e.\n\n```\nagg --theme 141926,ffffff,141926,f92672,0cd6ae,f4bf75,638aff,8667fd,a1efe4,ffffff,75715e,f92672,0cd6ae,f4bf75,638aff,8667fd,a1efe4,ffffff \\\n    --font-size 20 --font-family 'Fira Code' --font-dir ./Fira_Code/ \\\n    --cols 80 --rows 20 \\\n    score-demo.modified.cast score-demo.gif\n```\n\nTo generate an optimised gif about half the size, install `gifsicle` and then run:\n\n```\ngifsicle --lossy=80 -k 64 -O2 -Okeep-empty score-demo.gif -o score-demo-lossy.gif\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscore-spec%2Fsample-app-gif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscore-spec%2Fsample-app-gif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscore-spec%2Fsample-app-gif/lists"}