Skip to content

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.

refactor(marketplace): retire the legacy Extension catalog (#51)

Juan Denis136f8b195a78
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a751ea7b..41dad14d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,14 @@ and the project aims to follow [Semantic Versioning](https://semver.org/spec/v2.
The `dev` branch is well ahead of the last `main` release. The headline work
awaiting a stable release:
+### Removed
+
+- **Legacy marketplace catalog** — the DB-seeded `Extension`/`ExtensionInstall`
+ catalog (a third, always-empty lane in Marketplace Browse) was retired. Browse
+ now has exactly the real sources: bundled built-ins, the remote registry, and
+ installed-plugin state. The orphaned `extensions`/`extension_installs` tables
+ are dropped by migration 046 (they never held real data — nothing seeded them).
+
### Added
- **Extensions platform (Phase 7 — scheduled update checks)** — the panel now
diff --git a/backend/app/api/marketplace.py b/backend/app/api/marketplace.py
index 21871362..7c2dd53f 100644
--- a/backend/app/api/marketplace.py
+++ b/backend/app/api/marketplace.py
@@ -1,6 +1,13 @@
-from flask import Blueprint, request, jsonify
+"""Marketplace API — the extension registry surface.
+
+The legacy DB-seeded ``Extension``/``ExtensionInstall`` catalog was retired
+(#51): nothing ever populated it on a real panel, so it fed Browse an empty
+third lane that was redundant with the three real sources — the builtin
+folder scan (``/plugins/builtin``), the remote registry (below), and live
+``InstalledPlugin`` state. This blueprint now serves only the registry.
+"""
+from flask import Blueprint, jsonify
from flask_jwt_extended import jwt_required
-from app.services.marketplace_service import MarketplaceService
from app.services.audit_service import AuditService
from app.models.audit_log import AuditLog
@@ -13,22 +20,6 @@ def get_current_user():
return User.query.get(get_jwt_identity())
-@marketplace_bp.route('', methods=['GET'])
-@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('/registry', methods=['GET'])
@jwt_required()
def list_registry():
@@ -68,191 +59,3 @@ def install_registry(slug):
ref = uuid.uuid4().hex[:8]
logging.getLogger(__name__).exception('Registry install failed (ref=%s)', ref)
return jsonify({'error': 'Installation failed. Check server logs.', 'ref': ref}), 500
-
-
-@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'])
-@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)
- AuditService.log(
- action=AuditLog.ACTION_RESOURCE_CREATE,
- user_id=user.id,
- target_type='marketplace_extension',
- target_id=ext.id,
- details={'name': ext.name, 'slug': ext.slug, 'version': ext.version},
- )
- 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):
- user = get_current_user()
- if not user or not user.is_admin:
- return jsonify({'error': 'Admin access required'}), 403
- data = request.get_json()
- ext = MarketplaceService.update_extension(ext_id, data)
- if not ext:
- return jsonify({'error': 'Not found'}), 404
- AuditService.log(
- action=AuditLog.ACTION_RESOURCE_UPDATE,
- user_id=user.id,
- target_type='marketplace_extension',
- target_id=ext.id,
- details={'name': ext.name, 'slug': ext.slug, 'updated_fields': sorted((data or {}).keys())},
- )
- 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
- AuditService.log(
- action=AuditLog.ACTION_RESOURCE_UPDATE,
- user_id=user.id,
- target_type='marketplace_extension',
- target_id=ext.id,
- details={'name': ext.name, 'slug': ext.slug, 'status': ext.status, 'operation': 'publish'},
- )
- 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
- ext = MarketplaceService.get_extension(ext_id)
- audit_details = {'name': ext.name if ext else None, 'slug': ext.slug if ext else None}
- if not MarketplaceService.delete_extension(ext_id):
- return jsonify({'error': 'Not found'}), 404
- AuditService.log(
- action=AuditLog.ACTION_RESOURCE_DELETE,
- user_id=user.id,
- target_type='marketplace_extension',
- target_id=ext_id,
- details=audit_details,
- )
- 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()
- # Marketplace installs now trigger a real plugin install when the
- # extension carries a source URL — that runs arbitrary downloaded
- # code and writes to disk, so it must require admin. /plugins/install
- # already enforces this; we mirror the check here.
- if not user or not user.is_admin:
- return jsonify({'error': 'Admin access required'}), 403
- data = request.get_json() or {}
- try:
- install = MarketplaceService.install_extension(ext_id, user.id, data.get('config'))
- AuditService.log(
- action=AuditLog.ACTION_RESOURCE_INSTALL,
- user_id=user.id,
- target_type='marketplace_extension',
- target_id=ext_id,
- details={
- 'install_id': install.id,
- 'extension_id': install.extension_id,
- 'extension_name': install.extension.display_name if install.extension else None,
- 'version': install.installed_version,
- },
- )
- 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):
- user = get_current_user()
- if not user or not user.is_admin:
- return jsonify({'error': 'Admin access required'}), 403
- install = MarketplaceService.get_install(install_id)
- audit_details = {
- 'extension_id': install.extension_id if install else None,
- 'extension_name': install.extension.display_name if install and install.extension else None,
- }
- if not MarketplaceService.uninstall_extension(install_id):
- return jsonify({'error': 'Not found'}), 404
- AuditService.log(
- action=AuditLog.ACTION_RESOURCE_UNINSTALL,
- user_id=user.id,
- target_type='marketplace_extension_install',
- target_id=install_id,
- details=audit_details,
- )
- return jsonify({'message': 'Extension uninstalled'})
-
-
-@marketplace_bp.route('/installs/<int:install_id>/config', methods=['PUT'])
-@jwt_required()
-def update_config(install_id):
- user = get_current_user()
- data = request.get_json() or {}
- install = MarketplaceService.update_extension_config(install_id, data.get('config', {}))
- if not install:
- return jsonify({'error': 'Not found'}), 404
- AuditService.log(
- action=AuditLog.ACTION_RESOURCE_UPDATE,
- user_id=user.id if user else None,
- target_type='marketplace_extension_install',
- target_id=install.id,
- details={
- 'extension_id': install.extension_id,
- 'extension_name': install.extension.display_name if install.extension else None,
- 'operation': 'update_config',
- },
- )
- 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__.py
index 59a7a7b3..5f8f6fe2 100644
--- a/backend/app/models/__init__.py
+++ b/backend/app/models/__init__.py
@@ -47,7 +47,6 @@ from app.models.tunnel import Tunnel
from app.models.exposed_service import ExposedService
from app.models.status_page import StatusPage, StatusComponent, HealthCheck, StatusIncident, StatusIncidentUpdate
from app.models.cloud_server import CloudProvider, CloudServer, CloudSnapshot
-from app.models.marketplace import Extension, ExtensionInstall
from app.models.pending_agent import PendingAgent
from app.models.plugin import InstalledPlugin
from app.models.ai import AiConversation, AiMessage, AiPendingAction
@@ -85,7 +84,6 @@ __all__ = [
'Tunnel', 'ExposedService',
'StatusPage', 'StatusComponent', 'HealthCheck', 'StatusIncident', 'StatusIncidentUpdate',
'CloudProvider', 'CloudServer', 'CloudSnapshot',
- 'Extension', 'ExtensionInstall',
'PendingAgent',
'InstalledPlugin',
'AiConversation', 'AiMessage', 'AiPendingAction',
diff --git a/backend/app/models/marketplace.py b/backend/app/models/marketplace.py
deleted file mode 100644
index 484d7a81..00000000
--- a/backend/app/models/marketplace.py
+++ /dev/null
@@ -1,151 +0,0 @@
-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):
- # If a marketplace install also created an InstalledPlugin row
- # (because the marketplace bridge handed off to plugin_service),
- # surface the linked plugin's status so the UI can distinguish
- # "metadata-only install" from "files installed and serving" from
- # "install errored". Lookup is by extension slug (not FK) — same
- # source URL but kept loose to avoid coupling schemas.
- linked = None
- try:
- from app.models.plugin import InstalledPlugin
- ext = self.extension
- if ext:
- row = InstalledPlugin.query.filter_by(slug=ext.slug).first()
- if row:
- linked = {
- 'plugin_id': row.id,
- 'status': row.status,
- 'has_backend': row.has_backend,
- 'has_frontend': row.has_frontend,
- 'error_message': row.error_message,
- }
- except Exception:
- linked = None
- 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,
- 'plugin': linked,
- '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.py
deleted file mode 100644
index 91b2070f..00000000
--- a/backend/app/services/marketplace_service.py
+++ /dev/null
@@ -1,203 +0,0 @@
-import logging
-from app import db
-from app.models.marketplace import Extension, ExtensionInstall
-from app.utils.slug import unique_slug
-
-logger = logging.getLogger(__name__)
-
-
-class MarketplaceService:
- """Service for the extension marketplace."""
-
- CATEGORIES = ['ai', '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 get_install(install_id):
- return ExtensionInstall.query.get(install_id)
-
- @staticmethod
- def create_extension(data, user_id=None):
- base = data.get('slug') or data['name']
- slug = unique_slug(
- base,
- lambda s: Extension.query.filter_by(slug=s).first() is not None,
- default='extension',
- )
-
- 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()
-
- # Hand off to the plugin installer if we have a source we can fetch.
- # Marketplace rows historically only stored metadata; if a source
- # URL is set we now actually install the plugin so it contributes
- # its routes/sidebar/api like any other plugin.
- # `entry_point` doubles as a source URL for marketplace-hosted
- # plugins (the field is reused — admins paste a github/zip URL).
- source_url = (ext.entry_point or ext.repository or '').strip()
- if source_url:
- try:
- from app.services import plugin_service
- plugin_service.install_from_url(source_url, user_id=user_id)
- except Exception as e:
- # Roll back the marketplace install row so the user can
- # retry cleanly. The download counter increment also gets
- # undone via the rollback.
- db.session.rollback()
- logger.warning(
- f'Marketplace ext {ext.slug}: plugin install from '
- f'{source_url} failed: {e}'
- )
- raise ValueError(f'Plugin install failed: {e}')
-
- 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.CATEGORIES
diff --git a/backend/migrations/versions/046_drop_legacy_marketplace.py b/backend/migrations/versions/046_drop_legacy_marketplace.py
new file mode 100644
index 00000000..24c05f38
--- /dev/null
+++ b/backend/migrations/versions/046_drop_legacy_marketplace.py
@@ -0,0 +1,37 @@
+"""Drop the legacy marketplace catalog tables (#51).
+
+The DB-seeded Extension/ExtensionInstall catalog was retired: nothing ever
+populated `extensions` on a real panel (rows only came from a manual POST),
+and install state lives on `installed_plugins`. Browse now merges the builtin
+folder scan + the remote registry + InstalledPlugin state instead.
+
+Idempotent: guarded on the live schema (the tables may already be absent on
+fresh installs, since the models no longer exist for db.create_all()).
+
+Revision ID: 046_drop_legacy_marketplace
+Revises: 045_plugin_config
+Create Date: 2026-07-02
+"""
+from alembic import op
+import sqlalchemy as sa
+
+revision = '046_drop_legacy_marketplace'
+down_revision = '045_plugin_config'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ conn = op.get_bind()
+ existing = set(sa.inspect(conn).get_table_names())
+ # Child first (FK to extensions), then parent.
+ if 'extension_installs' in existing:
+ op.drop_table('extension_installs')
+ if 'extensions' in existing:
+ op.drop_table('extensions')
+
+
+def downgrade():
+ # The legacy catalog is gone for good; recreating empty tables would only
+ # resurrect the confusion this migration removes. No-op.
+ pass
diff --git a/frontend/src/pages/Marketplace.jsx b/frontend/src/pages/Marketplace.jsx
index 3c96c955..3cff42ce 100644
--- a/frontend/src/pages/Marketplace.jsx
+++ b/frontend/src/pages/Marketplace.jsx
@@ -17,7 +17,6 @@ import {
ServerCog,
ShieldCheck,
Sparkles,
- Star,
UploadCloud,
} from 'lucide-react';
import api from '../services/api';
@@ -51,10 +50,6 @@ const PLUGIN_INSTALL_SOURCES = [
{ id: 'upload', label: 'Zip', icon: FileArchive },
];
-const numberFormatter = new Intl.NumberFormat();
-
-const formatCount = (value) => numberFormatter.format(Number(value) || 0);
-
const titleCase = (value = '') => {
const cleaned = String(value || 'utility').replace(/[-_]/g, ' ');
return cleaned
@@ -82,38 +77,6 @@ const deriveCatalogCategories = (entries) => {
return [...known, ...extra];
};
-const getPublishedCatalogEntry = (extension, installed) => ({
- key: `published:${extension.id}`,
- source: 'published',
- sourceLabel: 'Published',
- sourceDetail: 'Registry package',
- installKey: extension.id,
- displayName: extension.display_name || extension.name,
- description: extension.description || 'No description provided.',
- category: extension.category || 'utility',
- version: extension.version || '0.0.0',
- author: extension.author,
- firstParty: isFirstParty(extension.author, extension),
- icon: extension.icon || null,
- screenshots: Array.isArray(extension.screenshots) ? extension.screenshots : [],
- permissions: Array.isArray(extension.permissions) ? extension.permissions : [],
- configSchema: extension.config_schema && typeof extension.config_schema === 'object' ? extension.config_schema : null,
- extensionType: extension.extension_type,
- installed,
- rating: extension.rating,
- ratingCount: extension.rating_count,
- downloadCount: extension.download_count,
-});
-
-const getInstalledPublishedEntry = (extension) => ({
- key: `installed:${extension.id}`,
- source: 'published',
- sourceLabel: 'Published',
- displayName: extension.extension_name,
- version: extension.installed_version || '0.0.0',
- installId: extension.id,
-});
-
const getRegistryCatalogEntry = (entry) => ({
key: `registry:${entry.slug}`,
source: 'registry',
@@ -135,8 +98,7 @@ const getRegistryCatalogEntry = (entry) => ({
status: entry.status,
});
-// Source badge tint: built-in is 'warning', registry is 'info', published falls
-// back to the neutral 'outline' variant.
+// Source badge tint: built-in is 'warning', registry is 'info'.
const sourceBadgeVariant = (source) => {
if (source === 'local') return 'warning';
if (source === 'registry') return 'info';
@@ -185,8 +147,6 @@ const catalogEntryMatches = (entry, search, category) => {
const Marketplace = () => {
const toast = useToast();
- const [extensions, setExtensions] = useState([]);
- const [myExtensions, setMyExtensions] = useState([]);
const [plugins, setPlugins] = useState([]);
const [builtins, setBuiltins] = useState([]);
const [registryExtensions, setRegistryExtensions] = useState([]);
@@ -208,16 +168,12 @@ const Marketplace = () => {
const loadExtensions = useCallback(async () => {
try {
- const [eData, mData, pData, bData, rData, uData] = await Promise.all([
- api.getMarketplaceExtensions(category, search),
- api.getMyExtensions(),
+ const [pData, bData, rData, uData] = await Promise.all([
api.getInstalledPlugins().catch(() => ({ plugins: [] })),
api.getBuiltinExtensions().catch(() => ({ builtin: [] })),
api.getRegistryExtensions().catch(() => ({ extensions: [] })),
api.getPluginUpdates().catch(() => ({ updates: [] })),
]);
- setExtensions(eData.extensions || []);
- setMyExtensions(mData.extensions || []);
setPlugins(pData.plugins || []);
setBuiltins(bData.builtin || []);
setRegistryExtensions(rData.extensions || []);
@@ -227,26 +183,10 @@ const Marketplace = () => {
} finally {
setLoading(false);
}
- }, [category, search, toast]);
+ }, [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 handleBuiltinInstall = async (slug) => {
setInstalling(true);
try {
@@ -276,10 +216,8 @@ const Marketplace = () => {
const installEntry = (entry) => {
if (entry.source === 'local') {
handleBuiltinInstall(entry.installKey);
- } else if (entry.source === 'registry') {
- handleRegistryInstall(entry.installKey);
} else {
- handleInstall(entry.installKey);
+ handleRegistryInstall(entry.installKey);
}
};
@@ -382,21 +320,13 @@ const Marketplace = () => {
if (loading) return <PageLoader />;
- const installedIds = new Set(myExtensions.map((extension) => String(extension.extension_id)));
const localCatalogEntries = builtins.map(getLocalCatalogEntry);
const registryCatalogEntries = registryExtensions.map(getRegistryCatalogEntry);
- const publishedCatalogEntries = extensions.map((extension) => (
- getPublishedCatalogEntry(extension, installedIds.has(String(extension.id)))
- ));
- const installedCatalogEntries = [
- ...localCatalogEntries.filter((entry) => entry.installed),
- ...myExtensions.map(getInstalledPublishedEntry),
- ];
- const installedBuiltinCount = localCatalogEntries.filter((entry) => entry.installed).length;
+ const installedCatalogEntries = localCatalogEntries.filter((entry) => entry.installed);
+ const installedBuiltinCount = installedCatalogEntries.length;
const activePluginCount = plugins.filter((plugin) => plugin.status === 'active').length;
const pluginIssueCount = plugins.filter((plugin) => plugin.status === 'error').length;
- const totalDownloads = extensions.reduce((total, extension) => total + (Number(extension.download_count) || 0), 0);
- const availableCount = extensions.length + builtins.length + registryExtensions.length;
+ const availableCount = builtins.length + registryExtensions.length;
const installedCatalogCount = installedCatalogEntries.length;
// Update descriptors keyed by both plugin_id and slug so PluginRow can match
// whichever identifier it has on hand.
@@ -405,7 +335,7 @@ const Marketplace = () => {
if (update.plugin_id != null) updatesByKey.set(String(update.plugin_id), update);
if (update.slug) updatesByKey.set(update.slug, update);
});
- const mergedCatalogEntries = [...localCatalogEntries, ...registryCatalogEntries, ...publishedCatalogEntries];
+ const mergedCatalogEntries = [...localCatalogEntries, ...registryCatalogEntries];
const catalogCategories = deriveCatalogCategories(mergedCatalogEntries);
const catalogEntries = mergedCatalogEntries
.filter((entry) => catalogEntryMatches(entry, search, category));
@@ -509,9 +439,7 @@ const Marketplace = () => {
onInstall={
entry.source === 'local'
? handleBuiltinInstall
- : entry.source === 'registry'
- ? handleRegistryInstall
- : handleInstall
+ : handleRegistryInstall
}
onOpenDetail={setDetailEntry}
statusVariant={pluginStatusVariant}
@@ -522,7 +450,7 @@ const Marketplace = () => {
<EmptyState
icon={Package}
title="No catalog entries found"
- description={hasFilters ? 'No local or published entries match the current filter.' : 'No extension entries are available yet.'}
+ description={hasFilters ? 'No built-in or registry entries match the current filter.' : 'No extension entries are available yet.'}
/>
)}
</section>
@@ -565,7 +493,6 @@ const Marketplace = () => {
Runtime
</div>
<div className="marketplace-runtime">
- <RuntimeRow label="Published installs" value={formatCount(totalDownloads)} />
<RuntimeRow label="Registry" value={registryExtensions.length} />
<RuntimeRow label="Built-in" value={builtins.length} />
<RuntimeRow label="Built-in installed" value={`${installedBuiltinCount}/${builtins.length}`} />
@@ -591,18 +518,14 @@ const Marketplace = () => {
{installedCatalogEntries.length > 0 ? (
<div className="installed-list">
{installedCatalogEntries.map((entry) => (
- <InstalledCatalogRow
- key={entry.key}
- entry={entry}
- onUninstall={handleUninstall}
- />
+ <InstalledCatalogRow key={entry.key} entry={entry} />
))}
</div>
) : (
<EmptyState
icon={PackageCheck}
title="No extensions installed"
- description="Install a local or published extension to see it here."
+ description="Install a built-in or registry extension to see it here."
/>
)}
</section>
@@ -780,8 +703,7 @@ const CatalogExtensionCard = ({ entry, installing, onInstall, onOpenDetail, stat
const category = entry.category || 'utility';
const Icon = getCategoryIcon(category);
const isLocal = entry.source === 'local';
- const isPublished = entry.source === 'published';
- const installedLabel = !isPublished && entry.status && entry.status !== 'active'
+ const installedLabel = entry.status && entry.status !== 'active'
? titleCase(entry.status)
: 'Installed';
@@ -818,22 +740,8 @@ const CatalogExtensionCard = ({ entry, installing, onInstall, onOpenDetail, stat
<p className="extension-card__desc">{entry.description}</p>
</div>
<div className="extension-card__signals">
- {!isPublished ? (
- <>
- <span>{entry.sourceDetail}</span>
- <span>{entry.installed ? installedLabel : 'Ready to install'}</span>
- </>
- ) : (
- <>
- <span>
- {renderStars(entry.rating)}
- <span className="extension-card__signal-text">
- {formatCount(entry.ratingCount)} reviews
- </span>
- </span>
- <span>{formatCount(entry.downloadCount)} installs</span>
- </>
- )}
+ <span>{entry.sourceDetail}</span>
+ <span>{entry.installed ? installedLabel : 'Ready to install'}</span>
</div>
<div className="extension-card__footer">
<div className="extension-card__info">
@@ -854,14 +762,14 @@ const CatalogExtensionCard = ({ entry, installing, onInstall, onOpenDetail, stat
) : (
<Button
size="sm"
- disabled={!isPublished && installing}
+ disabled={installing}
onClick={(event) => {
event.stopPropagation();
onInstall(entry.installKey);
}}
>
<DownloadCloud aria-hidden="true" />
- {!isPublished && installing ? 'Installing...' : 'Install'}
+ {installing ? 'Installing...' : 'Install'}
</Button>
)}
</div>
@@ -874,14 +782,13 @@ const ExtensionDetailModal = ({ entry, installing, statusVariant, onClose, onIns
const category = entry.category || 'utility';
const Icon = getCategoryIcon(category);
const isLocal = entry.source === 'local';
- const isPublished = entry.source === 'published';
const iconSvg = entry.icon ? sanitizeSvgInner(entry.icon) : '';
const screenshots = entry.screenshots || [];
const permissions = Array.isArray(entry.permissions) ? entry.permissions : [];
const configKeys = entry.configSchema && typeof entry.configSchema === 'object'
? Object.keys(entry.configSchema)
: [];
- const installedLabel = !isPublished && entry.status && entry.status !== 'active'
+ const installedLabel = entry.status && entry.status !== 'active'
? titleCase(entry.status)
: 'Installed';
@@ -964,9 +871,9 @@ const ExtensionDetailModal = ({ entry, installing, statusVariant, onClose, onIns
{installedLabel}
</Badge>
) : (
- <Button disabled={!isPublished && installing} onClick={onInstall}>
+ <Button disabled={installing} onClick={onInstall}>
<DownloadCloud aria-hidden="true" />
- {!isPublished && installing ? 'Installing...' : 'Install'}
+ {installing ? 'Installing...' : 'Install'}
</Button>
)}
</div>
@@ -975,41 +882,28 @@ const ExtensionDetailModal = ({ entry, installing, statusVariant, onClose, onIns
);
};
-const InstalledCatalogRow = ({ entry, onUninstall }) => {
- const isLocal = entry.source === 'local';
- const Icon = isLocal ? Archive : PackageCheck;
-
- return (
- <article className="installed-item card">
- <div className="installed-item__main">
- <div className={`installed-item__icon installed-item__icon--${isLocal ? 'local' : 'extension'}`}>
- <Icon aria-hidden="true" />
- </div>
- <div className="installed-item__content">
- <div className="installed-item__title-line">
- <strong>{entry.displayName}</strong>
- <span className="text-muted">v{entry.version}</span>
- <Badge variant={isLocal ? 'warning' : 'outline'}>{entry.sourceLabel}</Badge>
- </div>
- {isLocal && (
- <p className="installed-item__description">
- Managed as a local registry mapping.
- </p>
- )}
- </div>
+// Installed catalog entries are builtin installs (the legacy "published"
+// lane was retired, #51); their manage/uninstall actions live on the
+// ServerKit Plugins tab, so this row is informational.
+const InstalledCatalogRow = ({ entry }) => (
+ <article className="installed-item card">
+ <div className="installed-item__main">
+ <div className="installed-item__icon installed-item__icon--local">
+ <Archive aria-hidden="true" />
</div>
- <div className="installed-item__actions">
- {isLocal ? (
- <Badge variant="success">Installed</Badge>
- ) : (
- <Button size="sm" variant="destructive" onClick={() => onUninstall(entry.installId)}>
- Uninstall
- </Button>
- )}
+ <div className="installed-item__content">
+ <div className="installed-item__title-line">
+ <strong>{entry.displayName}</strong>
+ <span className="text-muted">v{entry.version}</span>
+ <Badge variant="warning">{entry.sourceLabel}</Badge>
+ </div>
</div>
- </article>
- );
-};
+ </div>
+ <div className="installed-item__actions">
+ <Badge variant="success">Installed</Badge>
+ </div>
+ </article>
+);
const PluginRow = ({ plugin, update, installing, onToggle, onUpdate, onUninstall, onConfigure, statusVariant }) => {
const updateAvailable = Boolean(update?.update_available);
@@ -1240,20 +1134,4 @@ const RuntimeRow = ({ label, value, danger }) => (
</div>
);
-const renderStars = (rating) => {
- const normalizedRating = Math.max(0, Math.min(5, Number(rating) || 0));
-
- return (
- <span className="extension-card__stars" aria-label={`${normalizedRating.toFixed(1)} rating`}>
- {Array.from({ length: 5 }, (_, index) => (
- <Star
- key={index}
- aria-hidden="true"
- className={index < Math.round(normalizedRating) ? 'is-filled' : ''}
- />
- ))}
- </span>
- );
-};
-
export default Marketplace;
diff --git a/frontend/src/services/api/system.js b/frontend/src/services/api/system.js
index 00dcc351..70f5efb2 100644
--- a/frontend/src/services/api/system.js
+++ b/frontend/src/services/api/system.js
@@ -875,55 +875,8 @@ export async function getOfflineCache() {
return this.request('/mobile/offline-cache');
}
-// Marketplace endpoints
-export async function 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 : ''}`);
-}
-
-export async function getMarketplaceExtension(id) {
- return this.request(`/marketplace/${id}`);
-}
-
-export async function createMarketplaceExtension(data) {
- return this.request('/marketplace/', { method: 'POST', body: data });
-}
-
-export async function updateMarketplaceExtension(id, data) {
- return this.request(`/marketplace/${id}`, { method: 'PUT', body: data });
-}
-
-export async function publishExtension(id) {
- return this.request(`/marketplace/${id}/publish`, { method: 'POST' });
-}
-
-export async function deleteMarketplaceExtension(id) {
- return this.request(`/marketplace/${id}`, { method: 'DELETE' });
-}
-
-export async function installMarketplaceExtension(extId, config) {
- return this.request(`/marketplace/${extId}/install`, {
- method: 'POST', body: { config }
- });
-}
-
-export async function uninstallMarketplaceExtension(installId) {
- return this.request(`/marketplace/installs/${installId}`, { method: 'DELETE' });
-}
-
-export async function updateMarketplaceExtensionConfig(installId, config) {
- return this.request(`/marketplace/installs/${installId}/config`, {
- method: 'PUT', body: { config }
- });
-}
-
-export async function getMyExtensions() {
- return this.request('/marketplace/my-extensions');
-}
-
+// Marketplace endpoints. (The legacy DB-seeded Extension catalog was retired,
+// #51 — Browse merges builtins + the registry + installed plugin state.)
// Remote/bundled registry catalog. Returns:
// { extensions: [ { slug, display_name, description, version, category,
// author, first_party, permissions, min_panel_version,
@@ -941,12 +894,6 @@ export async function installRegistryExtension(slug) {
});
}
-export async function rateExtension(extId, rating) {
- return this.request(`/marketplace/${extId}/rate`, {
- method: 'POST', body: { rating }
- });
-}
-
// Feature module toggles (Email + WordPress verticals). getModules() is
// available to any authenticated user; setModule() is admin-only.
export async function getModules() {