{"id":31703860,"url":"https://github.com/yalogica/react-plugin-lab","last_synced_at":"2025-10-08T22:45:04.900Z","repository":{"id":317067063,"uuid":"1065854184","full_name":"yalogica/react-plugin-lab","owner":"yalogica","description":"A learning React application with a plugin-based architecture","archived":false,"fork":false,"pushed_at":"2025-09-28T15:15:47.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T17:31:29.434Z","etag":null,"topics":["bolierplate","plugin-architecture","react","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yalogica.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-28T15:03:04.000Z","updated_at":"2025-09-28T15:16:28.000Z","dependencies_parsed_at":"2025-09-28T17:33:13.908Z","dependency_job_id":null,"html_url":"https://github.com/yalogica/react-plugin-lab","commit_stats":null,"previous_names":["yalogica/react-plugin-lab"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/yalogica/react-plugin-lab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalogica%2Freact-plugin-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalogica%2Freact-plugin-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalogica%2Freact-plugin-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalogica%2Freact-plugin-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yalogica","download_url":"https://codeload.github.com/yalogica/react-plugin-lab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalogica%2Freact-plugin-lab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000778,"owners_count":26082851,"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-10-08T02:00:06.501Z","response_time":56,"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":["bolierplate","plugin-architecture","react","typescript"],"created_at":"2025-10-08T22:45:00.682Z","updated_at":"2025-10-08T22:45:04.896Z","avatar_url":"https://github.com/yalogica.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Plugin Lab\n\nA minimal, educational React application demonstrating a **plugin-based architecture** using TypeScript, React Context, and dynamic imports.\nPerfect for learning how to build extensible frontend applications where features can be added or removed as independent plugins.\n\n## Features\n\n- **Plugin contract**: Each plugin is a self-contained React component with optional metadata.\n- **Dynamic loading**: Plugins are loaded asynchronously at runtime using `import()`.\n- **Context-based registry**: Plugins are shared across the app via React Context.\n- **Type-safe**: Full TypeScript support with clear interfaces.\n- **Zero build-time coupling**: Core app doesn’t need to know about plugins in advance.\n\n## 📁 Project Structure\n\n```\nsrc/\n├── plugins/               # Plugin implementations\n│   ├── GreetingPlugin.tsx\n│   └── AnalyticsPlugin.tsx\n├── types/plugin.ts        # Plugin interfaces\n├── PluginContext.tsx      # React Context for plugins\n├── pluginLoader.ts        # Dynamic plugin loader\n├── App.tsx                # Main UI that renders plugins\n└── main.tsx               # App entry point\n```\n\n## Getting Started\n\n### Installation\n\n```bash\ngit clone https://github.com/yalogica/react-plugin-lab.git\ncd react-plugin-lab\nnpm install\n```\n\n### Development\n\n```bash\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) to view the app.\n\n### Build\n\n```bash\nnpm run build\n```\n\nOutputs production-ready files to the `dist/` folder.\n\n\n## How It Works\n\n1. **Define a plugin** as a default-exported React component with optional `meta`:\n\n   ```tsx\n   // src/plugins/MyPlugin.tsx\n   export const meta = { id: 'my-plugin', name: 'My Plugin' };\n   export default function MyPlugin() {\n     return \u003cdiv\u003eHello from My Plugin!\u003c/div\u003e;\n   }\n   ```\n\n2. **Register the plugin path** in `pluginLoader.ts`.\n\n3. The app **dynamically imports** all plugins on startup.\n\n4. Plugins are **rendered automatically** in `App.tsx` using the `usePlugins()` hook.\n\n\n## Adding a New Plugin\n\n1. Create a new file in `src/plugins/`, e.g., `WeatherPlugin.tsx`.\n2. Export a default React component and (optionally) a `meta` object.\n3. Add its path to the `pluginPaths` array in `src/pluginLoader.ts`.\n4. That’s it! The plugin will appear on the dashboard.\n\n## Learning Goals\n\nThis project illustrates key concepts:\n- Dynamic imports (`import()`)\n- React Context for global state\n- TypeScript interfaces for contracts\n- Decoupled, modular frontend architecture\n\n## License\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyalogica%2Freact-plugin-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyalogica%2Freact-plugin-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyalogica%2Freact-plugin-lab/lists"}