This repository serves as a template and development framework for creating TopLocs plugins. It demonstrates how to build plugins that integrate with the TopLocs decentralized community platform.
The demo-plugin repository shows how to:
- Create federated Vue.js components using Module Federation
- Integrate with Gun.js for decentralized data storage
- Build plugin UIs that match the TopLocs design system
- Test plugin functionality in isolation
demo-plugin/
├── demo-frontend/ # Plugin host application (for testing)
├── demo-plugin/ # Example plugin implementation
├── events-plugin/ # Event management plugin example
└── wiki-plugin/ # Wiki plugin example
git clone https://github.com/toplocs/demo-plugin.git
cd demo-plugin
pnpm installpnpm dev # Starts plugin host and example plugins- Copy one of the example plugins as a template
- Modify
vite.config.tsfor Module Federation - Update plugin components and data integration
- Test with the demo-frontend host
For comprehensive plugin development documentation, see:
Plugins use Webpack Module Federation to load dynamically:
// vite.config.ts
federation({
name: 'your-plugin',
filename: 'plugin.js',
exposes: {
'./Main': './src/components/Main.vue',
'./Settings': './src/components/Settings.vue'
},
shared: ['vue', 'tailwindcss']
})All plugins share the Gun.js decentralized database:
// Plugin data integration
gun.get('plugins').get('your-plugin').put(data)Standard plugin components:
- Main.vue - Primary plugin interface
- Settings.vue - Plugin configuration
- Sidebar.vue - Navigation integration
Demonstrates:
- Real-time event management
- Complex UI interactions
- Backend integration (optional)
Demonstrates:
- Content creation and editing
- Search functionality
- Collaborative features
Use the demo-frontend to test your plugins:
- Start the development environment
- Load your plugin in the host application
- Test federation, data integration, and UI components
This repository serves as the foundation for all TopLocs plugins. Improvements to the development framework benefit the entire plugin ecosystem.
- tribelike - Core TopLocs platform
- event-plugin - Production event management plugin
- wiki-plugin - Production wiki plugin
- location-plugin - Location management plugin
- link-plugin - Link sharing plugin
MIT License - See the main TopLocs project for details.