mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-03 18:22:57 +00:00
4.5 KiB
4.5 KiB
📦 Installation Guide - MyUIbrix Elementor Features
Quick Setup
Step 1: Install Frontend Dependencies
cd frontend
npm install react-markdown react-syntax-highlighter
npm install --save-dev @types/react-syntax-highlighter
Step 2: Backend Routes Setup
Add to your main.go:
import "your-app/internal/controllers"
// Setup documentation routes
docsController := controllers.NewDocsController("./DOCS")
adminDocs := router.Group("/api/v1/admin/docs")
adminDocs.Use(middleware.RequireAuth())
adminDocs.Use(middleware.RequireAdmin())
{
adminDocs.GET("/file/*filepath", docsController.GetDocFile)
adminDocs.GET("/list", docsController.ListDocFiles)
adminDocs.GET("/search", docsController.SearchDocs)
}
Step 3: Add Admin Route
In your admin routes file (e.g., frontend/src/App.tsx):
import DevDocsPage from './pages/admin/DevDocsPage';
// Add route
<Route path="/admin/docs" element={<DevDocsPage />} />
Step 4: Add Navigation Link
In your admin navigation component:
import { FiBook } from 'react-icons/fi';
<NavLink to="/admin/docs">
<HStack>
<Icon as={FiBook} />
<Text>Developer Docs</Text>
</HStack>
</NavLink>
Step 5: Verify Files
Ensure all these files exist:
- ✅
frontend/src/components/editor/InlineTextEditor.tsx - ✅
frontend/src/components/editor/CustomCSSEditor.tsx - ✅
frontend/src/components/editor/ColumnLayoutManager.tsx - ✅
frontend/src/components/editor/ContextualAdminLinks.tsx - ✅
frontend/src/components/editor/VisualStylePanel.tsx(enhanced) - ✅
frontend/src/pages/admin/DevDocsPage.tsx - ✅
internal/controllers/docs_controller.go - ✅ All
.mdfiles in/DOCS
Testing
Test Documentation Viewer
- Navigate to
/admin/docs - Should see list of documentation files
- Click any document to view
- Test search functionality
- Try downloading a document
Test Elementor Features
- Go to any page (e.g., homepage)
- Add
?myuibrix=editto URL - Click edit button (bottom left)
- Select any element
- Test all 5 tabs:
- Content
- Style
- Layout
- CSS
- Admin
Test Inline Editor
- In edit mode, click any text
- Toolbar should appear
- Test Bold, Italic, Underline
- Test link insertion
- Changes should auto-save
Test Column Layouts
- Select element
- Open Layout tab
- Choose a template
- Element should split into columns
- Save and reload to verify persistence
Test Custom CSS
- Select element
- Open CSS tab
- Write custom CSS
- Enable preview
- Apply and save
Troubleshooting
"Module not found" errors
Solution: Install missing dependencies
npm install react-markdown react-syntax-highlighter
npm install --save-dev @types/react-syntax-highlighter
Documentation viewer shows "Document Not Found"
Solution: Check backend routes are configured and DOCS folder is accessible
Custom CSS not applying
Solution:
- Check for syntax errors
- Enable preview mode first
- Verify CSS is valid
- Check browser console for errors
Inline editor not appearing
Solution:
- Ensure element has proper
data-elementattribute - Check if edit mode is active
- Verify admin permissions
Configuration
Environment Variables
No additional environment variables needed.
Database
No database migrations required for these features.
Permissions
All features require admin authentication.
Deployment
Development
# Frontend
cd frontend
npm run dev
# Backend
go run main.go
Production
# Frontend
cd frontend
npm run build
# Backend
go build -o app main.go
./app
Docker
If using Docker, ensure DOCS folder is included:
COPY DOCS /app/DOCS
Uninstallation
To remove these features:
-
Remove frontend components:
rm frontend/src/components/editor/InlineTextEditor.tsx rm frontend/src/components/editor/CustomCSSEditor.tsx rm frontend/src/components/editor/ColumnLayoutManager.tsx rm frontend/src/components/editor/ContextualAdminLinks.tsx rm frontend/src/pages/admin/DevDocsPage.tsx -
Remove backend controller:
rm internal/controllers/docs_controller.go -
Remove routes from
main.go -
Remove navigation link
-
Revert
VisualStylePanel.tsxchanges
Support
For issues:
- Check
/admin/docsfor documentation - Review
COMPLETE_IMPLEMENTATION_SUMMARY.md - Check browser console for errors
- Verify all dependencies installed
Status: ✅ Ready for Installation