{"id":18464951,"url":"https://github.com/neondatabase-labs/kube-previews-application","last_synced_at":"2025-10-13T08:09:36.645Z","repository":{"id":208297303,"uuid":"721255018","full_name":"neondatabase-labs/kube-previews-application","owner":"neondatabase-labs","description":"Example project that shows how to create a Neon branch for preview environments deployed on Kubernetes using Argo CD","archived":false,"fork":false,"pushed_at":"2023-11-24T20:44:24.000Z","size":343,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T08:09:33.771Z","etag":null,"topics":["argocd","kubernetes","neon","postgres","postgresql","preview-deploy","preview-environment"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neondatabase-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-11-20T17:12:18.000Z","updated_at":"2025-04-23T13:53:20.000Z","dependencies_parsed_at":"2024-11-06T09:12:33.150Z","dependency_job_id":"55a2f90c-a5fb-4479-9af9-2f02c4cb2a72","html_url":"https://github.com/neondatabase-labs/kube-previews-application","commit_stats":null,"previous_names":["evanshortiss/neon-kube-previews-application","neondatabase/kube-previews-application","neondatabase-labs/kube-previews-application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neondatabase-labs/kube-previews-application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fkube-previews-application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fkube-previews-application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fkube-previews-application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fkube-previews-application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neondatabase-labs","download_url":"https://codeload.github.com/neondatabase-labs/kube-previews-application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neondatabase-labs%2Fkube-previews-application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014291,"owners_count":26085489,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["argocd","kubernetes","neon","postgres","postgresql","preview-deploy","preview-environment"],"created_at":"2024-11-06T09:11:36.779Z","updated_at":"2025-10-13T08:09:36.611Z","avatar_url":"https://github.com/neondatabase-labs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neon Branching for Kubernetes-based Preview Environments\n\nThis repository contains source code for a sample Next.js application that's\nused in conjunction with a [set of Kubernetes manifests](https://github.com/neondatabase/kube-previews-manifests).\nThese work in tandem with Neon's branching feature to create unique preview\nenvironments, each with their own unique serverless Postgres database.\n\n## How Preview Environments Work\n\n1. Each PR opened against the repository will trigger workflow that:\n    * Builds the Next.js application into a container image.\n    * Creates a Neon branch to use in the preview environment.\n1. An Argo CD [Argo CD ApplicationSet](https://github.com/neondatabase/kube-previews-manifests/blob/main/kind-cluster/application-set.yaml) will detect the PR and create a namespace on your Kubernetes cluster to deploy the new container image.\n1. Once the workflow associated with a pull request is complete it will:\n    * Update the Argo-managed preview environment with the Neon branch Postgres connection string and container image tag.\n    * Comment on the pull request with a link to the preview environment.\n\n## Requirements\n\nA Kubernetes cluster is required to run this sample. The [manifests repository](https://github.com/neondatabase/kube-previews-manifests)\ncontains instructions and a script to configure a local Kubernetes environment\nand Argo CD instance.\n\nTo run the GitHub Actions workflow, add the following secrets to your fork\nof this repository using the **Settings \u003e Secrets and variables \u003e Actions**\nscreen:\n\n* `DOCKERHUB_TOKEN` - A token with write access to a repository on Docker Hub. Created from the [Account Settings / Security](https://hub.docker.com/settings/security) page on Docker Hub.\n* `DOCKERHUB_USERNAME` - The username that owns the `neon-kube-previews` repository that the container image will be written to.\n* `NEON_API_KEY` - Found in the [Developer Settings](https://console.neon.tech/app/settings/api-keys) screen on the Neon console.\n* `NEON_PROJECT_ID` - Found in *Settings \u003e General* on the Neon project dashboard.\n* `ARGOCD_HOSTNAME` - Strictly the hostname, e.g `argocd.foo.bar` without `https`.\n* `ARGOCD_USERNAME` - A valid Argo CD username. You can can use `admin` if you're prototyping.\n* `ARGOCD_PASSWORD` - The password associated with the given `ARGOCD_USERNAME`.\n* `PREVIEW_SUBDOMAIN` - The subdomain that hosts preview environments, e.g `neon.ngrok.app`. This will be used to form a full preview environment URL, i.e `https://pr-1.${PREVIEW_SUBDOMAIN}`\n\n_Note: Feel free to replace Docker Hub with [Quay.io](https://quay.io/) or your preferred container registry in the GitHub Actions workflow._\n\nIf you're unfamiliar with how to add secrets to a GitHub repository, you\ncan learn more in [GitHub's documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneondatabase-labs%2Fkube-previews-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneondatabase-labs%2Fkube-previews-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneondatabase-labs%2Fkube-previews-application/lists"}