Skip to content

boettiger-lab/data-requests

Repository files navigation

data-requests

A minimal feedback/data-request form that stores submissions as GitHub Issues.

Fork this repo to create an isolated form for your app. Each fork gets its own issue tracker, its own credentials, and its own deployment — no shared infrastructure.

Quick start

  1. Fork this repo (keep it private if submissions contain contact info)
  2. Edit config.json with your app's title, description, and github_repo
  3. Create a fine-grained GitHub PAT with:
    • Resource owner: your account or org
    • Repository access: only this repo
    • Permissions: Issues → Read and write
  4. Choose a deployment path below

Deployment options

A. Netlify (recommended for forks)

Netlify connects to your GitHub repo, builds, and deploys automatically.

  1. Create a free account at netlify.com
  2. New site → Import from Git → select your fork
  3. Build settings: publish directory ., build command empty
  4. Add environment variables in Site settings → Environment:
    • GITHUB_TOKEN — your fine-grained PAT
    • GITHUB_REPOowner/repo
  5. Deploy

The /submit endpoint is rewritten to the Netlify function automatically via netlify.toml. The token never leaves Netlify's servers.

B. Cloudflare Pages

  1. Create a free account at cloudflare.com
  2. Workers & Pages → Create → Pages → Connect to Git → select your fork
  3. Build settings: output directory .
  4. Add environment variables in Pages → Settings → Environment variables:
    • GITHUB_TOKEN
    • GITHUB_REPO
  5. Deploy

The functions/submit.js file is auto-detected as a Pages Function.

C. Kubernetes / self-hosted

Build and push the image:

docker build -t ghcr.io/owner/data-requests:latest .
docker push ghcr.io/owner/data-requests:latest

Create the secret:

kubectl create secret generic data-requests-secret \
  --from-literal=github-token=ghp_... \
  --from-literal=github-repo=owner/repo

Apply:

kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/ingress.yaml   # edit hostname first

Resource footprint: ~64MB RAM, negligible CPU. A single pod handles this load easily.

D. GitHub Pages (direct mode, no server)

For low-stakes forms where the token is intentionally exposed to the browser. Only appropriate when submissions are non-sensitive and the token is scoped to issues:write on one repo (worst case: someone spams your issue tracker).

  1. Enable GitHub Pages on your fork (Settings → Pages → Deploy from branch main)
  2. Copy config.local.js.example to config.local.js and fill in your token
  3. Add to index.html before form.js:
    <script src="config.local.js"></script>
  4. Do not commit config.local.js — it is gitignored

Note: config.local.js is never served in the other deployment modes because those servers don't have the file on disk.


Customisation

Edit config.json:

{
  "title": "My App Feedback",
  "subtitle": "Help us improve <a href='...'>My App</a>.",
  "intro": "...",
  "feedback_hint": "...",
  "question_hint": "...",
  "github_repo": "owner/repo",
  "labels": ["feedback"]
}

All text on the form comes from this file — no HTML editing needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors