{"id":30895862,"url":"https://github.com/illright/scooter-management","last_synced_at":"2025-09-08T22:48:28.448Z","repository":{"id":310406198,"uuid":"1035635639","full_name":"illright/scooter-management","owner":"illright","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-17T21:24:08.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-17T23:25:31.784Z","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/illright.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,"zenodo":null}},"created_at":"2025-08-10T20:17:22.000Z","updated_at":"2025-08-17T21:24:11.000Z","dependencies_parsed_at":"2025-08-21T15:45:52.613Z","dependency_job_id":null,"html_url":"https://github.com/illright/scooter-management","commit_stats":null,"previous_names":["illright/scooter-management"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/illright/scooter-management","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illright%2Fscooter-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illright%2Fscooter-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illright%2Fscooter-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illright%2Fscooter-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/illright","download_url":"https://codeload.github.com/illright/scooter-management/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illright%2Fscooter-management/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231213,"owners_count":25245659,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-09-08T22:48:20.549Z","updated_at":"2025-09-08T22:48:28.428Z","avatar_url":"https://github.com/illright.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\npnpm install\npnpm start\n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\npnpm build\n```\n\n## Testing\n\nThis project uses [Vitest](https://vitest.dev/) for testing. You can run the tests with:\n\n```bash\npnpm test\n```\n\n## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\n\n\n## Linting \u0026 Formatting\n\nThis project uses [Biome](https://biomejs.dev/) for linting and formatting. The following scripts are available:\n\n\n```bash\npnpm lint\npnpm format\npnpm check\n```\n\n\n\n## Routing\nThis project uses [TanStack Router](https://tanstack.com/router). The initial setup is a code based router. Which means that the routes are defined in code (in the `./src/main.tsx` file). If you like you can also use a file based routing setup by following the [File Based Routing](https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing) guide.\n\n### Adding A Route\n\nTo add a new route to your application just add another `createRoute` call to the `./src/main.tsx` file. The example below adds a new `/about`route to the root route.\n\n```tsx\nconst aboutRoute = createRoute({\n  getParentRoute: () =\u003e rootRoute,\n  path: \"/about\",\n  component: () =\u003e \u003ch1\u003eAbout\u003c/h1\u003e,\n});\n```\n\nYou will also need to add the route to the `routeTree` in the `./src/main.tsx` file.\n\n```tsx\nconst routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);\n```\n\nWith this set up you should be able to navigate to `/about` and see the about page.\n\nOf course you don't need to implement the About page in the `main.tsx` file. You can create that component in another file and import it into the `main.tsx` file, then use it in the `component` property of the `createRoute` call, like so:\n\n```tsx\nimport About from \"./components/About.tsx\";\n\nconst aboutRoute = createRoute({\n  getParentRoute: () =\u003e rootRoute,\n  path: \"/about\",\n  component: About,\n});\n```\n\nThat is how we have the `App` component set up with the home page.\n\nFor more information on the options you have when you are creating code based routes check out the [Code Based Routing](https://tanstack.com/router/latest/docs/framework/react/guide/code-based-routing) documentation.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/react-router`.\n\n```tsx\nimport { Link } from \"@tanstack/react-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\n\u003cLink to=\"/about\"\u003eAbout\u003c/Link\u003e\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/react/api/router/linkComponent).\n\n### Using A Layout\n\n\nLayouts can be used to wrap the contents of the routes in menus, headers, footers, etc.\n\nThere is already a layout in the `src/main.tsx` file:\n\n```tsx\nconst rootRoute = createRootRoute({\n  component: () =\u003e (\n    \u003c\u003e\n      \u003cOutlet /\u003e\n      \u003cTanStackRouterDevtools /\u003e\n    \u003c/\u003e\n  ),\n});\n```\n\nYou can use the React component specified in the `component` property of the `rootRoute` to wrap the contents of the routes. The `\u003cOutlet /\u003e` component is used to render the current route within the body of the layout. For example you could add a header to the layout like so:\n\n```tsx\nimport { Link } from \"@tanstack/react-router\";\n\nconst rootRoute = createRootRoute({\n  component: () =\u003e (\n    \u003c\u003e\n      \u003cheader\u003e\n        \u003cnav\u003e\n          \u003cLink to=\"/\"\u003eHome\u003c/Link\u003e\n          \u003cLink to=\"/about\"\u003eAbout\u003c/Link\u003e\n        \u003c/nav\u003e\n      \u003c/header\u003e\n      \u003cOutlet /\u003e\n      \u003cTanStackRouterDevtools /\u003e\n    \u003c/\u003e\n  ),\n});\n```\n\nThe `\u003cTanStackRouterDevtools /\u003e` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/react/guide/routing-concepts#layouts).\n\n\n### Migrating To File Base Routing\n\nFirst you need to add the Vite plugin for Tanstack Router:\n\n```bash\npnpm add @tanstack/router-plugin --dev\n```\n\nFrom there you need to update your `vite.config.js` file to use the plugin:\n\n```ts\nimport { defineConfig } from \"vite\";\nimport viteReact from \"@vitejs/plugin-react\";\nimport { TanStackRouterVite } from \"@tanstack/router-plugin/vite\";\nimport tailwindcss from \"@tailwindcss/vite\";\n\n  \n// https://vitejs.dev/config/\nexport default defineConfig({\n  plugins: [\n    TanStackRouterVite(),\n    viteReact(),\n    tailwindcss()\n  ],\n});\n```\n\nNow you'll need to rearrange your files a little bit. That starts with creating a `routes` directory in the `src` directory:\n\n```bash\nmkdir src/routes\n```\n\nThen you'll need to create a `src/routes/__root.tsx` file with the contents of the root route that was in `main.tsx`.\n\n```tsx\nimport { Outlet, createRootRoute } from \"@tanstack/react-router\";\nimport { TanStackRouterDevtools } from \"@tanstack/react-router-devtools\";\n\nexport const Route = createRootRoute({\n  component: () =\u003e (\n    \u003c\u003e\n      \u003cOutlet /\u003e\n      \u003cTanStackRouterDevtools /\u003e\n    \u003c/\u003e\n  ),\n});\n```\n\nNext up you'll need to move your home route code into `src/routes/index.tsx`\n\n```tsx\nimport { createFileRoute } from \"@tanstack/react-router\";\n\nimport logo from \"../logo.svg\";\nimport \"../App.css\";\n\nexport const Route = createFileRoute(\"/\")({\n  component: App,\n});\n\nfunction App() {\n  return (\n    \u003cdiv className=\"text-center\"\u003e\n      \u003cheader className=\"min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)]\"\u003e\n        \u003cimg\n          src={logo}\n          className=\"h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]\"\n          alt=\"logo\"\n        /\u003e\n        \u003cp\u003e\n          Edit \u003ccode\u003esrc/App.tsx\u003c/code\u003e and save to reload.\n        \u003c/p\u003e\n        \u003ca\n          className=\"text-[#61dafb] hover:underline\"\n          href=\"https://reactjs.org\"\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n        \u003e\n          Learn React\n        \u003c/a\u003e\n        \u003ca\n          className=\"text-[#61dafb] hover:underline\"\n          href=\"https://tanstack.com\"\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n        \u003e\n          Learn TanStack\n        \u003c/a\u003e\n      \u003c/header\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\nAt this point you can delete `src/App.tsx`, you will no longer need it as the contents have moved into `src/routes/index.tsx`.\n\nThe only additional code is the `createFileRoute` function that tells TanStack Router where to render the route. Helpfully the Vite plugin will keep the path argument that goes to `createFileRoute` automatically in sync with the file system.\n\nFinally the `src/main.tsx` file can be simplified down to this:\n\n```tsx\nimport { StrictMode } from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport { RouterProvider, createRouter } from \"@tanstack/react-router\";\n\n// Import the generated route tree\nimport { routeTree } from \"./routeTree.gen\";\n\nimport \"./styles.css\";\nimport reportWebVitals from \"./reportWebVitals.ts\";\n\n// Create a new router instance\nconst router = createRouter({\n  routeTree,\n  defaultPreload: \"intent\",\n  defaultPreloadStaleTime: 0,\n  scrollRestoration: true,\n  defaultStructuralSharing: true\n});\n\n// Register the router instance for type safety\ndeclare module \"@tanstack/react-router\" {\n  interface Register {\n    router: typeof router;\n  }\n}\n\n// Render the app\nconst rootElement = document.getElementById(\"app\")!;\nif (!rootElement.innerHTML) {\n  const root = ReactDOM.createRoot(rootElement);\n  root.render(\n    \u003cStrictMode\u003e\n      \u003cRouterProvider router={router} /\u003e\n    \u003c/StrictMode\u003e\n  );\n}\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n```\n\nNow you've got a file based routing setup in your project! Let's have some fun with it! Just create a file in `about.tsx` in `src/routes` and it if the application is running TanStack will automatically add contents to the file and you'll have the start of your `/about` route ready to go with no additional work. You can see why folks find File Based Routing so easy to use.\n\nYou can find out everything you need to know on how to use file based routing in the [File Based Routing](https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing) documentation.\n\n## Data Fetching\n\nThere are multiple ways to fetch data in your application. You can use TanStack Query to fetch data from a server. But you can also use the `loader` functionality built into TanStack Router to load the data for a route before it's rendered.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n  getParentRoute: () =\u003e rootRoute,\n  path: \"/people\",\n  loader: async () =\u003e {\n    const response = await fetch(\"https://swapi.dev/api/people\");\n    return response.json() as Promise\u003c{\n      results: {\n        name: string;\n      }[];\n    }\u003e;\n  },\n  component: () =\u003e {\n    const data = peopleRoute.useLoaderData();\n    return (\n      \u003cul\u003e\n        {data.results.map((person) =\u003e (\n          \u003cli key={person.name}\u003e{person.name}\u003c/li\u003e\n        ))}\n      \u003c/ul\u003e\n    );\n  },\n});\n```\n\nLoaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#loader-parameters).\n\n### React-Query\n\nReact-Query is an excellent addition or alternative to route loading and integrating it into you application is a breeze.\n\nFirst add your dependencies:\n\n```bash\npnpm add @tanstack/react-query @tanstack/react-query-devtools\n```\n\nNext we'll need to create a query client and provider. We recommend putting those in `main.tsx`.\n\n```tsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n\n// ...\n\nconst queryClient = new QueryClient();\n\n// ...\n\nif (!rootElement.innerHTML) {\n  const root = ReactDOM.createRoot(rootElement);\n\n  root.render(\n    \u003cQueryClientProvider client={queryClient}\u003e\n      \u003cRouterProvider router={router} /\u003e\n    \u003c/QueryClientProvider\u003e\n  );\n}\n```\n\nYou can also add TanStack Query Devtools to the root route (optional).\n\n```tsx\nimport { ReactQueryDevtools } from \"@tanstack/react-query-devtools\";\n\nconst rootRoute = createRootRoute({\n  component: () =\u003e (\n    \u003c\u003e\n      \u003cOutlet /\u003e\n      \u003cReactQueryDevtools buttonPosition=\"top-right\" /\u003e\n      \u003cTanStackRouterDevtools /\u003e\n    \u003c/\u003e\n  ),\n});\n```\n\nNow you can use `useQuery` to fetch your data.\n\n```tsx\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport \"./App.css\";\n\nfunction App() {\n  const { data } = useQuery({\n    queryKey: [\"people\"],\n    queryFn: () =\u003e\n      fetch(\"https://swapi.dev/api/people\")\n        .then((res) =\u003e res.json())\n        .then((data) =\u003e data.results as { name: string }[]),\n    initialData: [],\n  });\n\n  return (\n    \u003cdiv\u003e\n      \u003cul\u003e\n        {data.map((person) =\u003e (\n          \u003cli key={person.name}\u003e{person.name}\u003c/li\u003e\n        ))}\n      \u003c/ul\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\nYou can find out everything you need to know on how to use React-Query in the [React-Query documentation](https://tanstack.com/query/latest/docs/framework/react/overview).\n\n## State Management\n\nAnother common requirement for React applications is state management. There are many options for state management in React. TanStack Store provides a great starting point for your project.\n\nFirst you need to add TanStack Store as a dependency:\n\n```bash\npnpm add @tanstack/store\n```\n\nNow let's create a simple counter in the `src/App.tsx` file as a demonstration.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nfunction App() {\n  const count = useStore(countStore);\n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={() =\u003e countStore.setState((n) =\u003e n + 1)}\u003e\n        Increment - {count}\n      \u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\nOne of the many nice features of TanStack Store is the ability to derive state from other state. That derived state will update when the base state updates.\n\nLet's check this out by doubling the count using derived state.\n\n```tsx\nimport { useStore } from \"@tanstack/react-store\";\nimport { Store, Derived } from \"@tanstack/store\";\nimport \"./App.css\";\n\nconst countStore = new Store(0);\n\nconst doubledStore = new Derived({\n  fn: () =\u003e countStore.state * 2,\n  deps: [countStore],\n});\ndoubledStore.mount();\n\nfunction App() {\n  const count = useStore(countStore);\n  const doubledCount = useStore(doubledStore);\n\n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={() =\u003e countStore.setState((n) =\u003e n + 1)}\u003e\n        Increment - {count}\n      \u003c/button\u003e\n      \u003cdiv\u003eDoubled - {doubledCount}\u003c/div\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\nWe use the `Derived` class to create a new store that is derived from another store. The `Derived` class has a `mount` method that will start the derived store updating.\n\nOnce we've created the derived store we can use it in the `App` component just like we would any other store using the `useStore` hook.\n\nYou can find out everything you need to know on how to use TanStack Store in the [TanStack Store documentation](https://tanstack.com/store/latest).\n\n# Demo files\n\nFiles prefixed with `demo` can be safely deleted. They are there to provide a starting point for you to play around with the features you've installed.\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fillright%2Fscooter-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fillright%2Fscooter-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fillright%2Fscooter-management/lists"}