{"id":26742563,"url":"https://github.com/aquaticcalf/file-system-router","last_synced_at":"2025-07-25T16:31:20.585Z","repository":{"id":278035276,"uuid":"934334844","full_name":"aquaticcalf/file-system-router","owner":"aquaticcalf","description":"a file based routing system for react router","archived":false,"fork":false,"pushed_at":"2025-03-15T19:37:09.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T06:18:37.451Z","etag":null,"topics":["based","file","react","router","routing"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/file-system-router","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aquaticcalf.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}},"created_at":"2025-02-17T16:52:43.000Z","updated_at":"2025-03-15T19:37:12.000Z","dependencies_parsed_at":"2025-02-17T17:26:19.761Z","dependency_job_id":"ade139d1-87e4-46a9-90e9-0fd9e6d4ef1e","html_url":"https://github.com/aquaticcalf/file-system-router","commit_stats":null,"previous_names":["aquaticcalf/file-system-router"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aquaticcalf","download_url":"https://codeload.github.com/aquaticcalf/file-system-router/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248931049,"owners_count":21185104,"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":["based","file","react","router","routing"],"created_at":"2025-03-28T06:18:40.386Z","updated_at":"2025-04-14T17:49:20.704Z","avatar_url":"https://github.com/aquaticcalf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## file system router\n\n### installation :\n\n```bash\nnpm install file-system-router\n```\n\n### usage in your app :\n\n```jsx\n// App.jsx\nimport { BrowserRouter as Router } from 'react-router-dom'\nimport { FileSystemRouter } from 'file-system-router'\n\n// vite users:\nconst pages = import.meta.glob('./pages/**/*.jsx', { eager: true })\n\n// webpack users:\n// const pages = require.context('./pages', true, /\\.jsx$/)\n\nexport default function App() {\n  return (\n    \u003cRouter\u003e\n      \u003cFileSystemRouter pages={pages} /\u003e\n    \u003c/Router\u003e\n  )\n}\n```\n\n### file structure convention :\n\n```\npages/\n  index.jsx           -\u003e /\n  about.jsx           -\u003e /about\n  blog/\n    index.jsx         -\u003e /blog\n    [id].jsx          -\u003e /blog/:id\n  author/\n    [author_name]/\n      name.jsx        -\u003e /author/:author_name/name\n```\n\n### features :\n\n1. automatically converts files to routes\n2. supports dynamic parameters with `[param].jsx`\n3. supports nested routes based on your file and directory structure, `[param]/example.jsx`\n4. handles index routes with `index.jsx`\n\n### for your page components :\n\n```jsx\n// pages/blog/[id].jsx\nimport { useParams } from 'react-router-dom'\n\nexport default function BlogPost() {\n    const { id } = useParams()\n    return \u003cdiv\u003eblog post : {id}\u003c/div\u003e\n}\n\n// pages/author/[author_name]/name.jsx\nimport { useParams } from 'react-router-dom'\n\nexport default function AuthorName() {\n    const { author_name } = useParams()\n    return \u003cdiv\u003eauthor name : {author_name}\u003c/div\u003e\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaticcalf%2Ffile-system-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faquaticcalf%2Ffile-system-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaticcalf%2Ffile-system-router/lists"}