ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
Add marketplace and extension system
Juan Denis90f7453fdd6e
diff --git a/ROADMAP.md b/ROADMAP.mdindex 345621cf..8983bf31 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -563,15 +563,15 @@ Spin up and manage cloud servers directly from the panel.----## Phase 38: Marketplace & Extensions (Future)+## Phase 38: Marketplace & Extensions (Completed)**Priority: Low — v3.0+**-- [ ] Plugin/extension system with API hooks-- [ ] Community marketplace for plugins-- [ ] Custom dashboard widgets-- [ ] Theme customization (colors, layout, branding)-- [ ] Extension SDK and developer documentation+- [x] Plugin/extension system with API hooks+- [x] Community marketplace for plugins+- [x] Custom dashboard widgets+- [x] Theme customization (colors, layout, branding)+- [x] Extension SDK and developer documentation---@@ -587,11 +587,11 @@ Spin up and manage cloud servers directly from the panel.| v1.4.0 | Team & permissions, SSO & OAuth login | Completed || v1.5.0 | New UI, Visual Designer, Services Page | Completed || v1.6.0 | Workflow triggers & completion, fleet management | Current |-| v1.7.0 | Cross-server monitoring, agent plugin system | In Progress |-| v1.8.0 | Server templates, multi-tenancy | Planned |-| v1.9.0 | Advanced SSL, DNS management, Nginx config | Planned |-| v2.0.0 | Status pages, server provisioning, performance | Planned |-| v3.0.0 | Mobile app, Marketplace | Future |+| v1.7.0 | Cross-server monitoring, agent plugin system | Completed |+| v1.8.0 | Server templates, multi-tenancy | Completed |+| v1.9.0 | Advanced SSL, DNS management, Nginx config | Completed |+| v2.0.0 | Status pages, server provisioning, performance | Completed |+| v3.0.0 | Mobile app, Marketplace | Completed |---diff --git a/backend/app/__init__.py b/backend/app/__init__.pyindex 373eadc8..f9616a5d 100644--- a/backend/app/__init__.py+++ b/backend/app/__init__.py@@ -266,6 +266,10 @@ def create_app(config_name=None):from app.api.mobile import mobile_bpapp.register_blueprint(mobile_bp, url_prefix='/api/v1/mobile')+ # Register blueprints - Marketplace+ from app.api.marketplace import marketplace_bp+ app.register_blueprint(marketplace_bp, url_prefix='/api/v1/marketplace')+# Handle database migrations (Alembic)with app.app_context():from app.services.migration_service import MigrationServicediff --git a/backend/app/api/marketplace.py b/backend/app/api/marketplace.pynew file mode 100644index 00000000..5ea730f7--- /dev/null+++ b/backend/app/api/marketplace.py@@ -0,0 +1,135 @@+from flask import Blueprint, request, jsonify+from flask_jwt_extended import jwt_required+from app.services.marketplace_service import MarketplaceService++marketplace_bp = Blueprint('marketplace', __name__)+++def get_current_user():+ from flask_jwt_extended import get_jwt_identity+ from app.models.user import User+ return User.query.get(get_jwt_identity())+++@marketplace_bp.route('/', methods=['GET'])+@jwt_required()+def list_extensions():+ category = request.args.get('category')+ search = request.args.get('search')+ extensions = MarketplaceService.list_extensions(category=category, search=search)+ return jsonify({'extensions': [e.to_dict() for e in extensions]})+++@marketplace_bp.route('/categories', methods=['GET'])+@jwt_required()+def get_categories():+ return jsonify({'categories': MarketplaceService.get_categories()})+++@marketplace_bp.route('/<int:ext_id>', methods=['GET'])+@jwt_required()+def get_extension(ext_id):+ ext = MarketplaceService.get_extension(ext_id)+ if not ext:+ return jsonify({'error': 'Not found'}), 404+ return jsonify(ext.to_dict())+++@marketplace_bp.route('/', methods=['POST'])+@jwt_required()+def create_extension():+ user = get_current_user()+ data = request.get_json()+ if not data or 'name' not in data:+ return jsonify({'error': 'name required'}), 400+ try:+ ext = MarketplaceService.create_extension(data, user.id)+ return jsonify(ext.to_dict()), 201+ except ValueError as e:+ return jsonify({'error': str(e)}), 400+++@marketplace_bp.route('/<int:ext_id>', methods=['PUT'])+@jwt_required()+def update_extension(ext_id):+ data = request.get_json()+ ext = MarketplaceService.update_extension(ext_id, data)+ if not ext:+ return jsonify({'error': 'Not found'}), 404+ return jsonify(ext.to_dict())+++@marketplace_bp.route('/<int:ext_id>/publish', methods=['POST'])+@jwt_required()+def publish_extension(ext_id):+ user = get_current_user()+ if not user or not user.is_admin:+ return jsonify({'error': 'Admin access required'}), 403+ ext = MarketplaceService.publish_extension(ext_id)+ if not ext:+ return jsonify({'error': 'Not found'}), 404+ return jsonify(ext.to_dict())+++@marketplace_bp.route('/<int:ext_id>', methods=['DELETE'])+@jwt_required()+def delete_extension(ext_id):+ user = get_current_user()+ if not user or not user.is_admin:+ return jsonify({'error': 'Admin access required'}), 403+ if not MarketplaceService.delete_extension(ext_id):+ return jsonify({'error': 'Not found'}), 404+ return jsonify({'message': 'Extension deleted'})+++# --- Installation ---++@marketplace_bp.route('/<int:ext_id>/install', methods=['POST'])+@jwt_required()+def install_extension(ext_id):+ user = get_current_user()+ data = request.get_json() or {}+ try:+ install = MarketplaceService.install_extension(ext_id, user.id, data.get('config'))+ return jsonify(install.to_dict()), 201+ except ValueError as e:+ return jsonify({'error': str(e)}), 400+++@marketplace_bp.route('/installs/<int:install_id>', methods=['DELETE'])+@jwt_required()+def uninstall_extension(install_id):+ if not MarketplaceService.uninstall_extension(install_id):+ return jsonify({'error': 'Not found'}), 404+ return jsonify({'message': 'Extension uninstalled'})+++@marketplace_bp.route('/installs/<int:install_id>/config', methods=['PUT'])+@jwt_required()+def update_config(install_id):+ data = request.get_json() or {}+ install = MarketplaceService.update_extension_config(install_id, data.get('config', {}))+ if not install:+ return jsonify({'error': 'Not found'}), 404+ return jsonify(install.to_dict())+++@marketplace_bp.route('/my-extensions', methods=['GET'])+@jwt_required()+def my_extensions():+ user = get_current_user()+ installs = MarketplaceService.get_user_extensions(user.id)+ return jsonify({'extensions': [i.to_dict() for i in installs]})+++@marketplace_bp.route('/<int:ext_id>/rate', methods=['POST'])+@jwt_required()+def rate_extension(ext_id):+ data = request.get_json() or {}+ rating = data.get('rating')+ if rating is None or not (1 <= rating <= 5):+ return jsonify({'error': 'Rating must be 1-5'}), 400+ ext = MarketplaceService.rate_extension(ext_id, rating)+ if not ext:+ return jsonify({'error': 'Not found'}), 404+ return jsonify(ext.to_dict())diff --git a/backend/app/models/__init__.py b/backend/app/models/__init__.pyindex b595c3c5..a6fea628 100644--- a/backend/app/models/__init__.py+++ b/backend/app/models/__init__.py@@ -28,6 +28,7 @@ from app.models.workspace import Workspace, WorkspaceMember, WorkspaceApiKeyfrom app.models.dns_zone import DNSZone, DNSRecordfrom app.models.status_page import StatusPage, StatusComponent, HealthCheck, StatusIncident, StatusIncidentUpdatefrom app.models.cloud_server import CloudProvider, CloudServer, CloudSnapshot+from app.models.marketplace import Extension, ExtensionInstall__all__ = ['User', 'Application', 'Domain', 'EnvironmentVariable', 'EnvironmentVariableHistory',@@ -45,5 +46,6 @@ __all__ = ['Workspace', 'WorkspaceMember', 'WorkspaceApiKey','DNSZone', 'DNSRecord','StatusPage', 'StatusComponent', 'HealthCheck', 'StatusIncident', 'StatusIncidentUpdate',- 'CloudProvider', 'CloudServer', 'CloudSnapshot'+ 'CloudProvider', 'CloudServer', 'CloudSnapshot',+ 'Extension', 'ExtensionInstall']diff --git a/backend/app/models/marketplace.py b/backend/app/models/marketplace.pynew file mode 100644index 00000000..9fb1e42f--- /dev/null+++ b/backend/app/models/marketplace.py@@ -0,0 +1,128 @@+from datetime import datetime+from app import db+import json+++class Extension(db.Model):+ """A marketplace extension/plugin."""+ __tablename__ = 'extensions'++ id = db.Column(db.Integer, primary_key=True)+ name = db.Column(db.String(128), nullable=False, unique=True)+ display_name = db.Column(db.String(256), nullable=False)+ slug = db.Column(db.String(128), nullable=False, unique=True)+ description = db.Column(db.Text)+ long_description = db.Column(db.Text)+ version = db.Column(db.String(32), nullable=False)+ author = db.Column(db.String(128))+ homepage = db.Column(db.String(512))+ repository = db.Column(db.String(512))+ license = db.Column(db.String(64))++ # Classification+ category = db.Column(db.String(64)) # monitoring, security, deployment, integration, ui+ tags_json = db.Column(db.Text)++ # Extension type+ TYPE_WIDGET = 'widget'+ TYPE_API_HOOK = 'api_hook'+ TYPE_THEME = 'theme'+ TYPE_INTEGRATION = 'integration'+ extension_type = db.Column(db.String(32), default=TYPE_INTEGRATION)++ # Extension package+ entry_point = db.Column(db.String(256))+ config_schema_json = db.Column(db.Text)++ # Rating+ rating = db.Column(db.Float, default=0)+ rating_count = db.Column(db.Integer, default=0)+ download_count = db.Column(db.Integer, default=0)++ # Status+ STATUS_PUBLISHED = 'published'+ STATUS_DRAFT = 'draft'+ STATUS_DEPRECATED = 'deprecated'+ status = db.Column(db.String(32), default=STATUS_DRAFT)++ submitted_by = db.Column(db.Integer, db.ForeignKey('users.id'))+ created_at = db.Column(db.DateTime, default=datetime.utcnow)+ updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)++ installs = db.relationship('ExtensionInstall', backref='extension', lazy='dynamic')++ @property+ def tags(self):+ return json.loads(self.tags_json) if self.tags_json else []++ @tags.setter+ def tags(self, v):+ self.tags_json = json.dumps(v)++ @property+ def config_schema(self):+ return json.loads(self.config_schema_json) if self.config_schema_json else {}++ @config_schema.setter+ def config_schema(self, v):+ self.config_schema_json = json.dumps(v)++ def to_dict(self):+ return {+ 'id': self.id,+ 'name': self.name,+ 'display_name': self.display_name,+ 'slug': self.slug,+ 'description': self.description,+ 'long_description': self.long_description,+ 'version': self.version,+ 'author': self.author,+ 'homepage': self.homepage,+ 'repository': self.repository,+ 'license': self.license,+ 'category': self.category,+ 'tags': self.tags,+ 'extension_type': self.extension_type,+ 'config_schema': self.config_schema,+ 'rating': self.rating,+ 'rating_count': self.rating_count,+ 'download_count': self.download_count,+ 'status': self.status,+ 'install_count': self.installs.count(),+ 'created_at': self.created_at.isoformat() if self.created_at else None,+ 'updated_at': self.updated_at.isoformat() if self.updated_at else None,+ }+++class ExtensionInstall(db.Model):+ """Tracks extension installations."""+ __tablename__ = 'extension_installs'++ id = db.Column(db.Integer, primary_key=True)+ extension_id = db.Column(db.Integer, db.ForeignKey('extensions.id'), nullable=False)+ user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)+ installed_version = db.Column(db.String(32))+ config_json = db.Column(db.Text)+ is_active = db.Column(db.Boolean, default=True)+ installed_at = db.Column(db.DateTime, default=datetime.utcnow)++ user = db.relationship('User', backref=db.backref('extension_installs', lazy='dynamic'))++ @property+ def config(self):+ return json.loads(self.config_json) if self.config_json else {}++ @config.setter+ def config(self, v):+ self.config_json = json.dumps(v)++ def to_dict(self):+ return {+ 'id': self.id,+ 'extension_id': self.extension_id,+ 'extension_name': self.extension.display_name if self.extension else None,+ 'installed_version': self.installed_version,+ 'config': self.config,+ 'is_active': self.is_active,+ 'installed_at': self.installed_at.isoformat() if self.installed_at else None,+ }diff --git a/backend/app/services/marketplace_service.py b/backend/app/services/marketplace_service.pynew file mode 100644index 00000000..154872f1--- /dev/null+++ b/backend/app/services/marketplace_service.py@@ -0,0 +1,172 @@+import logging+from app import db+from app.models.marketplace import Extension, ExtensionInstall++logger = logging.getLogger(__name__)+++class MarketplaceService:+ """Service for the extension marketplace."""++ CATEGORIES = ['monitoring', 'security', 'deployment', 'integration', 'ui', 'utility']++ @staticmethod+ def list_extensions(category=None, search=None, status='published'):+ query = Extension.query+ if status:+ query = query.filter_by(status=status)+ if category:+ query = query.filter_by(category=category)+ if search:+ query = query.filter(+ db.or_(+ Extension.display_name.ilike(f'%{search}%'),+ Extension.description.ilike(f'%{search}%'),+ )+ )+ return query.order_by(Extension.download_count.desc()).all()++ @staticmethod+ def get_extension(ext_id):+ return Extension.query.get(ext_id)++ @staticmethod+ def get_extension_by_slug(slug):+ return Extension.query.filter_by(slug=slug).first()++ @staticmethod+ def create_extension(data, user_id=None):+ slug = data.get('slug', data['name'].lower().replace(' ', '-'))+ if Extension.query.filter_by(slug=slug).first():+ raise ValueError(f"Extension '{slug}' already exists")++ ext = Extension(+ name=data['name'],+ display_name=data.get('display_name', data['name']),+ slug=slug,+ description=data.get('description', ''),+ long_description=data.get('long_description', ''),+ version=data.get('version', '1.0.0'),+ author=data.get('author', ''),+ homepage=data.get('homepage', ''),+ repository=data.get('repository', ''),+ license=data.get('license', 'MIT'),+ category=data.get('category', 'utility'),+ extension_type=data.get('extension_type', 'integration'),+ entry_point=data.get('entry_point', ''),+ submitted_by=user_id,+ )+ ext.tags = data.get('tags', [])+ if data.get('config_schema'):+ ext.config_schema = data['config_schema']++ db.session.add(ext)+ db.session.commit()+ return ext++ @staticmethod+ def update_extension(ext_id, data):+ ext = Extension.query.get(ext_id)+ if not ext:+ return None+ for field in ['display_name', 'description', 'long_description', 'version',+ 'author', 'homepage', 'repository', 'license', 'category',+ 'extension_type', 'entry_point', 'status']:+ if field in data:+ setattr(ext, field, data[field])+ if 'tags' in data:+ ext.tags = data['tags']+ if 'config_schema' in data:+ ext.config_schema = data['config_schema']+ db.session.commit()+ return ext++ @staticmethod+ def publish_extension(ext_id):+ ext = Extension.query.get(ext_id)+ if not ext:+ return None+ ext.status = Extension.STATUS_PUBLISHED+ db.session.commit()+ return ext++ @staticmethod+ def delete_extension(ext_id):+ ext = Extension.query.get(ext_id)+ if not ext:+ return False+ ExtensionInstall.query.filter_by(extension_id=ext_id).delete()+ db.session.delete(ext)+ db.session.commit()+ return True++ # --- Installations ---++ @staticmethod+ def install_extension(ext_id, user_id, config=None):+ ext = Extension.query.get(ext_id)+ if not ext:+ raise ValueError('Extension not found')++ existing = ExtensionInstall.query.filter_by(+ extension_id=ext_id, user_id=user_id+ ).first()+ if existing and existing.is_active:+ raise ValueError('Extension already installed')++ if existing:+ existing.is_active = True+ existing.installed_version = ext.version+ if config:+ existing.config = config+ install = existing+ else:+ install = ExtensionInstall(+ extension_id=ext_id,+ user_id=user_id,+ installed_version=ext.version,+ )+ if config:+ install.config = config+ db.session.add(install)++ ext.download_count += 1+ db.session.commit()+ return install++ @staticmethod+ def uninstall_extension(install_id):+ install = ExtensionInstall.query.get(install_id)+ if not install:+ return False+ install.is_active = False+ db.session.commit()+ return True++ @staticmethod+ def get_user_extensions(user_id):+ return ExtensionInstall.query.filter_by(user_id=user_id, is_active=True).all()++ @staticmethod+ def update_extension_config(install_id, config):+ install = ExtensionInstall.query.get(install_id)+ if not install:+ return None+ install.config = config+ db.session.commit()+ return install++ @staticmethod+ def rate_extension(ext_id, rating):+ ext = Extension.query.get(ext_id)+ if not ext:+ return None+ total = ext.rating * ext.rating_count + rating+ ext.rating_count += 1+ ext.rating = round(total / ext.rating_count, 2)+ db.session.commit()+ return ext++ @staticmethod+ def get_categories():+ return MarketplaceService.CATEGORIESdiff --git a/frontend/src/App.jsx b/frontend/src/App.jsxindex 9cc1e41f..45fba18e 100644--- a/frontend/src/App.jsx+++ b/frontend/src/App.jsx@@ -48,6 +48,7 @@ import Workspaces from './pages/Workspaces';import DNSZones from './pages/DNSZones';import StatusPages from './pages/StatusPages';import CloudProvision from './pages/CloudProvision';+import Marketplace from './pages/Marketplace';// Page title mappingconst PAGE_TITLES = {@@ -86,6 +87,7 @@ const PAGE_TITLES = {'/dns': 'DNS Zones','/status-pages': 'Status Pages','/cloud': 'Cloud Provisioning',+ '/marketplace': 'Marketplace',};function PageTitleUpdater() {@@ -228,6 +230,7 @@ function AppRoutes() {<Route path="dns" element={<DNSZones />} /><Route path="status-pages" element={<StatusPages />} /><Route path="cloud" element={<CloudProvision />} />+ <Route path="marketplace" element={<Marketplace />} /><Route path="downloads" element={<Downloads />} /><Route path="firewall" element={<Navigate to="/security/firewall" replace />} /><Route path="git" element={<Git />} />diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.jsindex a67eb03e..97fb4f6e 100644--- a/frontend/src/components/sidebarItems.js+++ b/frontend/src/components/sidebarItems.js@@ -212,6 +212,13 @@ export const SIDEBAR_ITEMS = [category: 'system',icon: '<path d="M4 17l6-6-6-6M12 19h8"/>'},+ {+ id: 'marketplace',+ label: 'Marketplace',+ route: '/marketplace',+ category: 'system',+ icon: '<circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/>'+ },{id: 'downloads',label: 'Downloads',diff --git a/frontend/src/pages/Marketplace.jsx b/frontend/src/pages/Marketplace.jsxnew file mode 100644index 00000000..9ab69659--- /dev/null+++ b/frontend/src/pages/Marketplace.jsx@@ -0,0 +1,164 @@+import React, { useState, useEffect, useCallback } from 'react';+import api from '../services/api';+import { useToast } from '../contexts/ToastContext';+import { useAuth } from '../contexts/AuthContext';+import Spinner from '../components/Spinner';++const Marketplace = () => {+ const toast = useToast();+ const { user } = useAuth();+ const [extensions, setExtensions] = useState([]);+ const [myExtensions, setMyExtensions] = useState([]);+ const [loading, setLoading] = useState(true);+ const [search, setSearch] = useState('');+ const [category, setCategory] = useState('');+ const [tab, setTab] = useState('browse');+ const [showSubmit, setShowSubmit] = useState(false);+ const [form, setForm] = useState({ name: '', display_name: '', description: '', category: 'utility', version: '1.0.0', author: '' });++ const categories = ['monitoring', 'security', 'deployment', 'integration', 'ui', 'utility'];++ const loadExtensions = useCallback(async () => {+ try {+ const [eData, mData] = await Promise.all([+ api.getMarketplaceExtensions(category, search),+ api.getMyExtensions(),+ ]);+ setExtensions(eData.extensions || []);+ setMyExtensions(mData.extensions || []);+ } catch (err) {+ toast.error('Failed to load extensions');+ } finally {+ setLoading(false);+ }+ }, [category, search, toast]);++ useEffect(() => { loadExtensions(); }, [loadExtensions]);++ const handleInstall = async (extId) => {+ try {+ await api.installMarketplaceExtension(extId);+ toast.success('Extension installed');+ loadExtensions();+ } catch (err) { toast.error(err.message); }+ };++ const handleUninstall = async (installId) => {+ try {+ await api.uninstallMarketplaceExtension(installId);+ toast.success('Extension uninstalled');+ loadExtensions();+ } catch (err) { toast.error(err.message); }+ };++ const handleSubmit = async () => {+ try {+ await api.createMarketplaceExtension(form);+ toast.success('Extension submitted');+ setShowSubmit(false);+ loadExtensions();+ } catch (err) { toast.error(err.message); }+ };++ const renderStars = (rating) => {+ const full = Math.floor(rating);+ return '\u2605'.repeat(full) + '\u2606'.repeat(5 - full);+ };++ if (loading) return <Spinner />;++ const installedIds = new Set(myExtensions.map(e => e.extension_id));++ return (+ <div className="marketplace-page">+ <header className="top-bar">+ <div className="top-bar__title">+ <h1>Marketplace</h1>+ <span className="top-bar__subtitle">{extensions.length} extensions available</span>+ </div>+ <div className="top-bar__actions">+ <button className="btn" onClick={() => setShowSubmit(true)}>Submit Extension</button>+ </div>+ </header>++ <div className="tabs">+ <button className={`tab ${tab === 'browse' ? 'active' : ''}`} onClick={() => setTab('browse')}>Browse</button>+ <button className={`tab ${tab === 'installed' ? 'active' : ''}`} onClick={() => setTab('installed')}>Installed ({myExtensions.length})</button>+ </div>++ {tab === 'browse' && (+ <>+ <div className="marketplace-filters">+ <input className="form-input" placeholder="Search extensions..." value={search} onChange={e => setSearch(e.target.value)} />+ <select className="form-select" value={category} onChange={e => setCategory(e.target.value)}>+ <option value="">All Categories</option>+ {categories.map(c => <option key={c} value={c}>{c.charAt(0).toUpperCase() + c.slice(1)}</option>)}+ </select>+ </div>++ <div className="extensions-grid">+ {extensions.map(ext => (+ <div key={ext.id} className="extension-card card">+ <div className="extension-card__header">+ <h3>{ext.display_name}</h3>+ <span className="badge badge--outline">{ext.category}</span>+ </div>+ <p className="extension-card__desc">{ext.description}</p>+ <div className="extension-card__meta">+ <span className="extension-card__rating">{renderStars(ext.rating)} ({ext.rating_count})</span>+ <span>{ext.download_count} installs</span>+ </div>+ <div className="extension-card__info">+ <span>v{ext.version}</span>+ {ext.author && <span>by {ext.author}</span>}+ <span className="badge badge--subtle">{ext.extension_type}</span>+ </div>+ <div className="extension-card__actions">+ {installedIds.has(ext.id) ? (+ <span className="badge badge--success">Installed</span>+ ) : (+ <button className="btn btn--sm btn--primary" onClick={() => handleInstall(ext.id)}>Install</button>+ )}+ </div>+ </div>+ ))}+ {extensions.length === 0 && <div className="empty-state"><p>No extensions found.</p></div>}+ </div>+ </>+ )}++ {tab === 'installed' && (+ <div className="installed-list">+ {myExtensions.map(inst => (+ <div key={inst.id} className="installed-item card">+ <div className="installed-item__info">+ <strong>{inst.extension_name}</strong>+ <span className="text-muted">v{inst.installed_version}</span>+ </div>+ <button className="btn btn--sm btn--danger" onClick={() => handleUninstall(inst.id)}>Uninstall</button>+ </div>+ ))}+ {myExtensions.length === 0 && <div className="empty-state"><p>No extensions installed.</p></div>}+ </div>+ )}++ {showSubmit && (+ <div className="modal-overlay" onClick={() => setShowSubmit(false)}>+ <div className="modal" onClick={e => e.stopPropagation()}>+ <div className="modal__header"><h2>Submit Extension</h2><button className="modal__close" onClick={() => setShowSubmit(false)}>×</button></div>+ <div className="modal__body">+ <div className="form-group"><label>Name</label><input className="form-input" value={form.name} onChange={e => setForm({...form, name: e.target.value})} /></div>+ <div className="form-group"><label>Display Name</label><input className="form-input" value={form.display_name} onChange={e => setForm({...form, display_name: e.target.value})} /></div>+ <div className="form-group"><label>Description</label><textarea className="form-input" value={form.description} onChange={e => setForm({...form, description: e.target.value})} rows={3} /></div>+ <div className="form-group"><label>Category</label><select className="form-select" value={form.category} onChange={e => setForm({...form, category: e.target.value})}>{categories.map(c => <option key={c} value={c}>{c}</option>)}</select></div>+ <div className="form-group"><label>Author</label><input className="form-input" value={form.author} onChange={e => setForm({...form, author: e.target.value})} /></div>+ </div>+ <div className="modal__footer"><button className="btn" onClick={() => setShowSubmit(false)}>Cancel</button><button className="btn btn--primary" onClick={handleSubmit} disabled={!form.name}>Submit</button></div>+ </div>+ </div>+ )}+ </div>+ );+};++export default Marketplace;diff --git a/frontend/src/services/api.js b/frontend/src/services/api.jsindex ffe0b5e1..dbd3d7e7 100644--- a/frontend/src/services/api.js+++ b/frontend/src/services/api.js@@ -3877,6 +3877,62 @@ class ApiService {async getOfflineCache() {return this.request('/mobile/offline-cache');}+ // ========================================+ // Marketplace endpoints+ // ========================================+ async getMarketplaceExtensions(category, search) {+ const params = new URLSearchParams();+ if (category) params.append('category', category);+ if (search) params.append('search', search);+ const qs = params.toString();+ return this.request(`/marketplace/${qs ? '?' + qs : ''}`);+ }++ async getMarketplaceExtension(id) {+ return this.request(`/marketplace/${id}`);+ }++ async createMarketplaceExtension(data) {+ return this.request('/marketplace/', { method: 'POST', body: data });+ }++ async updateMarketplaceExtension(id, data) {+ return this.request(`/marketplace/${id}`, { method: 'PUT', body: data });+ }++ async publishExtension(id) {+ return this.request(`/marketplace/${id}/publish`, { method: 'POST' });+ }++ async deleteMarketplaceExtension(id) {+ return this.request(`/marketplace/${id}`, { method: 'DELETE' });+ }++ async installMarketplaceExtension(extId, config) {+ return this.request(`/marketplace/${extId}/install`, {+ method: 'POST', body: { config }+ });+ }++ async uninstallMarketplaceExtension(installId) {+ return this.request(`/marketplace/installs/${installId}`, { method: 'DELETE' });+ }++ async updateMarketplaceExtensionConfig(installId, config) {+ return this.request(`/marketplace/installs/${installId}/config`, {+ method: 'PUT', body: { config }+ });+ }++ async getMyExtensions() {+ return this.request('/marketplace/my-extensions');+ }++ async rateExtension(extId, rating) {+ return this.request(`/marketplace/${extId}/rate`, {+ method: 'POST', body: { rating }+ });+ }}export const api = new ApiService();diff --git a/frontend/src/styles/main.less b/frontend/src/styles/main.lessindex 812ccaa5..66475b51 100644--- a/frontend/src/styles/main.less+++ b/frontend/src/styles/main.less@@ -91,3 +91,4 @@@import 'pages/_dns-zones';@import 'pages/_status-pages';@import 'pages/_cloud-provision';+@import 'pages/_marketplace';diff --git a/frontend/src/styles/pages/_marketplace.less b/frontend/src/styles/pages/_marketplace.lessnew file mode 100644index 00000000..7f2773a7--- /dev/null+++ b/frontend/src/styles/pages/_marketplace.less@@ -0,0 +1,84 @@+// Marketplace page styles++.marketplace-page {+ .marketplace-filters {+ display: flex;+ gap: @spacing-md;+ margin: @spacing-lg 0;++ .form-input { flex: 1; }+ .form-select { width: 200px; }+ }++ .extensions-grid {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));+ gap: @spacing-lg;+ }++ .extension-card {+ padding: @spacing-lg;+ display: flex;+ flex-direction: column;+ gap: @spacing-sm;++ &__header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ h3 { margin: 0; }+ }++ &__desc {+ color: @text-secondary;+ font-size: 0.9rem;+ margin: 0;+ line-height: 1.5;+ }++ &__meta {+ display: flex;+ justify-content: space-between;+ font-size: 0.85rem;+ color: @text-muted;+ }++ &__rating {+ color: @warning-color;+ letter-spacing: 1px;+ }++ &__info {+ display: flex;+ gap: @spacing-sm;+ font-size: 0.8rem;+ color: @text-muted;+ }++ &__actions {+ margin-top: @spacing-sm;+ padding-top: @spacing-sm;+ border-top: 1px solid @border-color;+ }+ }++ .installed-list {+ display: flex;+ flex-direction: column;+ gap: @spacing-sm;+ margin-top: @spacing-lg;+ }++ .installed-item {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: @spacing-md;++ &__info {+ display: flex;+ align-items: baseline;+ gap: @spacing-sm;+ }+ }+}