{"id":20125698,"url":"https://github.com/phi-ag/solid-pages","last_synced_at":"2025-09-21T04:31:36.651Z","repository":{"id":261020218,"uuid":"882979689","full_name":"phi-ag/solid-pages","owner":"phi-ag","description":"Opinionated demo app running SolidStart on Cloudflare Pages","archived":false,"fork":false,"pushed_at":"2025-01-10T05:34:27.000Z","size":14619,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T06:37:01.887Z","etag":null,"topics":["cloudflare","cloudflare-pages","solidjs","solidstart","terraform"],"latest_commit_sha":null,"homepage":"https://solid-pages.phi.ag","language":"TypeScript","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/phi-ag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-11-04T06:50:36.000Z","updated_at":"2025-01-10T05:32:05.000Z","dependencies_parsed_at":"2024-12-03T01:18:25.637Z","dependency_job_id":"3fff3e6c-953e-4b9f-847e-424ce67d7392","html_url":"https://github.com/phi-ag/solid-pages","commit_stats":null,"previous_names":["phi-ag/solid-pages"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Fsolid-pages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Fsolid-pages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Fsolid-pages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Fsolid-pages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phi-ag","download_url":"https://codeload.github.com/phi-ag/solid-pages/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233711046,"owners_count":18717952,"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":["cloudflare","cloudflare-pages","solidjs","solidstart","terraform"],"created_at":"2024-11-13T20:09:22.001Z","updated_at":"2025-09-21T04:31:36.190Z","avatar_url":"https://github.com/phi-ag.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solid Pages\n\n[![Production](https://shields.io/badge/production-0369a1?style=for-the-badge)](https://solid-pages.phi.ag)\n[![Preview](https://shields.io/badge/preview-c2410c?style=for-the-badge)](https://preview-solid-pages.phi.ag)\n[![E2E Report](https://shields.io/badge/e2e_report-334155?style=for-the-badge)](https://phi-ag.github.io/solid-pages/)\n[![Coverage](https://img.shields.io/codecov/c/github/phi-ag/solid-pages?style=for-the-badge)](https://app.codecov.io/github/phi-ag/solid-pages)\n\nOpinionated demo app running [SolidStart](https://start.solidjs.com/) on [Cloudflare Pages](https://pages.cloudflare.com/).\n\n## Setup\n\n### Accounts\n\n- Create a [Cloudflare Account](https://dash.cloudflare.com/sign-up)\n- Sign-up for [Terraform Cloud](https://www.terraform.io/) or [similar](https://opentofu.org/supporters/)\n\n### Tools\n\n- Install [Terraform](https://developer.hashicorp.com/terraform/install) or [OpenTofu](https://opentofu.org/docs/intro/install)\n- Install [fnm](https://github.com/Schniz/fnm?tab=readme-ov-file#installation) or [nvm](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating) ([nvm-windows](https://github.com/coreybutler/nvm-windows?tab=readme-ov-file#installation--upgrades))\n\n### Cloudflare API token\n\n\u003e [!WARNING]\n\u003e Cloudflare Account API tokens currently can't be used to create Pages with Terraform (internal server error)\n\nCreate a personal API token for Terraform with the following permissions\n\n- Account / D1 / Edit\n- Account / Cloudflare Pages / Edit\n- Account / Workers R2 Storage / Edit\n- Account / Workers KV Storage / Edit\n- Account / Access: Apps and Policies / Edit\n- Account / Access: Service Tokens / Edit\n- Account / Access: Organizations, Identity Providers, and Groups / Read\n- Zone / DNS / Edit\n\nCopy the token into your Terraform Cloud Workspace variables as `cloudflare_api_token` (sensitive).\n\nCreate a API token for GitHub with the following permissions\n\n- Account / D1 / Edit\n- Account / Cloudflare Pages / Edit\n\nCopy the token into your GitHub Action Secrets as `CLOUDFLARE_API_TOKEN`.\n\n### Cloudflare Zero Trust\n\nThis app uses [Zero Trust](https://developers.cloudflare.com/cloudflare-one/) with a [GitHub Identity Provider](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/github/) to protect the preview deployment.\n\nIf you don't want this setup you can remove everything related to Zero Trust, JWT and E2E from [main.tf](main.tf), [wrangler.toml](wrangler.toml), the `user` middleware from [middleware.ts](src/middleware.ts) and related code from `src/lib`.\n\nAlternatively if you want to protect the production deployment copy `JWT_ISSUER`, `JWT_AUDIENCE` and `E2E_CLIENT_ID` to `[env.production.vars]` in your [wrangler.toml](wrangler.toml) and add the production domains to the Zero Trust Application in [main.tf](main.tf).\n\n```tf\ndestinations {\n  uri = cloudflare_pages_domain.production.domain\n}\ndestinations {\n  uri = cloudflare_pages_project.page.subdomain\n}\n```\n\nFollow the official documentation to setup the [GitHub Identity Provider](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/github/) and update [terraform.tfvars](terraform.tfvars).\n\nAfter applying Terraform add `E2E_CLIENT_ID` and `E2E_CLIENT_SECRET` to your GitHub Action Secrets\n\n    terraform output -raw e2e_client_id\n    terraform output -raw e2e_client_secret\n\n### Terraform\n\nUpdate [terraform.tfvars](terraform.tfvars)\n\n    terraform login\n    terraform init\n    terraform apply\n\nUse the output from `terraform apply` (or `terraform output`) to update [wrangler.toml](wrangler.toml).\n\n### Web Analytics\n\nWeb Analytics need to be enabled manually in the Cloudflare dashboard in your Page project -\u003e Metrics.\n\n    terraform apply\n    terraform output -raw web_analytics_token\n    pnpm wrangler pages secret put ANALYTICS_TOKEN\n    pnpm wrangler pages secret put ANALYTICS_TOKEN --env preview\n\n## Development\n\nCreate `.dev.vars` (see [.dev.vars.template](.dev.vars.template))\n\nInstall `Node.js`\n\n    fnm install\n    fnm use\n\nInstall `pnpm`\n\n    corepack enable\n    corepack prepare --activate\n\nInstall packages\n\n    pnpm i\n\nApply migrations\n\n    pnpm db:migrate\n\nWatch\n\n    pnpm dev\n\nTest\n\n    pnpm test\n    pnpm test:dev\n\nEnd-to-End tests\n\n    pnpm playwright install chromium\n\n    pnpm test:e2e --project=chromium\n    pnpm test:e2e --project=a11y\n    pnpm test:e2e --project=lighthouse\n\nRun format, lint, typecheck and test\n\n    pnpm check\n\nDeploy\n\n    pnpm build\n    pnpm run deploy\n    pnpm run deploy:production\n\n### Add environment variables\n\n- Add the variable to [wrangler.toml](wrangler.toml) in the `[vars]` and `[env.production.vars]` sections\n- Run `pnpm typegen`\n\n### Secrets\n\n#### List secrets\n\n    pnpm wrangler pages secret list --env preview\n    pnpm wrangler pages secret list\n\n#### Add secrets\n\n    pnpm wrangler pages secret put MY_SECRET --env preview\n    pnpm wrangler pages secret put MY_SECRET\n\n- Add the secret to `.dev.vars` and [.dev.vars.template](.dev.vars.template)\n- Run `pnpm typegen`\n\n### Stream logs\n\n    pnpm tail\n    pnpm tail:production\n\n### Deployments\n\n    pnpm wrangler pages deployment list\n\n### KV\n\n    pnpm wrangler kv key list --binding KV\n    pnpm wrangler kv key list --binding KV --env production\n\n### R2\n\n    pnpm wrangler r2 object get solid-pages-preview/ -p | jq\n    pnpm wrangler r2 object get solid-pages-production/ -p | jq\n\n### D1\n\n\u003e [!WARNING]\n\u003e When switching D1 you need to update the `url` in [drizzle.config.ts](drizzle.config.ts) and the database name in [package.json](package.json)\n\nInfo\n\n    pnpm wrangler d1 info solid-pages-preview\n    pnpm wrangler d1 info solid-pages-production\n\nPush changes during development\n\n    pnpm db:push\n\nStart Drizzle Studio\n\n    pnpm db:studio\n\nGenerate migration\n\n    pnpm db:generate --name \u003cname\u003e\n\nApply migrations\n\n    pnpm db:migrate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphi-ag%2Fsolid-pages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphi-ag%2Fsolid-pages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphi-ag%2Fsolid-pages/lists"}