{"id":26462934,"url":"https://github.com/clerk/clerk-fastify-react-prisma-starter","last_synced_at":"2025-06-28T18:32:49.939Z","repository":{"id":104052836,"uuid":"425510945","full_name":"clerk/clerk-fastify-react-prisma-starter","owner":"clerk","description":"Clerk Fastify React Prisma fullstack monorepo starter","archived":false,"fork":false,"pushed_at":"2023-02-08T16:37:49.000Z","size":1313,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-11-03T07:34:50.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/clerk.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}},"created_at":"2021-11-07T13:29:10.000Z","updated_at":"2023-11-03T07:34:51.799Z","dependencies_parsed_at":"2023-06-29T11:46:53.798Z","dependency_job_id":null,"html_url":"https://github.com/clerk/clerk-fastify-react-prisma-starter","commit_stats":null,"previous_names":["clerk/clerk-fastify-react-prisma-starter"],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/clerk/clerk-fastify-react-prisma-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clerk%2Fclerk-fastify-react-prisma-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clerk%2Fclerk-fastify-react-prisma-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clerk%2Fclerk-fastify-react-prisma-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clerk%2Fclerk-fastify-react-prisma-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clerk","download_url":"https://codeload.github.com/clerk/clerk-fastify-react-prisma-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clerk%2Fclerk-fastify-react-prisma-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262476249,"owners_count":23317238,"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":[],"created_at":"2025-03-19T06:26:19.979Z","updated_at":"2025-06-28T18:32:49.901Z","avatar_url":"https://github.com/clerk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clerk Fastify React Prisma Starter\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://clerk.dev?utm_source=github\u0026utm_medium=clerk_javascript\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://images.clerk.dev/static/logo-dark-mode-400x400.png\"\u003e\n      \u003cimg src=\"https://images.clerk.dev/static/logo-light-mode-400x400.png\" height=\"64\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n\u003c/p\u003e\n\nThis repo shows an example use case for how you setup a fullstack monorepo starter with [Clerk](https://clerk.dev?utm_source=github\u0026utm_medium=starters\u0026utm_campaign=cfrp), Fastify, React and Prisma to achieve authenticated cross-domain user access.\n\n# Clerk Apartments Application\n\n## The application\n\nThe **Clerk Apartments** application allows a user to claim apartments from the gallery and view them in his own collection. Any apartment that is \"claimed\" by a user, cannot be reclaimed unless \"foregone\" by the previous holder.\n\n## Under the hood\n\nThe example is a fullstack application in a monorepo structure using:\n\n- [Clerk](https://clerk.dev?utm_source=github\u0026utm_medium=starters\u0026utm_campaign=cfrp) as an authentication provider.\n- [Fastify](https://www.fastify.io/) as the API server.\n- [React](https://reactjs.org/) as the frontend library.\n- [Prisma](https://www.prisma.io/) for data storage and model type sharing between client and server.\n- [Yarn workspaces](https://yarnpkg.com/features/workspaces) for the monorepo management.\n\n## Where the magic happens\n\nAuthenticating Prisma data access using Clerk works by introducing a thin and customizable access management layer on top of the Prisma generated API for our collection.\n\nThis ultimately gets handled in the Fastify API routes with simple logic and the use of the Clerk authentication [preHandler hook](./packages/server/src/auth/clerkHandler.ts), like in the [/apartments routes](./packages/server/src/routes/apartments.ts).\n\n## Running the example\n\nTo run the example locally you need to:\n\n1. Sign up for a Clerk account at [https://clerk.dev/](http://clerk.dev/?utm_source=github\u0026utm_medium=starters\u0026utm_campaign=cfrp).\n2. Clone this repository `git clone git@github.com:clerkinc/clerk-fastify-react-prisma-starter.git`.\n3. Setup the required API variables from your Clerk project as shown at the example env files. [Server](./.env.example) [Client](./packages/client/.env.example)\n4. `yarn install` to install the required dependencies.\n5. Setup your Prisma database, following the [instructions](./packages/db/README.md) at the `db` folder.\n6. To start both the client and the server you need to run in separate terminals from the top level of the repository the commands: `yarn client:dev` and `yarn server:dev`\n\n## Contact\n\nIf you have any specific use case or anything you would like to ask, please reach out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclerk%2Fclerk-fastify-react-prisma-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclerk%2Fclerk-fastify-react-prisma-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclerk%2Fclerk-fastify-react-prisma-starter/lists"}