{"id":21885597,"url":"https://github.com/sheraff/root","last_synced_at":"2026-04-09T23:38:12.139Z","repository":{"id":211067632,"uuid":"727960613","full_name":"Sheraff/root","owner":"Sheraff","description":"Local-first fullstack repo template","archived":false,"fork":false,"pushed_at":"2024-04-06T20:39:19.000Z","size":1648,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T19:51:53.828Z","etag":null,"topics":["crdt","esbuild","monorepo","service-worker","sql","typescript"],"latest_commit_sha":null,"homepage":"https://sheraff.github.io/root-docs/","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/Sheraff.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-12-05T23:46:39.000Z","updated_at":"2024-02-19T15:22:50.000Z","dependencies_parsed_at":"2024-02-02T23:28:07.125Z","dependency_job_id":"970597eb-e164-4502-b664-97e46d65c349","html_url":"https://github.com/Sheraff/root","commit_stats":null,"previous_names":["sheraff/root"],"tags_count":11,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Froot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Froot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Froot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheraff%2Froot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sheraff","download_url":"https://codeload.github.com/Sheraff/root/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244894307,"owners_count":20527669,"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":["crdt","esbuild","monorepo","service-worker","sql","typescript"],"created_at":"2024-11-28T10:28:12.722Z","updated_at":"2026-04-09T23:38:07.106Z","avatar_url":"https://github.com/Sheraff.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌳 Root\nA fullstack typescript offline-first PWA template repo, ready to use\n\u003e [!TIP]\n\u003e **Quick start**: \n\u003e Just click the \u003ckbd\u003eUse this template\u003c/kbd\u003e button to create a new repository with this template.\n\n\u003e [!WARNING]\n\u003e **Don't forget to add an `.env` file**: \n\u003e You can rename the `.env.example` file into `.env` for a minimal starting point that will be enough for the app to run\n\n## Client Package\n\nA typescript React application, with\n\n- Vitest\n- Vite\n- SQLite (vlcn.io CRDTs) + useQuery hook for reactive queries\n- Tanstack Query + useQuery hook for server\u003c-\u003eclient type-safety\n\n## Server Package\n\nA typescript Fastify server, with\n\n- SQLite (vlcn.io CRDTs)\n- esbuild\n- Vitest\n- oauth through 3rd party providers\n\n## Service Worker Package\n\nA typescript service worker, with\n\n- esbuild\n- Hot Module Reloading\n\n## Root Level\n\nA workspace, with\n\n- pnpm (package manager / script runner)\n- eslint w/ type-aware linting (code quality)\n- prettier (code formatting)\n- knip (dead code elimination)\n- turbo (monorepo manager / script cache)\n- valibot (data validation)\n- ts-reset (better typescript defaults)\n- cspell (code spell-checking)\n- github actions (CI/CD) with auto-releases\n- a `script` folder for build-time shared code (node only, for CI, vite plugins, ...)\n- a `shared` folder for run-time shared code (all environments, for client, server, service worker, ...)\n\n## Getting Started\n\nTo get started with this project, click on \u003ckbd\u003eUse this template\u003c/kbd\u003e on GitHub (or clone the repository, but you will be missing the github config) and install the dependencies with pnpm:\n\n```shell\npnpm install\n```\n\nTo start the development server, run:\n\n```shell\npnpm dev\n```\n\nIn dev mode, all requests go through Vite's dev server, and all `/api` requests are forwarded to the Fastify server.\n\nTo test the project, run:\n\n```shell\npnpm test\n```\n\nTo serve the production build, run:\n\n```shell\npnpm serve\n```\n\nIn production mode, all requests go through the Fastify server.\n\nTo build the project for production, run:\n\n```shell\npnpm build\n```\n\nThe assets necessary for running the project after it has been built are:\n- `/dist`\n- `.env`\n- `/node_modules` (because not all imports are bundled)\n- `/db` (though it will be generated if it doesn't exist)\n\n\u003e [!TIP]\n\u003e **Easy deployment**: \n\u003e The `bundle.tar.xz` release artifact uploaded to GitHub contains\n\u003e - the `/dist` folder,\n\u003e - the `package.json` file,\n\u003e - and the `pnpm-lock.yaml` file.\n\u003e \n\u003e After unpacking,\n\u003e 1. provide your `.env` file,\n\u003e 2. install the runtime dependencies (`pnpm install --frozen-lockfile --prod`)\n\u003e\n\u003e And the app is ready to run.\n\u003e This allows you to use the GitHub webhooks to call your server and easily re-deploy on every version change.\n\n---\n\n## Other useful commands\n\n```shell\npnpm format # prettier check\npnpm format:fix # prettier fix\npnpm lint # eslint check\npnpm lint:fix # eslint fix\npnpm tsc # typescript check\npnpm knip # check for unused code\npnpm spell # check for spelling errors\npnpm clear # clear cache (turbo, vite, pnpm, esbuild, ...)\npnpm analyze # bundle size analysis\n```\n\n---\n\n## TODO\n\n- [ ] database: figure out migrations story\n  - [ ] ~~maybe through drizzle?~~\n    - not compatible with sqlite wasm (https://github.com/drizzle-team/drizzle-orm/issues/193, https://github.com/drizzle-team/drizzle-orm/discussions/243)\n  - [ ] Manual migrations seem ok\n    - do we want down migrations?\n    - should migrations be separate from source code and be fetched? Or part of the source and the client simply cannot sync if the app is not up to date?\n    - how do we know which migrations to run? (on the server, and on the client)\n- [ ] cleanup bento: \n  - [ ] make the default page nicer looking\n  - [ ] cleanup DB demo component\n- [ ] docs: write docs w/ [fumadocs](https://fumadocs.vercel.app/) on [root-docs repo](https://github.com/Sheraff/root-docs)\n- [ ] While working on CSS, ESLint can lose the types of `classes` objects. This might have been fixed by adding a tcm process to the `dev` command, but it needs to be tested.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheraff%2Froot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheraff%2Froot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheraff%2Froot/lists"}