{"id":22438528,"url":"https://github.com/gwjun/fastify-vite-ssr","last_synced_at":"2026-05-09T14:40:27.255Z","repository":{"id":266463602,"uuid":"898204950","full_name":"GWjun/fastify-vite-ssr","owner":"GWjun","description":"Vite SSR application template with Fastify web framework","archived":false,"fork":false,"pushed_at":"2024-12-29T12:46:57.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T14:17:24.762Z","etag":null,"topics":["fastify","ssr","vite"],"latest_commit_sha":null,"homepage":"","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/GWjun.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":"2024-12-04T01:19:24.000Z","updated_at":"2024-12-29T12:47:00.000Z","dependencies_parsed_at":"2024-12-05T11:32:32.145Z","dependency_job_id":null,"html_url":"https://github.com/GWjun/fastify-vite-ssr","commit_stats":null,"previous_names":["gwjun/hono-vite-ssr","gwjun/fastify-vite-ssr"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GWjun%2Ffastify-vite-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GWjun%2Ffastify-vite-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GWjun%2Ffastify-vite-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GWjun%2Ffastify-vite-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GWjun","download_url":"https://codeload.github.com/GWjun/fastify-vite-ssr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245814746,"owners_count":20676808,"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":["fastify","ssr","vite"],"created_at":"2024-12-06T01:10:27.225Z","updated_at":"2026-05-09T14:40:27.205Z","avatar_url":"https://github.com/GWjun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vite SSR Boilerplate with Fastify\n\nThis repository provides a boilerplate for building server-side rendered (SSR) applications using **Vite** and **Fastify**.\n\nIt also supports server and client routing using **React Router**.\n\n\u003c/br\u003e\n\n## Installation\n\nClone the repository and install the dependencies:\n\n```bash\npnpm install\n```\n\n\u003c/br\u003e\n\n## Run\n\n- **Development:**\n\n  ```bash\n  pnpm dev\n  ```\n\n  Starts the development server using vite-node.\n\n- **Production Build:**\n\n  ```bash\n  pnpm build\n  ```\n\n  Generates the client and server builds for production.\n\n- **Start Production Server:**\n\n  ```bash\n  pnpm start\n  ```\n\n  Builds the application and starts the server in production mode.\n\n\u003c/br\u003e\n\n## Route\n\nBy declaring route objects in `src/routes.tsx`, routing is handled on both the server and client using `StaticRouterProvider` and `RouterProvider`, respectively.\n\n\u003c/br\u003e\n\n## Data Fetching\n\nUsing React Router’s `loader`, data can be fetched on the server and delivered to the client.\n\n```tsx\nconst routes: RouteObject[] = [\n  {\n    path: '/',\n    element: \u003cHome /\u003e,\n    loader: async () =\u003e {\n      // server side code\n      return fetch(`https://jsonplaceholder.typicode.com/todos`)\n    },\n  },\n]\n```\n\n```tsx\nexport default function Home() {\n  // get ssr data\n  const data: TodoType[] = useLoaderData()\n  // ...\n}\n```\n\n\u003c/br\u003e\n\n## Structure\n\n```\n├── dist/                # Production build output\n├── src/                 # React application source files\n│   ├── main.tsx         # Client-side entry point\n│   └── route.tsx        # Route object\n└── server/              # Fastify server code\n    ├── entry.tsx        # Server-side entry point for SSR render\n    ├── main.ts          # Main server file\n    └── util.ts          # Utility function file\n\n```\n\n\u003c/br\u003e\n\n## Reference\n\n- https://vite.dev/guide/ssr\n- https://reactrouter.com/start/framework/custom\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwjun%2Ffastify-vite-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgwjun%2Ffastify-vite-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwjun%2Ffastify-vite-ssr/lists"}