{"id":43270532,"url":"https://github.com/treeder/flaregun-starter","last_synced_at":"2026-02-01T15:41:23.560Z","repository":{"id":300261677,"uuid":"1005708061","full_name":"treeder/flaregun-starter","owner":"treeder","description":"Starter kit for full stack apps on Cloudflare developer platform. No framework lock-in.","archived":false,"fork":false,"pushed_at":"2026-01-15T07:53:51.000Z","size":649,"stargazers_count":22,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-15T14:36:36.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/treeder.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-20T17:11:13.000Z","updated_at":"2026-01-15T07:53:55.000Z","dependencies_parsed_at":"2025-08-21T07:21:09.568Z","dependency_job_id":"1e234c9e-2b51-4548-9531-dcb5343659e5","html_url":"https://github.com/treeder/flaregun-starter","commit_stats":null,"previous_names":["treeder/flaregun-starter"],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/treeder/flaregun-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fflaregun-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fflaregun-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fflaregun-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fflaregun-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treeder","download_url":"https://codeload.github.com/treeder/flaregun-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fflaregun-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28981453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T15:35:50.179Z","status":"ssl_error","status_checked_at":"2026-02-01T15:35:38.075Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-02-01T15:41:23.397Z","updated_at":"2026-02-01T15:41:23.555Z","avatar_url":"https://github.com/treeder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flaregun Starter Kit\n\nThis is a starter kit for running a full-stack app quickly on Cloudflare without a complex framework. Pure JavaScript and standard technology to prevent lock-in.\n\nSuper lightweight, super fast, easy to understand, no magic (well, just a little). Uses [flaregun](https://github.com/treeder/flaregun) for an awesome Cloudflare experience.\n\nOut of the box, this includes:\n\n- database with easy migrations\n- file storage\n- server side rendering\n- API endpoints\n- queues\n- scheduler\n- material 3 web components\n- email and passkey authentication\n\nIt's easy to add and remove things since it's mostly just standard JavaScript.\n\n## Getting started\n\nYou can get up and running in seconds (literally).\n\n### Deploy to Cloudflare\n\nWant to deploy in seconds to see it in action?\n\n[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/treeder/flaregun-starter)\n\n### Run locally for development\n\nClick `Use this template` button in the top right:\n\n\u003cimg width=\"182\" height=\"124\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cc9dfd42-8add-4e7a-9ba9-38b0107d268b\" /\u003e\n\nThen clone and run your new repo:\n\n```sh\nnpm start\n```\n\nNow view the demo page at http://localhost:8787.\n\nTry making some changes and see it update in real-time!\n\n## Database\n\n### Schema / migrations\n\nDefine models [models](https://github.com/treeder/models) in the [data](./functions/data) folder, then add the class to [migrations.js](./functions/data/migrations.js) to automatically keep your database schema up to date.\n\n### Using the database\n\nIt's super easy to use the database:\n\n```js\nlet user = { name: 'John Wick', email: 'x@y.com' }\nawait c.data.d1.insert('users', user)\n\nuser.name = 'Jim Bean'\n// update a row\nawait c.data.d1.update('users', user.id, user)\n\n// get object\nuser = c.data.d1.get('users', user.id)\n\n// querying\nlet users = await c.data.d1.query('users', {\n  where: { email: 'x@y.com' },\n})\n```\n\nSee the [D1 docs](https://github.com/treeder/flaregun/blob/main/README.md#d1-sqlite-database) in the flaregun for more complex examples.\n\n## Layout\n\nEdit [layout.js](./functions/layout.js) to update the layout of your app.\n\n## Routes\n\nThis uses file based routing from [Cloudflare Pages Functions](https://developers.cloudflare.com/pages/functions/routing/), but runs on Workers because Pages Functions are deprecated.\n\nTo add a new route, just add a new file to the functions directory and that will be your route. For instance, if you add a file called `hello.js`, it will be available at\n`/hello`.\n\nFor UI endpoints:\n\n```js\nimport { html } from 'rend'\n\nexport async function onRequestGet(c) {\n  return await c.data.rend.html({\n    main: render,\n  })\n}\n\nfunction render(d) {\n  return html` \u003cdiv\u003eHello world!\u003c/div\u003e `\n}\n```\n\nFor API endpoints:\n\n```js\nexport async function onRequestGet(c) {\n  return Response.json({\n    hello: 'world',\n  })\n}\n```\n\n## Scheduler\n\nThe [scheduled.js](functions/scheduled.js) file will run every minute by default (after your first deployment).\n\nTo disable scheduling, delete the scheduled.js file and remove the triggers from wrangler.jsonc.\n\nNOTE: There are some small gotchas here:\n\n- This won't run any middleware, so you'll have to do any initialization you need in the scheduled function.\n- To import something like a class or function in scheduled.js, it must also be used elsewhere in your app.\n\nThat's about it, otherwise, should work as is!\n\n## Queues\n\nThe [queue.js](functions/queue.js) file will run whenever you post a message to the queue.\n\nTo post a message:\n\n```js\nawait c.env.QUEUE.send({ message: 'Hello, world!' })\n```\n\nYour queue.js handler will get the message shortly.\n\nTo delay the message:\n\n```js\nawait c.env.QUEUE.send({ message: 'Hello, world!' }, { delaySeconds: 60 })\n```\n\nThat will delay the message for 60 seconds.\n\n## Testing\n\nThis is configured to do some basic API testing with [testkit](https://github.com/treeder/testkit). See [tests/tests.js](tests/tests.js) for more details. Run tests with `npm run testkit` and you can add that to your CI.\n\n## Deploying\n\nThis is two steps.\n\n1. Run setup script to create all the resources on Cloudflare.\n2. Deploy!\n\n### Setup\n\nThis will create all your cloudflare resources such as your database and file storage.\n\n- First get an [API token for Cloudflare](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) and get your account ID.\n- Choose \"Edit Cloudflare Workers\" template.\n\n\u003cimg width=\"823\" height=\"79\" alt=\"image (2)\" src=\"https://github.com/user-attachments/assets/c0a860b5-55e3-441c-a4da-a5b10dd6b248\" /\u003e\n\nKeep all the same settings, but also add D1 with write access.\n\nCreate a `.env` file with:\n\n```sh\nCLOUDFLARE_API_TOKEN=X\nCLOUDFLARE_ACCOUNT_ID=Y\n```\n\nThen run:\n\n```sh\nnpm run setup\n```\n\n### Manual deploy\n\nTo deploy to dev environment:\n\n```sh\nnpm run deploy\n```\n\nTo deploy to prod environment:\n\n```sh\nnpm run deploy:prod\n```\n\n### Auto deploy\n\nSetup auto deploy in the Cloudflare Dashboard so every commit to main will deploy and other\nbranches will get a preview URL.\n\nSet build command to:\n\n```sh\nnpm run build\n```\n\nSet deploy command to:\n\n```sh\nnpm run deploy\n```\n\nSet non-production branch deploy command to:\n\n```sh\nnpm run deploy:preview\n```\n\n### Deploying to production\n\n```sh\nnpm run deploy:prod\n```\n\nThen your auto deploy configuration should change to:\n\n- `npm run build`\n- `npm run deploy:prod`\n- Preview URLs: You may not want to have preview URLs on production, but if you do, use: `npm run deploy:prod:preview`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreeder%2Fflaregun-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreeder%2Fflaregun-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreeder%2Fflaregun-starter/lists"}