diff --git a/scripts/db/migrations/004_ai_inventory_system.sql b/scripts/db/migrations/004_ai_inventory_system.sql
new file mode 100644
index 000000000..d3bfc8d49
--- /dev/null
+++ b/scripts/db/migrations/004_ai_inventory_system.sql
@@ -0,0 +1,402 @@
+-- Migration: 004_ai_inventory_system
+-- Description: AI-powered inventory management system with automated data extraction
+
+-- ============================================================================
+-- AI PRODUCT EXTRACTION SYSTEM
+-- ============================================================================
+
+-- Create table for AI-extracted product data
+CREATE TABLE IF NOT EXISTS ai_extracted_products (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ original_image_url TEXT,
+ extracted_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+
+ -- Basic product information
+ product_name TEXT,
+ product_name_confidence DECIMAL(3,2) CHECK (product_name_confidence >= 0 AND product_name_confidence <= 1),
+ brand TEXT,
+ brand_confidence DECIMAL(3,2) CHECK (brand_confidence >= 0 AND brand_confidence <= 1),
+ model TEXT,
+ model_confidence DECIMAL(3,2) CHECK (model_confidence >= 0 AND model_confidence <= 1),
+
+ -- Categorization
+ category TEXT,
+ category_confidence DECIMAL(3,2) CHECK (category_confidence >= 0 AND category_confidence <= 1),
+ subcategory TEXT,
+ subcategory_confidence DECIMAL(3,2) CHECK (subcategory_confidence >= 0 AND subcategory_confidence <= 1),
+
+ -- Pricing and condition
+ estimated_price_chf DECIMAL(10,2),
+ price_confidence DECIMAL(3,2) CHECK (price_confidence >= 0 AND price_confidence <= 1),
+ condition TEXT CHECK (condition IN ('new', 'like_new', 'good', 'fair', 'poor', 'damaged')),
+ condition_confidence DECIMAL(3,2) CHECK (condition_confidence >= 0 AND condition_confidence <= 1),
+
+ -- Technical specifications
+ specifications JSONB DEFAULT '{}',
+ specs_confidence DECIMAL(3,2) CHECK (specs_confidence >= 0 AND specs_confidence <= 1),
+
+ -- Additional metadata
+ color TEXT,
+ color_confidence DECIMAL(3,2) CHECK (color_confidence >= 0 AND color_confidence <= 1),
+ material TEXT,
+ material_confidence DECIMAL(3,2) CHECK (material_confidence >= 0 AND material_confidence <= 1),
+ dimensions JSONB DEFAULT '{}', -- {width: 10, height: 20, depth: 5, unit: 'cm'}
+ weight_grams INTEGER,
+ weight_confidence DECIMAL(3,2) CHECK (weight_confidence >= 0 AND weight_confidence <= 1),
+
+ -- AI processing metadata
+ ai_provider TEXT DEFAULT 'openai', -- 'openai', 'anthropic', 'google', etc.
+ ai_model TEXT DEFAULT 'gpt-4-vision-preview',
+ processing_time_ms INTEGER,
+ total_confidence DECIMAL(3,2) CHECK (total_confidence >= 0 AND total_confidence <= 1),
+
+ -- Raw AI response for debugging/analysis
+ raw_ai_response JSONB DEFAULT '{}',
+
+ -- User and processing status
+ created_by UUID REFERENCES users(id),
+ status TEXT DEFAULT 'pending_review' CHECK (status IN ('pending_review', 'approved', 'rejected', 'processed')),
+ reviewed_by UUID REFERENCES users(id),
+ reviewed_at TIMESTAMP WITH TIME ZONE,
+ review_notes TEXT,
+
+ -- Integration fields
+ kivitendo_article_number TEXT,
+ medusa_product_id TEXT,
+ marketplace_listing_id TEXT,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- ============================================================================
+-- SUSTAINABILITY SCORING SYSTEM
+-- ============================================================================
+
+-- Create sustainability scoring table
+CREATE TABLE IF NOT EXISTS sustainability_scores (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ product_id UUID REFERENCES ai_extracted_products(id) ON DELETE CASCADE,
+
+ -- Overall sustainability score (0-100)
+ overall_score INTEGER CHECK (overall_score >= 0 AND overall_score <= 100),
+
+ -- Component scores
+ environmental_score INTEGER CHECK (environmental_score >= 0 AND environmental_score <= 100),
+ social_score INTEGER CHECK (social_score >= 0 AND social_score <= 100),
+ economic_score INTEGER CHECK (economic_score >= 0 AND economic_score <= 100),
+
+ -- Detailed factors
+ factors JSONB DEFAULT '{}', -- {recyclability: 85, energy_efficiency: 70, fair_trade: 60, ...}
+
+ -- AI analysis
+ ai_analysis JSONB DEFAULT '{}',
+ ai_provider TEXT DEFAULT 'openai',
+ ai_model TEXT,
+
+ -- Recommendations
+ recommendations TEXT[],
+ improvement_suggestions TEXT[],
+
+ -- Metadata
+ assessed_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ assessed_by TEXT DEFAULT 'ai', -- 'ai', 'expert', 'user'
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- ============================================================================
+-- PRODUCT CATEGORIES AND ATTRIBUTES
+-- ============================================================================
+
+-- Enhanced product categories table
+CREATE TABLE IF NOT EXISTS product_categories (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ slug VARCHAR(100) NOT NULL UNIQUE,
+ name VARCHAR(150) NOT NULL,
+ description TEXT,
+ parent_id UUID REFERENCES product_categories(id),
+ level INTEGER DEFAULT 1, -- 1 = main category, 2 = subcategory, etc.
+
+ -- Display and SEO
+ icon TEXT,
+ color VARCHAR(7), -- hex color
+ seo_title TEXT,
+ seo_description TEXT,
+
+ -- Metadata
+ is_active BOOLEAN DEFAULT true,
+ sort_order INTEGER DEFAULT 0,
+ ai_detection_keywords TEXT[], -- Keywords for AI recognition
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- Product attributes (for structured data)
+CREATE TABLE IF NOT EXISTS product_attributes (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ category_id UUID REFERENCES product_categories(id),
+ name VARCHAR(100) NOT NULL,
+ display_name VARCHAR(150),
+ data_type VARCHAR(20) DEFAULT 'text' CHECK (data_type IN ('text', 'number', 'boolean', 'select', 'multiselect', 'date')),
+ unit VARCHAR(20), -- 'cm', 'kg', 'GB', etc.
+ is_required BOOLEAN DEFAULT false,
+ is_filterable BOOLEAN DEFAULT false,
+ options TEXT[] DEFAULT '{}', -- For select/multiselect types
+
+ -- AI extraction
+ ai_extraction_prompt TEXT,
+ ai_confidence_threshold DECIMAL(3,2) DEFAULT 0.7,
+
+ -- Display
+ sort_order INTEGER DEFAULT 0,
+ is_active BOOLEAN DEFAULT true,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+
+ UNIQUE(category_id, name)
+);
+
+-- ============================================================================
+-- INVENTORY MANAGEMENT
+-- ============================================================================
+
+-- Inventory items table (links AI extraction to physical inventory)
+CREATE TABLE IF NOT EXISTS inventory_items (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ ai_product_id UUID REFERENCES ai_extracted_products(id),
+
+ -- Legacy system integration
+ kivitendo_article_number TEXT UNIQUE,
+ legacy_csv_data JSONB DEFAULT '{}',
+
+ -- Physical inventory tracking
+ location TEXT, -- Warehouse location
+ quantity_available INTEGER DEFAULT 0,
+ quantity_reserved INTEGER DEFAULT 0,
+ quantity_sold INTEGER DEFAULT 0,
+
+ -- Status tracking
+ status TEXT DEFAULT 'available' CHECK (status IN ('available', 'reserved', 'sold', 'damaged', 'missing')),
+ condition_override TEXT CHECK (condition_override IN ('new', 'like_new', 'good', 'fair', 'poor', 'damaged')),
+ condition_notes TEXT,
+
+ -- Pricing
+ acquisition_cost_chf DECIMAL(10,2),
+ selling_price_chf DECIMAL(10,2),
+ min_selling_price_chf DECIMAL(10,2),
+
+ -- Marketplace integration
+ medusa_product_id TEXT UNIQUE,
+ marketplace_status TEXT DEFAULT 'draft' CHECK (marketplace_status IN ('draft', 'published', 'sold', 'archived')),
+
+ -- User assignments
+ assigned_to UUID REFERENCES users(id), -- Who is responsible for this item
+ assigned_at TIMESTAMP WITH TIME ZONE,
+ assignment_notes TEXT,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- ============================================================================
+-- PRODUCT IMAGES AND MEDIA
+-- ============================================================================
+
+-- Enhanced product images table
+CREATE TABLE IF NOT EXISTS product_images (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ product_id UUID REFERENCES ai_extracted_products(id) ON DELETE CASCADE,
+
+ -- File information
+ filename TEXT NOT NULL,
+ original_filename TEXT,
+ file_path TEXT NOT NULL,
+ file_size_bytes INTEGER,
+ mime_type TEXT,
+
+ -- AI analysis
+ ai_description TEXT,
+ ai_tags TEXT[],
+ is_primary BOOLEAN DEFAULT false,
+
+ -- Image metadata
+ width INTEGER,
+ height INTEGER,
+ dominant_colors TEXT[], -- ['#FF0000', '#00FF00', etc.]
+ image_quality DECIMAL(3,2), -- AI-assessed quality score
+
+ -- Processing status
+ upload_status TEXT DEFAULT 'processing' CHECK (upload_status IN ('uploading', 'processing', 'ready', 'failed')),
+ processed_at TIMESTAMP WITH TIME ZONE,
+
+ -- User and permissions
+ uploaded_by UUID REFERENCES users(id),
+ is_public BOOLEAN DEFAULT true,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- ============================================================================
+-- AI PROCESSING LOGS AND ANALYTICS
+-- ============================================================================
+
+-- AI processing logs for debugging and improvement
+CREATE TABLE IF NOT EXISTS ai_processing_logs (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ product_id UUID REFERENCES ai_extracted_products(id),
+
+ -- Request details
+ request_type TEXT NOT NULL, -- 'image_analysis', 'text_extraction', 'sustainability_scoring'
+ provider TEXT NOT NULL,
+ model TEXT NOT NULL,
+ input_data JSONB DEFAULT '{}',
+
+ -- Response details
+ response_data JSONB DEFAULT '{}',
+ processing_time_ms INTEGER,
+ tokens_used INTEGER,
+ cost_cents DECIMAL(8,4),
+
+ -- Quality metrics
+ confidence_score DECIMAL(3,2),
+ accuracy_rating DECIMAL(3,2), -- User-provided feedback
+ error_message TEXT,
+
+ -- Metadata
+ user_id UUID REFERENCES users(id),
+ ip_address INET,
+ user_agent TEXT,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- ============================================================================
+-- MARKETPLACE INTEGRATION
+-- ============================================================================
+
+-- Marketplace listings table
+CREATE TABLE IF NOT EXISTS marketplace_listings (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ inventory_item_id UUID REFERENCES inventory_items(id) ON DELETE CASCADE,
+
+ -- Listing details
+ title TEXT NOT NULL,
+ description TEXT,
+ price_chf DECIMAL(10,2) NOT NULL,
+
+ -- Platform integration
+ platform TEXT NOT NULL, -- 'medusa', 'external_api', etc.
+ platform_listing_id TEXT,
+ platform_url TEXT,
+
+ -- Status and visibility
+ status TEXT DEFAULT 'draft' CHECK (status IN ('draft', 'published', 'sold', 'paused', 'expired')),
+ is_featured BOOLEAN DEFAULT false,
+ views_count INTEGER DEFAULT 0,
+ favorites_count INTEGER DEFAULT 0,
+
+ -- Sales tracking
+ sold_at TIMESTAMP WITH TIME ZONE,
+ sold_price_chf DECIMAL(10,2),
+ buyer_info JSONB DEFAULT '{}', -- Anonymized buyer data
+
+ -- Metadata
+ published_at TIMESTAMP WITH TIME ZONE,
+ expires_at TIMESTAMP WITH TIME ZONE,
+ created_by UUID REFERENCES users(id),
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- ============================================================================
+-- INDEXES FOR PERFORMANCE
+-- ============================================================================
+
+-- AI extracted products indexes
+CREATE INDEX IF NOT EXISTS idx_ai_products_status ON ai_extracted_products(status);
+CREATE INDEX IF NOT EXISTS idx_ai_products_brand ON ai_extracted_products(brand);
+CREATE INDEX IF NOT EXISTS idx_ai_products_category ON ai_extracted_products(category);
+CREATE INDEX IF NOT EXISTS idx_ai_products_created_by ON ai_extracted_products(created_by);
+CREATE INDEX IF NOT EXISTS idx_ai_products_kivitendo ON ai_extracted_products(kivitendo_article_number);
+
+-- Inventory items indexes
+CREATE INDEX IF NOT EXISTS idx_inventory_status ON inventory_items(status);
+CREATE INDEX IF NOT EXISTS idx_inventory_location ON inventory_items(location);
+CREATE INDEX IF NOT EXISTS idx_inventory_kivitendo ON inventory_items(kivitendo_article_number);
+CREATE INDEX IF NOT EXISTS idx_inventory_assigned_to ON inventory_items(assigned_to);
+
+-- Product categories indexes
+CREATE INDEX IF NOT EXISTS idx_categories_parent ON product_categories(parent_id);
+CREATE INDEX IF NOT EXISTS idx_categories_level ON product_categories(level);
+CREATE INDEX IF NOT EXISTS idx_categories_active ON product_categories(is_active);
+
+-- Marketplace listings indexes
+CREATE INDEX IF NOT EXISTS idx_listings_status ON marketplace_listings(status);
+CREATE INDEX IF NOT EXISTS idx_listings_platform ON marketplace_listings(platform);
+CREATE INDEX IF NOT EXISTS idx_listings_created_by ON marketplace_listings(created_by);
+
+-- ============================================================================
+-- UPDATED AT TRIGGERS
+-- ============================================================================
+
+-- Add updated_at triggers for new tables
+DO $$
+DECLARE
+ tbl_name text;
+ trigger_name text;
+BEGIN
+ -- List of tables that need updated_at triggers
+ FOR tbl_name IN
+ SELECT unnest(ARRAY[
+ 'ai_extracted_products', 'sustainability_scores', 'product_categories',
+ 'product_attributes', 'inventory_items', 'product_images',
+ 'ai_processing_logs', 'marketplace_listings'
+ ])
+ LOOP
+ trigger_name := 'update_' || tbl_name || '_updated_at';
+
+ IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = tbl_name) AND
+ EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = tbl_name AND column_name = 'updated_at') THEN
+ IF NOT EXISTS (SELECT 1 FROM pg_trigger WHERE tgname = trigger_name) THEN
+ EXECUTE format('CREATE TRIGGER %I BEFORE UPDATE ON %I FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();', trigger_name, tbl_name);
+ END IF;
+ END IF;
+ END LOOP;
+END $$;
+
+-- ============================================================================
+-- DEFAULT DATA INSERTION
+-- ============================================================================
+
+-- Insert default product categories
+INSERT INTO product_categories (slug, name, description, level, icon, color, ai_detection_keywords) VALUES
+ ('electronics', 'Elektronik', 'Computer, Smartphones, Tablets und Zubehör', 1, 'computer', '#3B82F6', ARRAY['computer', 'laptop', 'smartphone', 'tablet', 'elektronik', 'electronic']),
+ ('components', 'Computer-Komponenten', 'CPUs, RAM, Festplatten, Mainboards', 2, 'cpu', '#10B981', ARRAY['ram', 'cpu', 'motherboard', 'ssd', 'hdd', 'grafikkarte', 'graphics card']),
+ ('peripherals', 'Peripheriegeräte', 'Monitore, Tastaturen, Mäuse, Drucker', 2, 'monitor', '#F59E0B', ARRAY['monitor', 'keyboard', 'mouse', 'printer', 'tastatur', 'maus', 'bildschirm']),
+ ('networking', 'Netzwerk', 'Router, Switches, Netzwerkkarten', 2, 'wifi', '#8B5CF6', ARRAY['router', 'switch', 'network', 'netzwerk', 'wifi', 'ethernet']),
+ ('audio', 'Audio', 'Lautsprecher, Kopfhörer, Mikrofone', 2, 'headphones', '#EF4444', ARRAY['speaker', 'headphone', 'microphone', 'audio', 'lautsprecher', 'kopfhörer']),
+ ('office', 'Büroartikel', 'Büromaterial, Organisation, Büroelektronik', 1, 'briefcase', '#6B7280', ARRAY['office', 'büro', 'printer', 'scanner', 'kopierer'])
+ON CONFLICT (slug) DO NOTHING;
+
+-- Insert default product attributes for electronics category
+INSERT INTO product_attributes (category_id, name, display_name, data_type, unit, is_required, is_filterable, options, ai_extraction_prompt) VALUES
+ ((SELECT id FROM product_categories WHERE slug = 'electronics'), 'brand', 'Marke', 'text', NULL, true, true, '{}', 'Extract the brand/manufacturer name from the product image and text'),
+ ((SELECT id FROM product_categories WHERE slug = 'electronics'), 'model', 'Modell', 'text', NULL, false, true, '{}', 'Extract the model number or name from the product'),
+ ((SELECT id FROM product_categories WHERE slug = 'electronics'), 'color', 'Farbe', 'text', NULL, false, true, '{}', 'Identify the primary color of the product'),
+ ((SELECT id FROM product_categories WHERE slug = 'electronics'), 'condition', 'Zustand', 'select', NULL, true, true, ARRAY['new', 'like_new', 'good', 'fair', 'poor'], 'Assess the physical condition of the product'),
+ ((SELECT id FROM product_categories WHERE slug = 'electronics'), 'weight_grams', 'Gewicht', 'number', 'g', false, false, '{}', 'Estimate the weight of the product in grams')
+ON CONFLICT (category_id, name) DO NOTHING;
+
+-- Insert attributes for computer components
+INSERT INTO product_attributes (category_id, name, display_name, data_type, unit, is_required, is_filterable, ai_extraction_prompt) VALUES
+ ((SELECT id FROM product_categories WHERE slug = 'components'), 'capacity', 'Kapazität', 'number', 'GB', false, true, 'Extract storage capacity for drives or memory size for RAM'),
+ ((SELECT id FROM product_categories WHERE slug = 'components'), 'speed', 'Geschwindigkeit', 'text', NULL, false, true, 'Extract speed specifications (MHz, GHz, etc.)'),
+ ((SELECT id FROM product_categories WHERE slug = 'components'), 'interface', 'Schnittstelle', 'text', NULL, false, true, 'Extract interface type (SATA, PCIe, DDR4, etc.)'),
+ ((SELECT id FROM product_categories WHERE slug = 'components'), 'form_factor', 'Formfaktor', 'text', NULL, false, false, 'Identify the physical form factor (2.5", DIMM, etc.)')
+ON CONFLICT (category_id, name) DO NOTHING;
\ No newline at end of file
diff --git a/scripts/db/migrations/005_messaging_system.sql b/scripts/db/migrations/005_messaging_system.sql
new file mode 100644
index 000000000..90d66caf1
--- /dev/null
+++ b/scripts/db/migrations/005_messaging_system.sql
@@ -0,0 +1,298 @@
+-- Migration: 005_messaging_system
+-- Description: Real-time messaging system for buyer-seller and customer-repairer communication
+
+-- ============================================================================
+-- MESSAGING SYSTEM
+-- ============================================================================
+
+-- Conversations table - represents a conversation thread
+CREATE TABLE IF NOT EXISTS conversations (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ title TEXT, -- Optional title for the conversation
+ type TEXT NOT NULL CHECK (type IN ('direct', 'appointment', 'marketplace', 'service')),
+ context_id TEXT, -- ID of related entity (appointment_id, marketplace_listing_id, etc.)
+
+ -- Participants
+ participant_1 UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+ participant_2 UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+
+ -- Metadata
+ last_message_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ last_message_preview TEXT,
+ unread_count_1 INTEGER DEFAULT 0, -- Unread messages for participant_1
+ unread_count_2 INTEGER DEFAULT 0, -- Unread messages for participant_2
+
+ -- Status
+ is_active BOOLEAN DEFAULT true,
+ archived_by_1 BOOLEAN DEFAULT false,
+ archived_by_2 BOOLEAN DEFAULT false,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+
+ -- Ensure participants are different and ordered consistently
+ CONSTRAINT different_participants CHECK (participant_1 != participant_2),
+ CONSTRAINT ordered_participants CHECK (participant_1 < participant_2),
+
+ UNIQUE(participant_1, participant_2, type, context_id)
+);
+
+-- Messages table - individual messages within conversations
+CREATE TABLE IF NOT EXISTS messages (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ conversation_id UUID NOT NULL REFERENCES conversations(id) ON DELETE CASCADE,
+
+ sender_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+ recipient_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+
+ content TEXT NOT NULL,
+ message_type TEXT DEFAULT 'text' CHECK (message_type IN ('text', 'image', 'file', 'system')),
+
+ -- Attachments (optional)
+ attachment_url TEXT,
+ attachment_name TEXT,
+ attachment_size INTEGER,
+
+ -- Status
+ is_read BOOLEAN DEFAULT false,
+ read_at TIMESTAMP WITH TIME ZONE,
+
+ -- Delivery status
+ delivery_status TEXT DEFAULT 'sent' CHECK (delivery_status IN ('sent', 'delivered', 'read', 'failed')),
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- Message reactions (optional feature)
+CREATE TABLE IF NOT EXISTS message_reactions (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ message_id UUID NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
+ user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+ reaction TEXT NOT NULL, -- emoji or reaction type
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+
+ UNIQUE(message_id, user_id, reaction)
+);
+
+-- ============================================================================
+-- NOTIFICATION SYSTEM INTEGRATION
+-- ============================================================================
+
+-- Notification preferences for users
+CREATE TABLE IF NOT EXISTS user_notification_preferences (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+
+ -- Email notifications
+ email_new_messages BOOLEAN DEFAULT true,
+ email_appointment_updates BOOLEAN DEFAULT true,
+ email_marketplace_updates BOOLEAN DEFAULT true,
+
+ -- In-app notifications
+ in_app_messages BOOLEAN DEFAULT true,
+ in_app_appointments BOOLEAN DEFAULT true,
+ in_app_marketplace BOOLEAN DEFAULT true,
+
+ -- SMS notifications (for urgent matters)
+ sms_urgent_messages BOOLEAN DEFAULT false,
+ sms_appointment_reminders BOOLEAN DEFAULT false,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+
+ UNIQUE(user_id)
+);
+
+-- Notification history
+CREATE TABLE IF NOT EXISTS notifications (
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
+ user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+
+ type TEXT NOT NULL CHECK (type IN ('message', 'appointment', 'marketplace', 'system', 'marketing')),
+ title TEXT NOT NULL,
+ content TEXT NOT NULL,
+
+ -- Related entity
+ related_type TEXT, -- 'conversation', 'appointment', 'marketplace_listing', etc.
+ related_id TEXT,
+
+ -- Delivery methods
+ sent_email BOOLEAN DEFAULT false,
+ sent_sms BOOLEAN DEFAULT false,
+ sent_in_app BOOLEAN DEFAULT false,
+
+ -- Status
+ is_read BOOLEAN DEFAULT false,
+ read_at TIMESTAMP WITH TIME ZONE,
+
+ -- Scheduling (for delayed notifications)
+ scheduled_for TIMESTAMP WITH TIME ZONE,
+
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
+ updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
+);
+
+-- ============================================================================
+-- INDEXES FOR PERFORMANCE
+-- ============================================================================
+
+-- Conversation indexes
+CREATE INDEX IF NOT EXISTS idx_conversations_participants ON conversations(participant_1, participant_2);
+CREATE INDEX IF NOT EXISTS idx_conversations_type_context ON conversations(type, context_id);
+CREATE INDEX IF NOT EXISTS idx_conversations_last_message ON conversations(last_message_at DESC);
+CREATE INDEX IF NOT EXISTS idx_conversations_active ON conversations(is_active);
+
+-- Message indexes
+CREATE INDEX IF NOT EXISTS idx_messages_conversation ON messages(conversation_id);
+CREATE INDEX IF NOT EXISTS idx_messages_sender ON messages(sender_id);
+CREATE INDEX IF NOT EXISTS idx_messages_recipient ON messages(recipient_id);
+CREATE INDEX IF NOT EXISTS idx_messages_created ON messages(created_at DESC);
+CREATE INDEX IF NOT EXISTS idx_messages_unread ON messages(recipient_id, is_read) WHERE is_read = false;
+
+-- Notification indexes
+CREATE INDEX IF NOT EXISTS idx_notifications_user ON notifications(user_id);
+CREATE INDEX IF NOT EXISTS idx_notifications_type ON notifications(type);
+CREATE INDEX IF NOT EXISTS idx_notifications_read ON notifications(is_read);
+CREATE INDEX IF NOT EXISTS idx_notifications_scheduled ON notifications(scheduled_for) WHERE scheduled_for IS NOT NULL;
+
+-- ============================================================================
+-- UPDATED AT TRIGGERS
+-- ============================================================================
+
+-- Add updated_at triggers for new tables
+DO $$
+DECLARE
+ tbl_name text;
+ trigger_name text;
+BEGIN
+ -- List of tables that need updated_at triggers
+ FOR tbl_name IN
+ SELECT unnest(ARRAY[
+ 'conversations', 'messages', 'message_reactions',
+ 'user_notification_preferences', 'notifications'
+ ])
+ LOOP
+ trigger_name := 'update_' || tbl_name || '_updated_at';
+
+ IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = tbl_name) AND
+ EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = tbl_name AND column_name = 'updated_at') THEN
+ IF NOT EXISTS (SELECT 1 FROM pg_trigger WHERE tgname = trigger_name) THEN
+ EXECUTE format('CREATE TRIGGER %I BEFORE UPDATE ON %I FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();', trigger_name, tbl_name);
+ END IF;
+ END IF;
+ END LOOP;
+END $$;
+
+-- ============================================================================
+-- DEFAULT NOTIFICATION PREFERENCES
+-- ============================================================================
+
+-- Insert default notification preferences for existing users
+INSERT INTO user_notification_preferences (
+ user_id, email_new_messages, email_appointment_updates, email_marketplace_updates,
+ in_app_messages, in_app_appointments, in_app_marketplace
+)
+SELECT
+ id,
+ true, true, true, -- email preferences
+ true, true, true -- in-app preferences
+FROM users
+ON CONFLICT (user_id) DO NOTHING;
+
+-- ============================================================================
+-- SYSTEM CONVERSATIONS FOR EXISTING APPOINTMENTS
+-- ============================================================================
+
+-- Create conversations for existing service appointments
+INSERT INTO conversations (
+ title,
+ type,
+ context_id,
+ participant_1,
+ participant_2,
+ last_message_at,
+ last_message_preview
+)
+SELECT
+ CONCAT('Service: ', st.name),
+ 'appointment',
+ sa.id::text,
+ -- Ensure consistent ordering of participants
+ CASE WHEN sa.user_id < '00000000-0000-0000-0000-000000000000'::uuid THEN sa.user_id ELSE '00000000-0000-0000-0000-000000000000'::uuid END,
+ CASE WHEN sa.user_id < '00000000-0000-0000-0000-000000000000'::uuid THEN '00000000-0000-0000-0000-000000000000'::uuid ELSE sa.user_id END,
+ sa.created_at,
+ COALESCE(sa.description, 'Neue Service-Anfrage')
+FROM service_appointments sa
+JOIN service_types st ON sa.service_type_id = st.id
+-- Only create if participants are different (avoid self-conversations)
+WHERE sa.user_id != '00000000-0000-0000-0000-000000000000'::uuid
+ON CONFLICT (participant_1, participant_2, type, context_id) DO NOTHING;
+
+-- ============================================================================
+-- HELPER FUNCTIONS
+-- ============================================================================
+
+-- Function to update conversation metadata when a new message is added
+CREATE OR REPLACE FUNCTION update_conversation_on_message()
+RETURNS TRIGGER AS $$
+BEGIN
+ -- Update conversation's last message info
+ UPDATE conversations
+ SET
+ last_message_at = NEW.created_at,
+ last_message_preview = LEFT(NEW.content, 100),
+ -- Update unread counts
+ unread_count_1 = CASE
+ WHEN participant_1 = NEW.recipient_id THEN unread_count_1 + 1
+ ELSE unread_count_1
+ END,
+ unread_count_2 = CASE
+ WHEN participant_2 = NEW.recipient_id THEN unread_count_2 + 1
+ ELSE unread_count_2
+ END,
+ updated_at = CURRENT_TIMESTAMP
+ WHERE id = NEW.conversation_id;
+
+ RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
+
+-- Trigger to automatically update conversation when messages are added
+CREATE TRIGGER trigger_update_conversation_on_message
+ AFTER INSERT ON messages
+ FOR EACH ROW
+ EXECUTE FUNCTION update_conversation_on_message();
+
+-- Function to reset unread count when messages are marked as read
+CREATE OR REPLACE FUNCTION reset_unread_count()
+RETURNS TRIGGER AS $$
+BEGIN
+ IF NEW.is_read = true AND OLD.is_read = false THEN
+ UPDATE conversations
+ SET
+ unread_count_1 = CASE
+ WHEN participant_1 = NEW.recipient_id THEN GREATEST(unread_count_1 - 1, 0)
+ ELSE unread_count_1
+ END,
+ unread_count_2 = CASE
+ WHEN participant_2 = NEW.recipient_id THEN GREATEST(unread_count_2 - 1, 0)
+ ELSE unread_count_2
+ END,
+ updated_at = CURRENT_TIMESTAMP
+ WHERE id = NEW.conversation_id;
+ END IF;
+
+ RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
+
+-- Trigger to reset unread count when messages are read
+CREATE TRIGGER trigger_reset_unread_count
+ AFTER UPDATE OF is_read ON messages
+ FOR EACH ROW
+ EXECUTE FUNCTION reset_unread_count();
+
+
+
diff --git a/src/app/about/impact/content.tsx b/src/app/about/impact/content.tsx
new file mode 100644
index 000000000..af3245060
--- /dev/null
+++ b/src/app/about/impact/content.tsx
@@ -0,0 +1,512 @@
+'use client'
+
+import { useState } from 'react'
+import Image from 'next/image'
+import { ResponsiveHero } from '@/components/layout/ResponsiveHero'
+import AboutSubNav from '@/components/about/AboutSubNav'
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
+import { Button } from '@/components/ui/button'
+import { IMPACT_METRICS, getEnvironmentalSummary, getSocialSummary, type ImpactMetric } from '@/data/impact-metrics'
+import { getDefaultValue, getDefaultNumeric } from '@/lib/org-numbers.defaults'
+// Simple Badge component replacement
+const Badge = ({ children, className = "" }: { children: React.ReactNode, className?: string }) => (
+
+ {children}
+
+)
+
+// Simple Tabs replacement using state
+const SimpleTabs = ({
+ tabs,
+ defaultValue,
+ children
+}: {
+ tabs: { value: string, label: string, icon?: React.ReactNode }[],
+ defaultValue: string,
+ children: (value: string) => React.ReactNode
+}) => {
+ const [activeTab, setActiveTab] = useState(defaultValue)
+
+ return (
+
+
+ {tabs.map((tab) => (
+ setActiveTab(tab.value)}
+ className={`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors flex-1 ${
+ activeTab === tab.value
+ ? 'bg-white text-gray-900 shadow-sm'
+ : 'text-gray-600 hover:text-gray-900'
+ }`}
+ >
+ {tab.icon}
+ {tab.label}
+
+ ))}
+
+
+ {children(activeTab)}
+
+
+ )
+}
+import {
+ Heart,
+ Leaf,
+ Users,
+ TrendingUp,
+ Award,
+ Target,
+ CheckCircle,
+ ArrowRight,
+ Download,
+ Calendar,
+ MapPin
+} from 'lucide-react'
+import {
+ EWasteProblemSection,
+ ZeroWasteSolutionSection,
+ CommunitySpaceSection
+} from '@/components/impact'
+
+interface DonationMethod {
+ id: string
+ name: string
+ description: string
+ amount?: string
+ icon: React.ReactNode
+ benefits: string[]
+ ctaText: string
+ popular?: boolean
+}
+
+export default function ImpactPageContent() {
+ const [selectedDonationMethod, setSelectedDonationMethod] = useState(null)
+ const envSummary = getEnvironmentalSummary()
+ const socialSummary = getSocialSummary()
+
+ const donationMethods: DonationMethod[] = [
+ {
+ id: 'monthly',
+ name: 'Monatliche Spende',
+ description: 'Regelmässige Unterstützung für nachhaltige Wirkung',
+ amount: 'Ab CHF 20/Monat',
+ icon: ,
+ benefits: [
+ 'Kontinuierliche Finanzierung unserer Programme',
+ 'Planbare Ressourcen für langfristige Projekte',
+ 'Exklusive Updates über unsere Wirkung',
+ 'Einladungen zu besonderen Veranstaltungen'
+ ],
+ ctaText: 'Monatlich spenden',
+ popular: true
+ },
+ {
+ id: 'one-time',
+ name: 'Einmalige Spende',
+ description: 'Direkte Unterstützung für spezifische Projekte',
+ amount: 'Frei wählbar',
+ icon: ,
+ benefits: [
+ 'Sofortige Wirkung für laufende Projekte',
+ 'Flexibilität bei der Spendenhöhe',
+ 'Spendenbescheinigung für Steuerzwecke',
+ 'Möglichkeit zur Projektbindung'
+ ],
+ ctaText: 'Jetzt spenden'
+ },
+ {
+ id: 'corporate',
+ name: 'Unternehmenspartnerschaft',
+ description: 'Strategische Partnerschaft für nachhaltige IT',
+ amount: 'Ab CHF 5000/Jahr',
+ icon: ,
+ benefits: [
+ 'Nachhaltigkeitsbericht für Ihr Unternehmen',
+ 'Mitarbeiter-Workshops zu nachhaltiger IT',
+ 'Logo-Platzierung auf unserer Website',
+ 'Jährlicher Impact-Report'
+ ],
+ ctaText: 'Partner werden'
+ },
+ {
+ id: 'equipment',
+ name: 'Geräte-Spende',
+ description: 'Spenden Sie funktionsfähige IT-Geräte',
+ icon: ,
+ benefits: [
+ 'Steuerliche Absetzbarkeit der Geräte',
+ 'Professionelle Datenlöschung garantiert',
+ 'Nachhaltigkeitszertifikat für Ihr Unternehmen',
+ 'Sichtbare Wirkung durch Geräte-Tracking'
+ ],
+ ctaText: 'Geräte spenden'
+ }
+ ]
+
+ const getCategoryIcon = (category: ImpactMetric['category']) => {
+ switch (category) {
+ case 'environmental': return
+ case 'social': return
+ case 'economic': return
+ }
+ }
+
+ const getCategoryColor = (category: ImpactMetric['category']) => {
+ switch (category) {
+ case 'environmental': return 'bg-green-50 border-green-200'
+ case 'social': return 'bg-blue-50 border-blue-200'
+ case 'economic': return 'bg-purple-50 border-purple-200'
+ }
+ }
+
+ return (
+
+ {/* Hero Section */}
+
+
+ {/* Sub Navigation */}
+
+
+ {/* E-Waste Problem Section */}
+
+
+ {/* Zero-Waste Solution Section */}
+
+
+ {/* Community Space Section */}
+
+
+ {/* Impact Overview */}
+
+
+
Warum Transparenz wichtig ist
+
+ Als gemeinnütziger Verein legen wir grössten Wert auf Transparenz. Jede unserer Zahlen ist nachvollziehbar dokumentiert,
+ damit Sie als Spender:in genau verstehen, wie Ihre Unterstützung wirkt.
+
+
+
+ {/* Key Metrics Cards */}
+
+ {IMPACT_METRICS.map((metric) => (
+
+
+
+ {getCategoryIcon(metric.category)}
+ {metric.verified && (
+
+
+ Verifiziert
+
+ )}
+
+ {metric.value}
+ {metric.title}
+
+
+ {metric.description}
+
+ Methodik & Berechnung
+ {metric.methodology}
+ Letzte Aktualisierung: {metric.lastUpdated}
+
+
+
+ ))}
+
+
+ {/* Impact Stories */}
+
+
Wirkung in Zahlen verstehen
+
},
+ { value: 'social', label: 'Sozial', icon:
},
+ { value: 'economic', label: 'Wirtschaftlich', icon:
}
+ ]}
+ >
+ {(activeTab) => (
+ <>
+ {activeTab === 'environmental' && (
+
+
+
Umweltwirkung im Detail
+
+
+
+ Jedes gerettete Gerät spart durchschnittlich {envSummary.co2PerDevice}kg CO₂-Emissionen
+
+
+
+ Wir vermeiden {envSummary.ewastePreventedTons.toFixed(1)} Tonnen Elektronikschrott pro Jahr
+
+
+
+ {Math.round(envSummary.reuseRate * 100)}% unserer Geräte werden wiederverwendet statt recycelt
+
+
+
+
+
Vergleich mit Neugeräten
+
+
+ Herstellung eines neuen Laptops:
+ {envSummary.co2ProductionKg}kg CO₂
+
+
+ Refurbishment eines Geräts:
+ {envSummary.co2RefurbishmentKg}kg CO₂
+
+
+ CO₂-Einsparung pro Gerät:
+ {envSummary.co2PerDevice}kg
+
+
+
+
+ )}
+
+ {activeTab === 'social' && (
+
+
+
Soziale Wirkung im Detail
+
+
+
+ ~{Math.round(socialSummary.internshipSuccessRate * 100)}% unserer Praktikant:innen finden IT-Jobs oder Weiterbildung
+
+
+
+ ~{socialSummary.careerReentries} berufliche Wiedereinstiege pro Jahr durch unser Programm
+
+
+
+ {getDefaultValue('people_helped_total')} Menschen in nachhaltiger IT begleitet seit 2003
+
+
+
+
+
Erfolgsgeschichten
+
+
"Dank RevampIT habe ich nach 3 Jahren Arbeitslosigkeit wieder Fuss gefasst in der IT-Branche."
+
- Sarah M., ehemalige Praktikantin
+
+
+
+ )}
+
+ {activeTab === 'economic' && (
+
+
+
Wirtschaftliche Wirkung
+
+
+
+ Kunden sparen durchschnittlich CHF {getDefaultNumeric('customer_savings_chf')} pro repariertem Gerät
+
+
+
+ KMU profitieren von günstigen Open Source-Lösungen
+
+
+
+ {getDefaultValue('team_size_community')} sinnvolle Arbeitsplätze in der Schweiz
+
+
+
+
+
Wirtschaftlicher Impact
+
+
+ Durchschnittliche Reparaturkosten:
+ CHF {getDefaultNumeric('avg_repair_cost_chf')}
+
+
+ Neugerät-Preis (vergleichbar):
+ CHF {getDefaultNumeric('new_device_comparison_chf')}
+
+
+ Einsparung pro Kunde:
+ CHF {getDefaultNumeric('customer_savings_chf')}
+
+
+
+
+ )}
+ >
+ )}
+
+
+
+
+ {/* Donation Methods */}
+
+
+
+
Wie Sie uns unterstützen können
+
+ Jede Unterstützung zählt und trägt direkt zu unserer Mission bei. Wählen Sie die für Sie passende Art der Unterstützung.
+
+
+
+
+ {donationMethods.map((method) => (
+
setSelectedDonationMethod(method.id)}
+ >
+
+
+
+ {method.icon}
+ {method.name}
+
+ {method.popular && (
+
Beliebt
+ )}
+
+ {method.description}
+ {method.amount && (
+ {method.amount}
+ )}
+
+
+
+ {method.benefits.map((benefit, index) => (
+
+
+ {benefit}
+
+ ))}
+
+
+ {method.ctaText}
+
+
+
+
+ ))}
+
+
+ {/* Donation Impact Calculator */}
+
+
+ Ihre Spenden-Wirkung berechnen
+
+ Sehen Sie sofort, welche Wirkung Ihre Spende haben kann
+
+
+
+
+
+
CHF {getDefaultNumeric('donation_impact_laptop_chf')}
+
Reparatur eines Laptops für eine Familie
+
+
+
CHF {getDefaultNumeric('donation_impact_internship_chf')}
+
Ein Monat Praktikumsstelle für Wiedereinsteiger:in
+
+
+
CHF {getDefaultNumeric('donation_impact_data_recovery_chf')}
+
Vollständige Datenrettung für KMU-Kunde
+
+
+
+
+
+
+
+ {/* Transparency & Reports */}
+
+
+
Transparenz & Berichterstattung
+
+ Wir berichten regelmässig über unsere Aktivitäten und Wirkung. Alle Dokumente sind öffentlich zugänglich.
+
+
+
+
+
+
+
+
+ Jahresbericht 2023
+
+
+
+
+ Vollständiger Tätigkeitsbericht mit allen Kennzahlen und Aktivitäten des Jahres 2023.
+
+
+ PDF herunterladen
+
+
+
+
+
+
+
+
+ Wirkungsbericht
+
+
+
+
+ Detaillierte Analyse unserer sozialen und ökologischen Wirkung mit Methodik-Erläuterungen.
+
+
+ Bericht ansehen
+
+
+
+
+
+
+
+
+ Transparenz-Register
+
+
+
+
+ Öffentliches Register aller Spenden und wie diese verwendet wurden.
+
+
+ Register öffnen
+
+
+
+
+
+
+ {/* Call to Action */}
+
+
+
Gemeinsam mehr erreichen
+
+ Ihre Unterstützung macht den Unterschied. Jeder Beitrag, ob gross oder klein, hilft uns dabei,
+ die Schweizer IT-Landschaft nachhaltiger zu gestalten und Menschen neue Chancen zu geben.
+
+
+
+ Jetzt spenden
+
+
+
+ Kontakt aufnehmen
+
+
+
+
+
+ )
+}
diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx
index a2d9bd12f..a3a97fe3b 100644
--- a/src/app/admin/layout.tsx
+++ b/src/app/admin/layout.tsx
@@ -9,9 +9,6 @@ import { redirect } from 'next/navigation'
import { auth } from '@/auth'
import { getAccessibleSections, isSuperAdmin, type AdminSection } from '@/lib/permissions'
import { AdminLayoutClient } from './AdminLayoutClient'
-import AppShell from '@/components/layout/AppShell'
-import { NextIntlClientProvider } from 'next-intl'
-import { getMessages, getLocale } from 'next-intl/server'
export default async function AdminLayout({
children,
@@ -43,24 +40,17 @@ export default async function AdminLayout({
redirect('/?error=no_admin_access')
}
- const messages = await getMessages()
- const locale = await getLocale()
-
return (
-
-
-
- {children}
-
-
-
+
+ {children}
+
)
}
diff --git a/src/app/admin/services/page.tsx b/src/app/admin/services/page.tsx
index 6ed882c5c..29fb9b1c0 100644
--- a/src/app/admin/services/page.tsx
+++ b/src/app/admin/services/page.tsx
@@ -10,16 +10,19 @@ import { auth } from '@/auth'
import { redirect } from 'next/navigation'
import { query } from '@/lib/auth/db'
import { TABLE_NAMES } from '@/config/database'
-import { REPAIRER_PROFILE_TIER } from '@/config/repairer-status'
+import { CATEGORY_LABELS } from '@/config/service-categories'
+import { formatPriceCents } from '@/config/marketplace'
import {
Plus,
Wrench,
Users,
+ Edit,
+ Eye,
CheckCircle,
+ Star,
+ Calendar,
} from 'lucide-react'
import AdminPageWrapper from '@/components/admin/AdminPageWrapper'
-import { ServiceListClient } from './ServiceListClient'
-import Heading from '@/components/admin/AdminHeading'
export const metadata: Metadata = {
title: 'Dienstleistungen verwalten | RevampIT Admin',
@@ -79,7 +82,7 @@ async function getServiceStats(): Promise {
try {
const techResult = await query<{ count: string }>(
- `SELECT COUNT(*) as count FROM ${TABLE_NAMES.IT_HILFE_TECHNICIAN_PROFILES} WHERE is_active = true AND profile_tier = '${REPAIRER_PROFILE_TIER.COMMUNITY}'`
+ `SELECT COUNT(*) as count FROM ${TABLE_NAMES.IT_HILFE_TECHNICIAN_PROFILES} WHERE is_active = true`
)
totalTechnicians = parseInt(techResult.rows[0]?.count || '0')
} catch {
@@ -107,6 +110,16 @@ async function getServices(): Promise {
}
}
+const formatPrice = formatPriceCents
+
+function formatDuration(minutes: number | null): string {
+ if (minutes === null) return '-'
+ if (minutes < 60) return `${minutes} Min.`
+ const hours = Math.floor(minutes / 60)
+ const mins = minutes % 60
+ if (mins === 0) return `${hours} Std.`
+ return `${hours} Std. ${mins} Min.`
+}
export default async function AdminServicesPage() {
const session = await auth()
@@ -123,7 +136,7 @@ export default async function AdminServicesPage() {
return (
- {/* Services Table with Search/Filters */}
-
+ {/* Services Table */}
+
+ {services.length > 0 ? (
+
+
+
+
+
+ Dienstleistung
+
+
+ Kategorie
+
+
+ Preis
+
+
+ Flags
+
+
+ Aktionen
+
+
+
+
+ {services.map((service) => (
+
+
+
+
+ {service.name}
+
+
+ /{service.slug}
+
+
+
+
+
+ {service.category ? CATEGORY_LABELS[service.category as keyof typeof CATEGORY_LABELS] || service.category : '-'}
+
+
+
+
+ {formatPrice(service.price_cents)}
+
+
+ {formatDuration(service.duration_minutes)}
+
+
+
+
+
+ {service.is_active ? 'Aktiv' : 'Inaktiv'}
+
+ {service.is_featured && (
+
+
+
+ )}
+ {service.is_bookable && (
+
+
+
+ )}
+
+
+
+
+ {service.is_featured && (
+
+
+
+ )}
+
+
+
+
+
+
+ ))}
+
+
+
+ ) : (
+
+
+
+ Noch keine Dienstleistungen
+
+
+ Erstellen Sie Ihre erste Dienstleistung, um Service-Termine anzubieten.
+
+
+
+ Erste Dienstleistung erstellen
+
+
+ )}
+
- {/* Info Box */}
+ {/* Quick Actions */}
-
+
Dienstleistungs-Verwaltung
-
-
- Dienstleistungen sind die Kernkompetenz von RevampIT. Biete Reparaturen, Installationen,
+
+
+ Dienstleistungen sind die Kernkompetenz von RevampIT. Bieten Sie Reparaturen, Installationen,
Beratungen und andere technische Services an. Kunden können online Termine buchen.
+
+
+ Dienstleistung erstellen
+
+
diff --git a/src/app/ai-cms/page.tsx b/src/app/ai-cms/page.tsx
new file mode 100644
index 000000000..f7345c0c4
--- /dev/null
+++ b/src/app/ai-cms/page.tsx
@@ -0,0 +1,32 @@
+import { Metadata } from 'next'
+import { HeroSection } from './sections/HeroSection'
+import { ProblemSection } from './sections/ProblemSection'
+import { WorkflowSection } from './sections/WorkflowSection'
+import { AccessControlSection } from './sections/AccessControlSection'
+import { FeaturesSection } from './sections/FeaturesSection'
+import { SuggestionTypesSection } from './sections/SuggestionTypesSection'
+import { ComparisonSection } from './sections/ComparisonSection'
+import { StatusSection } from './sections/StatusSection'
+import { CTASection } from './sections/CTASection'
+
+export const metadata: Metadata = {
+ title: 'Kontextuelle Website-Verbesserungen | RevampIT',
+ description: 'Unser Verbesserungssystem ermöglicht es Nutzern, direkt auf jeder Seite Feedback zu geben. Eine moderne Alternative zu herkömmlichen Content-Management-Systemen.',
+ keywords: ['Website Feedback', 'Content Management', 'User Feedback', 'Website Verbesserung', 'Community-driven Development'],
+}
+
+export default function AICMSPage() {
+ return (
+
+ )
+}
diff --git a/src/app/ai-cms/sections/AccessControlSection.tsx b/src/app/ai-cms/sections/AccessControlSection.tsx
new file mode 100644
index 000000000..f25dc797e
--- /dev/null
+++ b/src/app/ai-cms/sections/AccessControlSection.tsx
@@ -0,0 +1,41 @@
+export function AccessControlSection() {
+ const roles = [
+ { role: 'Alle Nutzer', can: ['Vorschläge einreichen', 'Eigene Vorschläge verfolgen'], color: 'blue' },
+ { role: 'Registrierte Mitglieder', can: ['Vorschläge bewerten', 'Kommentare hinzufügen'], color: 'green' },
+ { role: 'Redaktion / Staff', can: ['Alle Vorschläge verwalten', 'Status setzen', 'Änderungen umsetzen'], color: 'purple' },
+ ]
+
+ const colorMap: Record = {
+ blue: 'bg-blue-50 border-blue-100 text-blue-900',
+ green: 'bg-green-50 border-green-100 text-green-900',
+ purple: 'bg-purple-50 border-purple-100 text-purple-900',
+ }
+
+ return (
+
+
+
+ Zugangskontrolle
+
+
+ Das System funktioniert für alle — anonym oder eingeloggt. Mehr Rechte erhalten Mitglieder und Staff.
+
+
+ {roles.map((r) => (
+
+
{r.role}
+
+ {r.can.map((item) => (
+
+ ✓
+ {item}
+
+ ))}
+
+
+ ))}
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/CTASection.tsx b/src/app/ai-cms/sections/CTASection.tsx
new file mode 100644
index 000000000..480cf2141
--- /dev/null
+++ b/src/app/ai-cms/sections/CTASection.tsx
@@ -0,0 +1,30 @@
+import Link from 'next/link'
+
+export function CTASection() {
+ return (
+
+
+
+ Machen Sie Ihre Website besser — gemeinsam
+
+
+ Registrieren Sie sich kostenlos und helfen Sie mit, revamp-it.ch kontinuierlich zu verbessern.
+
+
+
+ Kostenlos registrieren
+
+
+ Kontakt aufnehmen
+
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/ComparisonSection.tsx b/src/app/ai-cms/sections/ComparisonSection.tsx
new file mode 100644
index 000000000..52fb23f21
--- /dev/null
+++ b/src/app/ai-cms/sections/ComparisonSection.tsx
@@ -0,0 +1,40 @@
+export function ComparisonSection() {
+ const rows = [
+ { feature: 'Kontext beim Feedback', classic: '❌ Manuell', new: '✅ Automatisch (URL, Screenshot)' },
+ { feature: 'Einreichung für Nutzer', classic: '❌ E-Mail / Formular', new: '✅ Direkt auf der Seite' },
+ { feature: 'Redaktioneller Aufwand', classic: '❌ Hoch', new: '✅ Niedrig (KI-Gruppierung)' },
+ { feature: 'Anonyme Einreichungen', classic: '✅ Möglich', new: '✅ Möglich' },
+ { feature: 'Benachrichtigungen', classic: '❌ Manuell', new: '✅ Automatisch' },
+ { feature: 'Datenschutz', classic: '✅ DSGVO-konform', new: '✅ DSGVO-konform' },
+ ]
+
+ return (
+
+
+
+ Klassisches CMS vs. Kontextuelles System
+
+
+
+
+
+ Funktion
+ Klassisch
+ Unser System
+
+
+
+ {rows.map((r, i) => (
+
+ {r.feature}
+ {r.classic}
+ {r.new}
+
+ ))}
+
+
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/FeaturesSection.tsx b/src/app/ai-cms/sections/FeaturesSection.tsx
new file mode 100644
index 000000000..9172d3968
--- /dev/null
+++ b/src/app/ai-cms/sections/FeaturesSection.tsx
@@ -0,0 +1,29 @@
+export function FeaturesSection() {
+ const features = [
+ { icon: '🗺️', title: 'Seitenkontext automatisch', description: 'URL, Screenshot und Seitentitel werden beim Einreichen automatisch erfasst.' },
+ { icon: '🏷️', title: 'Kategorisierung', description: 'Vorschläge nach Typ: Fehler, Inhalt, Idee, Rechtschreibung, Barrierefreiheit.' },
+ { icon: '🔔', title: 'Benachrichtigungen', description: 'Nutzer werden informiert, wenn ihr Vorschlag umgesetzt oder kommentiert wird.' },
+ { icon: '🤖', title: 'KI-Zusammenfassung', description: 'Ähnliche Vorschläge werden automatisch gruppiert, um Duplikate zu reduzieren.' },
+ { icon: '📊', title: 'Auswertung', description: 'Das Staff-Dashboard zeigt Trends und häufig gemeldete Bereiche.' },
+ { icon: '🔒', title: 'Datenschutzkonform', description: 'Anonyme Einreichungen möglich — keine Pflichtangaben.' },
+ ]
+
+ return (
+
+
+
+ Funktionen
+
+
+ {features.map((f) => (
+
+
{f.icon}
+
{f.title}
+
{f.description}
+
+ ))}
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/HeroSection.tsx b/src/app/ai-cms/sections/HeroSection.tsx
new file mode 100644
index 000000000..e3cda076d
--- /dev/null
+++ b/src/app/ai-cms/sections/HeroSection.tsx
@@ -0,0 +1,34 @@
+import Link from 'next/link'
+
+export function HeroSection() {
+ return (
+
+
+
+ Kontextuelles Feedback-System
+
+
+ Website-Verbesserungen direkt auf der Seite
+
+
+ Unser Verbesserungssystem ermöglicht es Nutzern, Feedback direkt auf jeder Seite zu geben —
+ ohne E-Mail, ohne Ticket, ohne Umwege. Eine moderne Alternative zu herkömmlichen CMS-Workflows.
+
+
+
+ Jetzt mitmachen
+
+
+ So funktioniert es
+
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/ProblemSection.tsx b/src/app/ai-cms/sections/ProblemSection.tsx
new file mode 100644
index 000000000..c8435484f
--- /dev/null
+++ b/src/app/ai-cms/sections/ProblemSection.tsx
@@ -0,0 +1,38 @@
+export function ProblemSection() {
+ const problems = [
+ {
+ title: 'Feedback geht verloren',
+ description: 'Nutzer finden einen Fehler, öffnen aber keine E-Mail. Der Fehler bleibt unbemerkt.',
+ },
+ {
+ title: 'Fehlender Kontext',
+ description: 'Bug-Reports ohne Screenshot oder URL sind kaum verwertbar.',
+ },
+ {
+ title: 'Langsame Redaktionszyklen',
+ description: 'Inhaltliche Änderungen brauchen Wochen, bis sie jemand einpflegt.',
+ },
+ ]
+
+ return (
+
+
+
+ Das Problem mit klassischem Feedback
+
+
+ Traditionelle Rückmeldewege — E-Mail, Kontaktformular, Ticket-System — haben alle denselben
+ Nachteil: sie trennen Kontext vom Problem.
+
+
+ {problems.map((p) => (
+
+
{p.title}
+
{p.description}
+
+ ))}
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/StatusSection.tsx b/src/app/ai-cms/sections/StatusSection.tsx
new file mode 100644
index 000000000..0d41c3e76
--- /dev/null
+++ b/src/app/ai-cms/sections/StatusSection.tsx
@@ -0,0 +1,32 @@
+export function StatusSection() {
+ return (
+
+
+
+ Aktueller Status
+
+
+
+ In Entwicklung — Beta
+
+
+ Das Verbesserungssystem wird schrittweise auf revamp-it.ch eingeführt. Zuerst auf ausgewählten
+ Seiten, dann auf der gesamten Plattform.
+
+
+ {[
+ { phase: 'Phase 1', label: 'Abgeschlossen', detail: 'Backend, Datenbank, Admin-Verwaltung', done: true },
+ { phase: 'Phase 2', label: 'Aktiv', detail: 'Frontend-Widget auf ausgewählten Seiten', done: false },
+ { phase: 'Phase 3', label: 'Geplant', detail: 'KI-Gruppierung, öffentliche Übersicht', done: false },
+ ].map((p) => (
+
+
{p.phase}
+
{p.label}
+
{p.detail}
+
+ ))}
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/SuggestionTypesSection.tsx b/src/app/ai-cms/sections/SuggestionTypesSection.tsx
new file mode 100644
index 000000000..f8b37a965
--- /dev/null
+++ b/src/app/ai-cms/sections/SuggestionTypesSection.tsx
@@ -0,0 +1,34 @@
+export function SuggestionTypesSection() {
+ const types = [
+ { label: 'Fehler', emoji: '🐛', description: 'Etwas funktioniert nicht oder zeigt falsche Informationen an.' },
+ { label: 'Inhalt', emoji: '✏️', description: 'Text ist veraltet, unvollständig oder missverständlich.' },
+ { label: 'Idee', emoji: '💡', description: 'Neue Funktion oder Verbesserungsvorschlag.' },
+ { label: 'Rechtschreibung', emoji: '🔤', description: 'Schreibfehler, Grammatik oder Formatierungsprobleme.' },
+ { label: 'Barrierefreiheit', emoji: '♿', description: 'Problem mit Screenreader, Kontrast oder Tastaturnavigation.' },
+ { label: 'Sonstiges', emoji: '📌', description: 'Allgemeines Feedback, das in keine Kategorie passt.' },
+ ]
+
+ return (
+
+
+
+ Arten von Vorschlägen
+
+
+ Jede Einreichung wird einem Typ zugeordnet, damit das Team Prioritäten setzen kann.
+
+
+ {types.map((t) => (
+
+
{t.emoji}
+
+
{t.label}
+
{t.description}
+
+
+ ))}
+
+
+
+ )
+}
diff --git a/src/app/ai-cms/sections/WorkflowSection.tsx b/src/app/ai-cms/sections/WorkflowSection.tsx
new file mode 100644
index 000000000..d34a6e1e4
--- /dev/null
+++ b/src/app/ai-cms/sections/WorkflowSection.tsx
@@ -0,0 +1,34 @@
+export function WorkflowSection() {
+ const steps = [
+ { step: '1', title: 'Verbesserung entdecken', description: 'Nutzer klickt auf das Feedback-Symbol auf einer beliebigen Seite.' },
+ { step: '2', title: 'Vorschlag einreichen', description: 'Kurze Beschreibung, Typ (Fehler, Inhalt, Idee) und Screenshot werden automatisch erfasst.' },
+ { step: '3', title: 'Prüfung durch Redaktion', description: 'Das Team bewertet Vorschläge im Admin-Bereich und entscheidet über Umsetzung.' },
+ { step: '4', title: 'Umsetzung & Bestätigung', description: 'Umgesetzte Vorschläge werden als erledigt markiert — der Einreichende erhält eine Benachrichtigung.' },
+ ]
+
+ return (
+
+
+
+ So funktioniert das System
+
+
+
+
+ {steps.map((s) => (
+
+
+ {s.step}
+
+
+
{s.title}
+
{s.description}
+
+
+ ))}
+
+
+
+
+ )
+}
diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx
index db038570d..c3cb3aa2a 100644
--- a/src/app/dashboard/page.tsx
+++ b/src/app/dashboard/page.tsx
@@ -2,209 +2,265 @@ import { Metadata } from 'next'
import { auth } from '@/auth'
import { redirect } from 'next/navigation'
import Link from 'next/link'
-import { AlertCircle } from 'lucide-react'
-import { EmailVerificationBanner } from '@/components/dashboard/EmailVerificationBanner'
-import { DashboardCard } from '@/components/dashboard/DashboardCard'
-import {
- getAllDashboardCards,
- groupCardsByCategory,
- DASHBOARD_CATEGORIES,
-} from '@/config/dashboard'
-import Heading from '@/components/ui/Heading'
-import { query } from '@/lib/auth/db'
-import { TABLE_NAMES } from '@/config/database'
-import { BOOKING_STATUS } from '@/config/booking-status'
-import { formatDate } from '@/lib/date-formats'
-import { logger } from '@/lib/logger'
-import { cn } from '@/lib/utils'
+import { ROLES } from '@/lib/constants'
+import { getCurrentUserRole } from '@/middleware/admin'
import { getTextColor } from '@/lib/design-system'
-import { getTranslations, getLocale } from 'next-intl/server'
-import { ORG } from '@/config/org'
+import { cn } from '@/lib/utils'
+import { EmailVerificationBanner } from '@/components/dashboard/EmailVerificationBanner'
+import { OnboardingChecklist } from '@/components/dashboard/OnboardingChecklist'
+import { isStaffEmail } from '@/lib/permissions'
-export async function generateMetadata(): Promise {
- const locale = await getLocale()
- const t = await getTranslations({ locale, namespace: 'dashboard.meta' })
- return {
- title: `${t('dashboardTitle')} | ${ORG.name}`,
- description: t('dashboardDesc'),
- }
-}
-
-interface MemberStatus {
- isMember: boolean
- memberSince: string | null
- memberType: string | null
-}
-
-interface ActivityCounts {
- activeAppointments: number
- pendingQuotes: number
-}
-
-
-async function getMemberStatus(userId: string): Promise {
- try {
- const result = await query<{
- is_member: boolean
- member_since: string | null
- member_type: string | null
- }>(
- `SELECT is_member, member_since, member_type
- FROM ${TABLE_NAMES.USERS}
- WHERE id = $1`,
- [userId]
- )
- const row = result.rows[0]
- return {
- isMember: row?.is_member ?? false,
- memberSince: row?.member_since ?? null,
- memberType: row?.member_type ?? null,
- }
- } catch (error) {
- logger.error('Failed to fetch member status', { userId, error })
- return { isMember: false, memberSince: null, memberType: null }
- }
-}
-
-async function getActivityCounts(userId: string): Promise {
- try {
- const result = await query<{
- active_appointments: string
- pending_quotes: string
- }>(
- `SELECT
- COUNT(CASE WHEN status NOT IN ('${BOOKING_STATUS.COMPLETED}', '${BOOKING_STATUS.CANCELLED}', '${BOOKING_STATUS.REJECTED}') THEN 1 END) AS active_appointments,
- COUNT(CASE WHEN status = '${BOOKING_STATUS.QUOTED}' THEN 1 END) AS pending_quotes
- FROM ${TABLE_NAMES.SERVICE_APPOINTMENTS}
- WHERE user_id = $1`,
- [userId]
- )
- return {
- activeAppointments: parseInt(result.rows[0]?.active_appointments ?? '0', 10),
- pendingQuotes: parseInt(result.rows[0]?.pending_quotes ?? '0', 10),
- }
- } catch (error) {
- logger.error('Failed to fetch activity counts', { userId, error })
- return { activeAppointments: 0, pendingQuotes: 0 }
- }
+export const metadata: Metadata = {
+ title: 'Dashboard | RevampIT',
+ description: 'Verwalten Sie Ihr RevampIT-Konto, Workshops, Bestellungen und mehr.',
}
export default async function DashboardPage() {
- const t = await getTranslations('dashboard.home')
const session = await auth()
if (!session?.user) {
redirect('/auth/login?callbackUrl=/dashboard')
}
- const [memberStatus, counts] = await Promise.all([
- getMemberStatus(session.user.id!),
- getActivityCounts(session.user.id!),
- ])
-
- const allCards = getAllDashboardCards({
- role: session.user.role ?? null,
- isStaff: session.user.isStaff,
- isSuperAdmin: false,
- })
-
- // Inject live count badges on relevant cards
- const cardsWithBadges = allCards.map(card => {
- if (card.id === 'appointments' && counts.activeAppointments > 0)
- return { ...card, badge: t('activeBadge', { count: counts.activeAppointments }) }
- if (card.id === 'bookings' && counts.activeAppointments > 0)
- return { ...card, badge: t('activeBadge', { count: counts.activeAppointments }) }
- return card
- })
-
- const grouped = groupCardsByCategory(cardsWithBadges)
-
- const userName = session.user.name || session.user.email || t('unknownUser')
+ const userRole = await getCurrentUserRole()
return (
-
{/* Email Verification Banner */}
{!session.user.emailVerified && session.user.email && (
)}
- {/* Header */}
-
-
-
- {t('welcomeBack', { name: userName })}
-
-
- {t('subtitle')}
-
-
+ {/* Onboarding Checklist */}
+
- {/* Member status — inline badge, not full banner */}
- {memberStatus.isMember ? (
-
- 🏅
-
- {memberStatus.memberType === 'regular' ? t('memberTypeRegular')
- : memberStatus.memberType === 'reduced' ? t('memberTypeReduced')
- : memberStatus.memberType === 'honorary' ? t('memberTypeHonorary')
- : t('memberFallback')}
- {memberStatus.memberSince && (
- · {t('memberSince', { date: formatDate(memberStatus.memberSince) })}
- )}
-
-
- ) : (
-
- {t('becomeMember')}
-
- )}
+
+
+ Willkommen zurück, {session.user.name || session.user.email}!
+
+
+ Verwalten Sie Ihr Konto und entdecken Sie alle verfügbaren Funktionen.
+
- {/* Pending quotes alert */}
- {counts.pendingQuotes > 0 && (
-
-
-
{t('pendingQuotes', { count: counts.pendingQuotes })}
-
- {t('viewAlerts')}
-
-
- )}
-
- {/* Grouped card sections */}
- {Array.from(grouped.entries()).map(([category, cards]) => {
- if (cards.length === 0) return null
- const categoryConfig = DASHBOARD_CATEGORIES[category]
- return (
-
-
- {categoryConfig.title}
-
-
- {cards.map(card => (
-
- ))}
+
+ {/* Profile Card */}
+
+
+
+
+ {session.user.name?.charAt(0) || session.user.email?.charAt(0) || 'U'}
+
-
- )
- })}
+
+
+ Mein Profil
+
+
+ Persönliche Daten verwalten
+
+
+
+
+ {/* Workshops Card */}
+
+
+
+ 🎓
+
+
+
+ Meine Workshops
+
+
+ Angemeldete Kurse verwalten
+
+
+
+
+
+ {/* Appointments Card */}
+
+
+
+ 📅
+
+
+
+ Termine
+
+
+ Service-Termin buchen
+
+
+
+
+
+ {/* Role-specific cards */}
+ {userRole === ROLES.SELLER && (
+
+
+
+ 🏪
+
+
+
+ Seller Dashboard
+
+
+ Produkte und Verkäufe
+
+
+
+
+ )}
+
+ {userRole === ROLES.REPAIRER && (
+
+
+
+ 🔧
+
+
+
+ Repairer Dashboard
+
+
+ Reparaturen verwalten
+
+
+
+
+ )}
+
+ {/* Upsell cards for capabilities (visible if user doesn't have role yet) */}
+ {userRole !== ROLES.SELLER && (
+
+
+
+ 🏪
+
+
+
+ Auf Revamp‑IT verkaufen
+
+
+ Eigene Produkte anbieten – Versand direkt an Käufer
+
+
+
+
+ )}
+
+ {userRole !== ROLES.REPAIRER && (
+
+
+
+ 🔧
+
+
+
+ Reparaturen anbieten
+
+
+ Dienstleistungen publizieren und Anfragen erhalten
+
+
+
+
+ )}
+
+ {/* Show admin card for staff users */}
+ {(session.user.isStaff || isStaffEmail(session.user.email || '')) && (
+
+
+
+ ⚙️
+
+
+
+ Admin-Bereich
+
+
+ System verwalten
+
+
+
+
+ )}
+
+ {/* Workshop Proposal Card */}
+
+
+
+ 🎓
+
+
+
+ Workshop vorschlagen
+
+
+ Eigene Workshops anbieten
+
+
+
+
+
+
+ {/* Blog Submit Card */}
+
+
+
+ ✍️
+
+
+
+ Beitrag verfassen
+
+
+ Idee teilen oder Tutorial schreiben
+
+
+
+
+
)
-}
+}
\ No newline at end of file
diff --git a/src/app/dashboard/seller/page.tsx b/src/app/dashboard/seller/page.tsx
index 53c138348..deb96153b 100644
--- a/src/app/dashboard/seller/page.tsx
+++ b/src/app/dashboard/seller/page.tsx
@@ -1,9 +1,8 @@
'use client'
-import { useState, useEffect, useCallback } from 'react'
+import { useState, useEffect } from 'react'
import { useSession } from 'next-auth/react'
import { useRouter } from 'next/navigation'
-import { apiFetch } from '@/lib/api/client'
import Link from 'next/link'
import {
Package,
@@ -19,9 +18,6 @@ import {
RefreshCw
} from 'lucide-react'
import { ListingImage } from '@/components/marketplace/ListingImage'
-import { useTranslations } from 'next-intl'
-import Heading from '@/components/ui/Heading'
-import { Button } from '@/components/ui/button'
import { ROLES } from '@/lib/constants'
import { LISTING_STATUS_CONFIG } from '@/config/marketplace'
import type { ListingStatus } from '@/config/marketplace'
@@ -55,7 +51,6 @@ interface DashboardData {
}
export default function SellerDashboard() {
- const t = useTranslations('dashboard.seller')
const { data: session, status } = useSession()
const router = useRouter()
const [data, setData] = useState(null)
@@ -67,23 +62,6 @@ export default function SellerDashboard() {
document.title = 'Seller Dashboard | RevampIT'
}, [])
- const fetchDashboardData = useCallback(async () => {
- setIsLoading(true)
- setError(null)
- try {
- const result = await apiFetch('/api/seller/dashboard')
- if (result.success && result.data) {
- setData(result.data)
- } else {
- throw new Error(result.error || t('loadErrorGeneric'))
- }
- } catch (err) {
- setError(err instanceof Error ? err.message : t('unexpectedError'))
- } finally {
- setIsLoading(false)
- }
- }, [t])
-
useEffect(() => {
if (status === 'loading') return
@@ -106,33 +84,53 @@ export default function SellerDashboard() {
}
fetchDashboardData()
- }, [session, status, router, fetchDashboardData])
+ }, [session, status, router])
+
+ const fetchDashboardData = async () => {
+ setIsLoading(true)
+ setError(null)
+
+ try {
+ const response = await fetch('/api/seller/dashboard')
+ const result = await response.json()
+
+ if (result.success && result.data) {
+ setData(result.data)
+ } else {
+ throw new Error(result.error || 'Fehler beim Laden des Dashboards')
+ }
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'Ein unerwarteter Fehler ist aufgetreten')
+ } finally {
+ setIsLoading(false)
+ }
+ }
const quickActions = [
{
- title: t('quickNewProduct'),
- description: t('quickNewProductDesc'),
+ title: 'Neues Produkt',
+ description: 'Produkt zum Marketplace hinzufügen',
href: '/marketplace/sell',
icon: Plus,
color: 'bg-green-500',
},
{
- title: t('quickMyProducts'),
- description: t('quickMyProductsDesc'),
+ title: 'Meine Produkte',
+ description: 'Alle Ihre Produkte verwalten',
href: '/dashboard/listings',
icon: Package,
color: 'bg-blue-500',
},
{
- title: t('quickSales'),
- description: t('quickSalesDesc'),
+ title: 'Verkäufe',
+ description: 'Bestellungen und Verkäufe anzeigen',
href: '/dashboard/orders',
icon: TrendingUp,
color: 'bg-purple-500',
},
{
- title: t('quickMarketplace'),
- description: t('quickMarketplaceDesc'),
+ title: 'Marketplace',
+ description: 'Marketplace ansehen',
href: '/marketplace',
icon: BarChart3,
color: 'bg-orange-500',
@@ -149,7 +147,7 @@ export default function SellerDashboard() {
return (
- {t('loading')}
+ Dashboard wird geladen...
)
}
@@ -158,14 +156,17 @@ export default function SellerDashboard() {
return (
-
- {t('loadErrorTitle')}
-
+
+ Fehler beim Laden
+
{error}
-
+
- {t('retry')}
-
+ Erneut versuchen
+
)
}
@@ -188,17 +189,17 @@ export default function SellerDashboard() {
-
+
Seller Dashboard
-
+
- {t('pageSubtitle')}
+ Verwalten Sie Ihre Produkte im RevampIT Marketplace und verfolgen Sie Ihre Verkäufe.
@@ -210,9 +211,9 @@ export default function SellerDashboard() {
-
{t('statsProducts')}
+
Meine Produkte
{stats.totalProducts}
-
{t('statsActive', { count: stats.activeProducts })}
+
{stats.activeProducts} aktiv
@@ -221,13 +222,13 @@ export default function SellerDashboard() {
-
{t('statsRevenue')}
+
Umsatz
CHF {stats.totalRevenue.toLocaleString('de-CH')}
- {t('statsTotalRevenue')}
+ Gesamtumsatz
@@ -237,9 +238,9 @@ export default function SellerDashboard() {
-
{t('statsViews')}
+
Produkt-Aufrufe
{stats.totalViews.toLocaleString()}
-
{t('statsFavorites', { count: stats.totalFavorites })}
+
{stats.totalFavorites} Favoriten
@@ -248,9 +249,9 @@ export default function SellerDashboard() {
-
{t('statsOrders')}
+
Bestellungen
{stats.totalOrders}
-
{t('statsPending', { count: stats.pendingOrders })}
+
ausstehend: {stats.pendingOrders}
@@ -261,11 +262,11 @@ export default function SellerDashboard() {
{/* Recent Products */}
-
- {t('recentTitle')}
-
+
+ Meine Produkte
+
- {t('recentSubtitle')}
+ Übersicht Ihrer Produkte
@@ -274,14 +275,14 @@ export default function SellerDashboard() {
- {t('noProducts')}
+ Sie haben noch keine Produkte erstellt.
- {t('createFirst')}
+ Erstes Produkt erstellen
) : (
@@ -294,11 +295,11 @@ export default function SellerDashboard() {
-
+
{product.title}
-
+
- CHF {product.price} • {t('viewCount', { count: product.viewsCount })}
+ CHF {product.price} • {product.viewsCount} Aufrufe
@@ -318,7 +319,7 @@ export default function SellerDashboard() {
href="/dashboard/listings"
className="text-sm text-green-600 hover:text-green-700 dark:text-green-400 font-medium flex items-center gap-1"
>
- {t('manageAll')}
+ Alle Produkte verwalten
@@ -329,11 +330,11 @@ export default function SellerDashboard() {
{/* Quick Actions */}
-
- {t('quickActionsTitle')}
-
+
+ Schnellzugriff
+
- {t('quickActionsSubtitle')}
+ Häufig verwendete Seller-Funktionen
@@ -349,9 +350,9 @@ export default function SellerDashboard() {
-
+
{action.title}
-
+
{action.description}
@@ -370,24 +371,26 @@ export default function SellerDashboard() {
-
- {t('infoTitle')}
-
+
+ RevampIT Marketplace
+
- {t('infoDesc')}
+ Als Seller können Sie Ihre eigenen refurbished Produkte im RevampIT Marketplace verkaufen.
+ Ihre Produkte erscheinen neben den offiziellen RevampIT Produkten und helfen dabei,
+ die Kreislaufwirtschaft zu fördern.
- {t('viewMarketplace')}
+ Marketplace ansehen
- {t('addProduct')}
+ Produkt hinzufügen
diff --git a/src/app/dashboard/workshops/page.tsx b/src/app/dashboard/workshops/page.tsx
index ce2a45b22..c31a166c7 100644
--- a/src/app/dashboard/workshops/page.tsx
+++ b/src/app/dashboard/workshops/page.tsx
@@ -2,18 +2,12 @@
import { useSession } from 'next-auth/react'
import { useEffect, useState } from 'react'
-import { useRouter, useSearchParams } from 'next/navigation'
-import { apiFetch } from '@/lib/api/client'
-import { Calendar, Clock, MapPin, Users, CheckCircle, XCircle, AlertCircle, ArrowLeft, LogIn } from 'lucide-react'
-import { EmptyState } from '@/components/ui/EmptyState'
+import { Calendar, Clock, MapPin, Users, CheckCircle, XCircle, AlertCircle, ArrowLeft } from 'lucide-react'
import { WORKSHOP_REGISTRATION_STATUS } from '@/config/workshop-registration-status'
import Link from 'next/link'
import { getTextColor, getStatusColors } from '@/lib/design-system'
import { cn } from '@/lib/utils'
-import { useTranslations } from 'next-intl'
import { formatDate } from '@/lib/date-formats'
-import { Modal } from '@/components/ui/Modal'
-import Heading from '@/components/ui/Heading'
interface WorkshopRegistration {
id: string
@@ -32,54 +26,35 @@ interface WorkshopRegistration {
}
export default function WorkshopsDashboard() {
- const tDates = useTranslations('dashboard.dates')
- const t = useTranslations('dashboard.workshops')
const { data: session, status } = useSession()
- const router = useRouter()
- const searchParams = useSearchParams()
const [registrations, setRegistrations] = useState
([])
const [loading, setLoading] = useState(true)
const [error, setError] = useState('')
- const [paymentSuccess, setPaymentSuccess] = useState(
- () => searchParams.get('payment') === 'success'
- )
const [editingId, setEditingId] = useState(null)
const [editRating, setEditRating] = useState(5)
const [editFeedback, setEditFeedback] = useState('')
const [saving, setSaving] = useState(false)
- // Strip the ?payment=success param from the URL after we've captured it into state
useEffect(() => {
- if (searchParams.get('payment') === 'success') {
- router.replace('/dashboard/workshops')
+ if (session?.user) {
+ fetchRegistrations()
}
- }, [searchParams, router])
-
- useEffect(() => {
- if (!session?.user) return
- let cancelled = false
- async function load() {
- const result = await apiFetch<{ registrations: WorkshopRegistration[] }>('/api/user/workshop-registrations')
- if (cancelled) return
- if (result.success && result.data) {
- setRegistrations(result.data.registrations || [])
- } else {
- setError(result.error || t('loadError'))
- }
- setLoading(false)
- }
- load()
- return () => { cancelled = true }
- }, [session, t])
+ }, [session])
const fetchRegistrations = async () => {
- const result = await apiFetch<{ registrations: WorkshopRegistration[] }>('/api/user/workshop-registrations')
- if (result.success && result.data) {
- setRegistrations(result.data.registrations || [])
- } else {
- setError(result.error || t('loadError'))
+ try {
+ const response = await fetch('/api/user/workshop-registrations')
+ if (response.ok) {
+ const data = await response.json()
+ setRegistrations(data.data?.registrations || [])
+ } else {
+ setError('Fehler beim Laden der Workshop-Anmeldungen')
+ }
+ } catch (error) {
+ setError('Netzwerkfehler beim Laden der Daten')
+ } finally {
+ setLoading(false)
}
- setLoading(false)
}
const openEdit = (reg: WorkshopRegistration) => {
@@ -91,17 +66,23 @@ export default function WorkshopsDashboard() {
const saveEdit = async () => {
if (!editingId) return
setSaving(true)
- const result = await apiFetch(`/api/workshops/registrations/${editingId}`, {
- method: 'PATCH',
- body: { rating: editRating, feedback: editFeedback }
- })
- if (result.success) {
- setEditingId(null)
- fetchRegistrations()
- } else {
- setError(result.error || t('saveFailed'))
+ try {
+ const resp = await fetch(`/api/workshops/registrations/${editingId}`, {
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ rating: editRating, feedback: editFeedback })
+ })
+ if (resp.ok) {
+ setEditingId(null)
+ fetchRegistrations()
+ } else {
+ alert('Speichern fehlgeschlagen')
+ }
+ } catch {
+ alert('Netzwerkfehler beim Speichern')
+ } finally {
+ setSaving(false)
}
- setSaving(false)
}
const getStatusIcon = (status: string) => {
@@ -120,11 +101,11 @@ export default function WorkshopsDashboard() {
const getStatusText = (status: string) => {
switch (status) {
case WORKSHOP_REGISTRATION_STATUS.CONFIRMED:
- return t('statusConfirmed')
+ return 'Bestätigt'
case WORKSHOP_REGISTRATION_STATUS.PENDING:
- return t('statusPending')
+ return 'Ausstehend'
case WORKSHOP_REGISTRATION_STATUS.CANCELLED:
- return t('statusCancelled')
+ return 'Storniert'
default:
return status
}
@@ -154,19 +135,18 @@ export default function WorkshopsDashboard() {
return (
-
- {t('login')}
-
- }
- />
+
+
Anmeldung erforderlich
+
+ Bitte melden Sie sich an, um Ihre Workshop-Anmeldungen zu sehen.
+
+
+ Anmelden
+
+
)
@@ -182,31 +162,14 @@ export default function WorkshopsDashboard() {
className={cn('inline-flex items-center mb-4', getTextColor('neutral', 'muted'), 'hover:text-primary-600')}
>
- {t('backToDashboard')}
+ Zurück zum Dashboard
- {t('pageTitle')}
+ Meine Workshops
- {t('pageSubtitle')}
+ Übersicht Ihrer Workshop-Anmeldungen und Teilnahmen
- {/* Payment success banner (shown after Payrexx redirect) */}
- {paymentSuccess && (
-
-
-
-
{t('paymentSuccess')}
-
-
setPaymentSuccess(false)}
- className="text-emerald-600 hover:text-emerald-800 text-lg leading-none"
- aria-label="Schliessen"
- >
- ×
-
-
- )}
-
{/* Error Message */}
{error && (
@@ -221,9 +184,9 @@ export default function WorkshopsDashboard() {
-
+
{registration.workshop_title}
-
+
{getStatusIcon(registration.status)}
@@ -231,7 +194,7 @@ export default function WorkshopsDashboard() {
- {tDates('registeredOn', { date: formatDate(registration.created_at) })}
+ Angemeldet am {formatDate(registration.created_at)}
@@ -242,10 +205,10 @@ export default function WorkshopsDashboard() {
- {t('confirmedTitle')}
+ Ihre Anmeldung wurde bestätigt!
- {t('confirmedDesc')}
+ Sie erhalten in Kürze weitere Informationen zu Datum und Ort.
)}
@@ -254,10 +217,10 @@ export default function WorkshopsDashboard() {
-
{t('pendingTitle')}
+
Anmeldung ausstehend
- {t('pendingDesc')}
+ Ihre Anmeldung wird von unserem Team geprüft. Sie erhalten eine Bestätigung per E-Mail.
)}
@@ -266,11 +229,11 @@ export default function WorkshopsDashboard() {
- {t('cancelledTitle')}
+ Anmeldung storniert
{registration.cancelled_at && (
- {t('cancelledOn', { date: formatDate(registration.cancelled_at) })}
+ Storniert am {formatDate(registration.cancelled_at)}
)}
@@ -281,26 +244,31 @@ export default function WorkshopsDashboard() {
{
- if (!confirm(t('confirmCancel'))) return
- const result = await apiFetch(`/api/workshops/registrations/${registration.id}`, {
- method: 'PATCH',
- body: { action: 'cancel' }
- })
- if (result.success) {
- fetchRegistrations()
- } else {
- setError(result.error || t('cancelFailed'))
+ if (!confirm('Möchten Sie diese Anmeldung wirklich stornieren?')) return
+ try {
+ const resp = await fetch(`/api/workshops/registrations/${registration.id}`, {
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ action: 'cancel' })
+ })
+ if (resp.ok) {
+ fetchRegistrations()
+ } else {
+ alert('Stornierung fehlgeschlagen')
+ }
+ } catch {
+ alert('Netzwerkfehler bei der Stornierung')
}
}}
className="px-4 py-2 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50"
>
- {t('cancelButton')}
+ Anmeldung stornieren
openEdit(registration)}
className="px-4 py-2 rounded-lg border border-indigo-300 text-indigo-700 hover:bg-indigo-50"
>
- {registration.feedback || registration.rating ? t('feedbackEdit') : t('feedbackAdd')}
+ {registration.feedback || registration.rating ? 'Feedback bearbeiten' : 'Feedback hinzufügen'}
)}
@@ -308,58 +276,75 @@ export default function WorkshopsDashboard() {
))}
) : (
-
- {t('discoverWorkshops')}
-
- }
- />
+
+
+
+ Noch keine Workshop-Anmeldungen
+
+
+ Sie haben sich noch für keine Workshops angemeldet.
+
+
+ Workshops entdecken
+
+
)}
-
setEditingId(null)} title={t('modalTitle')}>
-
-
-
{t('ratingLabel')}
-
setEditRating(Math.max(1, Math.min(5, Number(e.target.value))))}
- className="w-24 px-3 py-2 border border-gray-300 rounded-lg"
- />
+
setEditingId(null)}>
+
+
Feedback bearbeiten
+
+
+ Bewertung (1-5)
+ setEditRating(Math.max(1, Math.min(5, Number(e.target.value))))}
+ className="w-24 px-3 py-2 border border-gray-300 rounded-lg"
+ />
+
+
+ Feedback
+
-
-
- setEditingId(null)} className="px-4 py-2 rounded-lg border border-gray-300">{t('cancel')}
-
- {saving ? t('saving') : t('save')}
-
-
)
}
+// Simple modal
+function Modal({ open, onClose, children }: { open: boolean, onClose: () => void, children: React.ReactNode }) {
+ if (!open) return null
+ return (
+
+
e.stopPropagation()}>
+ {children}
+
+
+ )
+}
+
+
+
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 67c852fc7..c887b9b90 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,39 +1,32 @@
-import type { Viewport } from "next";
-import { Inter } from 'next/font/google'
-import { getLocale } from 'next-intl/server'
+import type { Metadata } from "next";
+import { Providers } from "@/components/providers/providers";
+import ConditionalMainLayout from "@/components/layout/ConditionalMainLayout";
import { CSRF_SCRIPT } from "@/lib/auth/csrf";
import "./globals.css";
-const inter = Inter({
- subsets: ['latin', 'latin-ext'],
- display: 'swap',
- variable: '--font-inter',
-})
+// Use system fonts to avoid build-time network fetches
+const interClassName = "";
-export const viewport: Viewport = {
- width: 'device-width',
- initialScale: 1,
- maximumScale: 5,
+export const metadata: Metadata = {
+ title: "RevampIT",
+ description: "RevampIT - Nachhaltige Technologielösungen durch Aufarbeitung und Recycling. Helfen Sie mit, Elektroschrott zu reduzieren und Technologie für alle zugänglich zu machen.",
+ keywords: ["Elektroschrott", "Recycling", "Aufarbeitung", "nachhaltige Technologie", "Workshops", "Freiwilligenarbeit"],
};
-export default async function RootLayout({
+export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
- const locale = await getLocale()
-
return (
-
-
-
- Zum Inhalt springen
-
+
+
- {children}
+
+
+ {children}
+
+
);
diff --git a/src/app/services/[service]/page.tsx b/src/app/services/[service]/page.tsx
new file mode 100644
index 000000000..eb5409d6e
--- /dev/null
+++ b/src/app/services/[service]/page.tsx
@@ -0,0 +1,164 @@
+import { Metadata } from 'next'
+import { notFound } from 'next/navigation'
+import ServiceHero from '@/components/services/ServiceHero'
+import ServiceFeatures from '@/components/services/ServiceFeatures'
+import ServicePricing from '@/components/services/ServicePricing'
+import ServiceProcessSection from '@/components/services/ServiceProcess'
+import ServiceCTA from '@/components/services/ServiceCTA'
+import { getService, getAllServiceSlugs } from '@/lib/services'
+import { Clock } from 'lucide-react'
+
+/**
+ * Generate static paths for all featured services
+ */
+export async function generateStaticParams() {
+ const slugs = await getAllServiceSlugs()
+ return slugs.map((slug) => ({ service: slug }))
+}
+
+export async function generateMetadata({ params }: { params: Promise<{ service: string }> }): Promise {
+ const { service: slug } = await params
+ const service = await getService(slug)
+
+ if (!service) {
+ return {
+ title: 'Service Not Found | RevampIT',
+ description: 'The requested service could not be found.',
+ }
+ }
+
+ // Special SEO metadata for data recovery
+ if (slug === 'data-recovery-transfer') {
+ return {
+ title: 'Data Recovery & Transfer Services Zurich | RevampIT',
+ description: 'Professional data recovery and transfer services in Zurich. Recover data from old computers, transfer files between devices, access legacy media (floppy disks, ZIP drives, MO drives). Base fee CHF 30.',
+ keywords: [
+ 'data recovery zurich',
+ 'data transfer service',
+ 'floppy disk data recovery',
+ 'ZIP drive data recovery',
+ 'legacy data recovery',
+ 'old computer data recovery',
+ 'data migration service',
+ 'file transfer service',
+ 'MO drive data recovery',
+ 'SCSI IDE data recovery'
+ ],
+ openGraph: {
+ title: 'Data Recovery & Transfer Services Zurich | RevampIT',
+ description: 'Professional data recovery and transfer services in Zurich. Recover data from old computers, transfer files between devices, access legacy media.',
+ type: 'website',
+ url: 'https://revampit.org/services/data-recovery-transfer',
+ },
+ }
+ }
+
+ return {
+ title: `${service.name} | RevampIT`,
+ description: service.description,
+ openGraph: {
+ title: `${service.name} | RevampIT`,
+ description: service.description,
+ type: 'website',
+ },
+ }
+}
+
+export default async function ServicePage({ params }: { params: Promise<{ service: string }> }) {
+ const { service: slug } = await params
+ const service = await getService(slug)
+
+ if (!service) {
+ notFound()
+ }
+
+ const isComingSoon = !service.isActive
+
+ return (
+ <>
+ {slug === 'data-recovery-transfer' && (
+
+ )}
+
+ {/* Coming Soon Banner */}
+ {isComingSoon && (
+
+
+
+
+ Dieser Service kommt bald. Kontaktieren Sie uns, um Ihr Interesse zu bekunden und benachrichtigt zu werden, wenn er verfügbar ist.
+
+
+
+ )}
+
+ {/* Hero Section */}
+
+
+ {/* Features Section */}
+
+
+ {/* Pricing Section */}
+
+
+ {/* Process Section */}
+ {service.process && }
+
+ {/* CTA Section */}
+
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/app/services/open-source-solutions/components/BenefitsSection.tsx b/src/app/services/open-source-solutions/components/BenefitsSection.tsx
new file mode 100644
index 000000000..d34a162d5
--- /dev/null
+++ b/src/app/services/open-source-solutions/components/BenefitsSection.tsx
@@ -0,0 +1,55 @@
+/**
+ * BenefitsSection Component
+ *
+ * Reusable section for displaying benefits
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Created reusable benefits section component
+ */
+
+import { Benefit } from '../data'
+import { getTextColor } from '@/lib/design-system'
+import { cn } from '@/lib/utils'
+
+interface BenefitsSectionProps {
+ benefits: Benefit[]
+}
+
+export function BenefitsSection({ benefits }: BenefitsSectionProps) {
+ return (
+
+
+
+
+ Warum Open Source wählen?
+
+
+ Open-Source-Software bietet einen überlegenen Wert, Sicherheit und Flexibilität im Vergleich zu proprietären Alternativen.
+
+
+
+ {benefits.map((benefit, index) => {
+ const Icon = benefit.icon
+ return (
+
+
+
+
+ {benefit.title}
+
+
+
+ {benefit.description}
+
+
+ )
+ })}
+
+
+
+ )
+}
+
+
+
diff --git a/src/app/services/open-source-solutions/components/CTASection.tsx b/src/app/services/open-source-solutions/components/CTASection.tsx
new file mode 100644
index 000000000..d8204b356
--- /dev/null
+++ b/src/app/services/open-source-solutions/components/CTASection.tsx
@@ -0,0 +1,67 @@
+/**
+ * CTASection Component
+ *
+ * Reusable CTA section for open-source solutions page
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Created reusable CTA section component
+ */
+
+import Link from 'next/link'
+import { getTextColor, getButtonVariant } from '@/lib/design-system'
+import { cn } from '@/lib/utils'
+
+export function CTASection() {
+ return (
+
+
+
Bereit für Open Source?
+
+ Schliessen Sie sich Tausenden von Einzelpersonen und Unternehmen an, die erfolgreich auf Open-Source-Lösungen umgestiegen sind.
+ Unser Expertenteam ist bereit, Ihnen beim Wechsel zu helfen.
+
+
+
+ Starten Sie noch heute
+
+
+ Alle Dienstleistungen entdecken
+
+
+
+
Warum RevampIT wählen?
+
+
+
Expertenberatung
+
Professionelle Unterstützung für Ihre Open-Source-Reise
+
+
+
Massgeschneiderte Lösungen
+
Zugeschnitten auf Ihre spezifischen Bedürfnisse und Anforderungen
+
+
+
Laufender Support
+
Kontinuierliche Unterstützung und Wartung
+
+
+
+
+
+ )
+}
+
+
+
diff --git a/src/app/services/open-source-solutions/components/ComparisonCard.tsx b/src/app/services/open-source-solutions/components/ComparisonCard.tsx
new file mode 100644
index 000000000..7e166007c
--- /dev/null
+++ b/src/app/services/open-source-solutions/components/ComparisonCard.tsx
@@ -0,0 +1,126 @@
+/**
+ * ComparisonCard Component
+ *
+ * Reusable component for displaying open-source vs proprietary comparisons
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Created reusable comparison card component
+ */
+
+import React from 'react'
+import { FileCheck, FileX, LucideIcon } from 'lucide-react'
+import { getTextColor } from '@/lib/design-system'
+import { cn } from '@/lib/utils'
+
+interface ComparisonItem {
+ name: string
+ icon: LucideIcon
+ cost: string
+ comparisons: string[]
+ examples?: string[]
+}
+
+interface ComparisonCardProps {
+ item: ComparisonItem
+ variant: 'openSource' | 'proprietary'
+}
+
+const ComparisonCardComponent: React.FC = ({ item, variant }) => {
+ const isOpenSource = variant === 'openSource'
+ const Icon = item.icon
+
+ return (
+
+
+
+
+
+
+
+ {item.name}
+
+
+ {isOpenSource ? 'Open Source' : 'Proprietär'} • {item.cost}
+
+
+
+
+ {item.examples && item.examples.length > 0 && (
+
+
+ Beliebte Beispiele:
+
+
+
+ )}
+
+
+ {item.examples && (
+
+ {isOpenSource ? 'Wichtige Vorteile:' : 'Wichtige Merkmale:'}
+
+ )}
+ {item.comparisons.map((comparison, i) => (
+
+
+ {isOpenSource ? (
+
+ ) : (
+
+ )}
+
+
+ {comparison}
+
+
+ ))}
+
+
+ )
+}
+
+// Memoize to prevent unnecessary re-renders when parent updates
+export const ComparisonCard = React.memo(ComparisonCardComponent)
diff --git a/src/app/services/open-source-solutions/components/ComparisonSection.tsx b/src/app/services/open-source-solutions/components/ComparisonSection.tsx
new file mode 100644
index 000000000..04fb42b3d
--- /dev/null
+++ b/src/app/services/open-source-solutions/components/ComparisonSection.tsx
@@ -0,0 +1,45 @@
+/**
+ * ComparisonSection Component
+ *
+ * Reusable section for displaying comparison groups
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Created reusable comparison section component
+ */
+
+import { Comparison } from '../data'
+import { ComparisonCard } from './ComparisonCard'
+import { getTextColor } from '@/lib/design-system'
+import { cn } from '@/lib/utils'
+
+interface ComparisonSectionProps {
+ title: string
+ comparisons: Comparison[]
+}
+
+export function ComparisonSection({ title, comparisons }: ComparisonSectionProps) {
+ return (
+
+
+ {title}
+
+
+ {comparisons.map((comparison, index) => (
+
+
+ {comparison.category}
+
+
+
+
+
+
+ ))}
+
+
+ )
+}
+
+
+
diff --git a/src/app/services/open-source-solutions/components/ServicesSection.tsx b/src/app/services/open-source-solutions/components/ServicesSection.tsx
new file mode 100644
index 000000000..9cc15747d
--- /dev/null
+++ b/src/app/services/open-source-solutions/components/ServicesSection.tsx
@@ -0,0 +1,54 @@
+/**
+ * ServicesSection Component
+ *
+ * Reusable section for displaying services/features
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Created reusable services section component
+ */
+
+import { Feature } from '../data'
+import { getTextColor } from '@/lib/design-system'
+import { cn } from '@/lib/utils'
+
+interface ServicesSectionProps {
+ features: Feature[]
+}
+
+export function ServicesSection({ features }: ServicesSectionProps) {
+ return (
+
+
+
+ Unsere Dienstleistungen
+
+
+ {features.map((feature, index) => {
+ const Icon = feature.icon
+ return (
+
+
+
+
+
+
+
+ {feature.title}
+
+
+ {feature.description}
+
+
+
+
+ )
+ })}
+
+
+
+ )
+}
+
+
+
diff --git a/src/app/services/open-source-solutions/data.ts b/src/app/services/open-source-solutions/data.ts
new file mode 100644
index 000000000..7f895ddae
--- /dev/null
+++ b/src/app/services/open-source-solutions/data.ts
@@ -0,0 +1,613 @@
+/**
+ * Open Source Solutions Page Data
+ *
+ * Centralized data for the open-source-solutions page
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted data constants from page component
+ */
+
+import {
+ Code,
+ Shield,
+ Users,
+ BookOpen,
+ Database,
+ Server,
+ Terminal,
+ Globe,
+ DollarSign,
+ FileSpreadsheet,
+ FileImage,
+ FileVideo,
+ FileCode,
+ FileCheck,
+ FileX,
+ FileText,
+ Chrome,
+ Image,
+ Video,
+ Cloud,
+ Paintbrush,
+ Film,
+ Coins,
+ Wallet,
+ Banknote,
+ Brain,
+ Network,
+ Monitor,
+ Box,
+ GitBranch,
+ MessageSquare,
+ Activity,
+ Share2,
+ LucideIcon
+} from 'lucide-react'
+
+export interface Benefit {
+ title: string
+ description: string
+ icon: LucideIcon
+}
+
+export interface PopularApp {
+ name: string
+ description: string
+ icon: LucideIcon
+ comparison: string
+}
+
+export interface Feature {
+ title: string
+ description: string
+ icon: LucideIcon
+}
+
+export interface ComparisonItem {
+ name: string
+ icon: LucideIcon
+ cost: string
+ comparisons: string[]
+ examples?: string[]
+}
+
+export interface Comparison {
+ category: string
+ openSource: ComparisonItem
+ proprietary: ComparisonItem
+}
+
+export const benefits: Benefit[] = [
+ {
+ title: 'Kosteneffektiv',
+ description: 'Keine Lizenzgebühren und niedrigere Gesamtbetriebskosten im Vergleich zu proprietären Lösungen.',
+ icon: DollarSign
+ },
+ {
+ title: 'Erhöhte Sicherheit',
+ description: 'Transparenter Code, der von jedermann überprüft werden kann, was zu einer schnelleren Erkennung und Behebung von Schwachstellen führt.',
+ icon: Shield
+ },
+ {
+ title: 'Freiheit & Flexibilität',
+ description: 'Kein Anbieter-Lock-in. Sie besitzen Ihre Daten und können die Software an Ihre Bedürfnisse anpassen.',
+ icon: Globe
+ },
+ {
+ title: 'Community-Unterstützung',
+ description: 'Zugang zu einer globalen Gemeinschaft von Entwicklern und Benutzern für Unterstützung und Innovation.',
+ icon: Users
+ }
+]
+
+export const popularApps: PopularApp[] = [
+ {
+ name: 'LibreOffice',
+ description: 'Professionelle Office-Suite, die mit Microsoft Office konkurriert, mit voller Kompatibilität und erweiterten Funktionen.',
+ icon: BookOpen,
+ comparison: 'Microsoft Office-Alternative'
+ },
+ {
+ name: 'Nextcloud',
+ description: 'Sichere Filesharing- und Kollaborationsplattform, die mit Dropbox und Google Drive konkurriert.',
+ icon: Server,
+ comparison: 'Dropbox/Google Drive-Alternative'
+ },
+ {
+ name: 'GIMP',
+ description: 'Professionelle Bildbearbeitungssoftware mit Funktionen, die Adobe Photoshop entsprechen.',
+ icon: Code,
+ comparison: 'Photoshop-Alternative'
+ },
+ {
+ name: 'PostgreSQL',
+ description: 'Datenbanksystem der Enterprise-Klasse, das in Leistung und Funktionen mit Oracle und SQL Server konkurriert.',
+ icon: Database,
+ comparison: 'Oracle/SQL Server-Alternative'
+ }
+]
+
+export const features: Feature[] = [
+ {
+ title: 'Open-Source-Beratung',
+ description: 'Strategische Anleitung zur Auswahl und Implementierung von Open-Source-Software für Ihre spezifischen Bedürfnisse.',
+ icon: Code
+ },
+ {
+ title: 'Kundenspezifische Entwicklung',
+ description: 'Massgeschneiderte Open-Source-Lösungen und -Anpassungen, um Ihre einzigartigen Anforderungen zu erfüllen.',
+ icon: Terminal
+ },
+ {
+ title: 'Community-Integration',
+ description: 'Hilft Ihnen, ein aktiver Teil der Open-Source-Community zu werden und deren Vorteile zu nutzen.',
+ icon: Users
+ },
+ {
+ title: 'Sicherheit & Compliance',
+ description: 'Stellen Sie sicher, dass Ihre Open-Source-Lösungen die Sicherheitsstandards und Compliance-Anforderungen erfüllen.',
+ icon: Shield
+ }
+]
+
+export const consumerComparisons: Comparison[] = [
+ {
+ category: 'Office-Paket',
+ openSource: {
+ name: 'LibreOffice',
+ icon: FileSpreadsheet,
+ cost: 'Kostenlos, keine Abonnements',
+ comparisons: [
+ 'Vollständiger Funktionsumfang, der Microsoft Office entspricht',
+ 'Export in jedes Dokumentenformat',
+ 'Keine erzwungenen Upgrades oder Telemetrie',
+ 'Community-gesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Vollständige Kontrolle über Ihre Dokumente'
+ ]
+ },
+ proprietary: {
+ name: 'Microsoft 365',
+ icon: FileText,
+ cost: 'Ab CHF 69/Jahr pro Benutzer',
+ comparisons: [
+ 'Vollständiger Funktionsumfang mit Cloud-Integration',
+ 'Native Unterstützung des Microsoft-Formats',
+ 'Regelmässige Updates und neue Funktionen',
+ 'Unternehmensgesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Abonnement für volle Funktionalität erforderlich'
+ ]
+ }
+ },
+ {
+ category: 'Betriebssystem',
+ openSource: {
+ name: 'Linux',
+ icon: Terminal,
+ cost: 'Kostenlos, keine Lizenzen',
+ comparisons: [
+ 'Vollständig anpassbar und überprüfbar',
+ 'Keine erzwungenen Updates oder Telemetrie',
+ 'Tausende von kostenlosen Anwendungen',
+ 'Community-gesteuerte Sicherheitsupdates',
+ 'Verfügbar in mehreren Distributionen',
+ 'Vollständige Kontrolle über Ihr System'
+ ]
+ },
+ proprietary: {
+ name: 'Windows/macOS',
+ icon: Monitor,
+ cost: 'Lizenzgebühren und Abonnements',
+ comparisons: [
+ 'Auf den meisten Geräten vorinstalliert',
+ 'Integrierte Telemetrie und Updates',
+ 'Offizielle App-Stores und Support',
+ 'Unternehmensgesteuerte Updates',
+ 'Begrenzte Anpassungsmöglichkeiten',
+ 'Regelmässige Lizenzerneuerungen erforderlich'
+ ]
+ }
+ },
+ {
+ category: 'Datei-Synchronisierung & -Freigabe',
+ openSource: {
+ name: 'Nextcloud',
+ icon: Cloud,
+ cost: 'Kostenlos, selbst gehostet',
+ comparisons: [
+ 'Vollständige Kontrolle über Ihre Daten',
+ 'Hunderte von integrierten Apps',
+ 'DSGVO- und datenschutzkonform',
+ 'Community-gesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Keine Speicherbegrenzungen oder Gebühren'
+ ]
+ },
+ proprietary: {
+ name: 'Dropbox/Google Drive',
+ icon: Cloud,
+ cost: 'Ab CHF 10/Monat',
+ comparisons: [
+ 'Einfach zu bedienen und einzurichten',
+ 'Integriert mit anderen Diensten',
+ 'Automatische Synchronisierung und Sicherung',
+ 'Unternehmensgesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Speicherbegrenzungen und Gebühren fallen an'
+ ]
+ }
+ },
+ {
+ category: 'Webbrowser',
+ openSource: {
+ name: 'Firefox/Brave',
+ icon: Globe,
+ cost: 'Kostenlos',
+ comparisons: [
+ 'Datenschutzorientiert ohne Tracking',
+ 'Funktioniert mit allen Webstandards',
+ 'Regelmässige Sicherheitsupdates',
+ 'Community-gesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Keine Datenerfassung'
+ ]
+ },
+ proprietary: {
+ name: 'Chrome/Edge',
+ icon: Chrome,
+ cost: 'Kostenlos mit Datenerfassung',
+ comparisons: [
+ 'Umfangreiche Datenerfassung und Tracking',
+ 'Funktioniert mit allen Webstandards',
+ 'Regelmässige Sicherheitsupdates',
+ 'Unternehmensgesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Datenerfassung erforderlich'
+ ]
+ }
+ },
+ {
+ category: 'Grafikbearbeitung',
+ openSource: {
+ name: 'GIMP/Inkscape',
+ icon: Paintbrush,
+ cost: 'Kostenlos',
+ comparisons: [
+ 'Professionelle Werkzeuge',
+ 'Funktioniert mit allen Bildformaten',
+ 'Regelmässige Sicherheitsupdates',
+ 'Community-gesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Keine Wasserzeichen oder Einschränkungen'
+ ]
+ },
+ proprietary: {
+ name: 'Adobe Photoshop/Illustrator',
+ icon: Image,
+ cost: 'CHF 24/Monat',
+ comparisons: [
+ 'Branchenübliche Werkzeuge',
+ 'Funktioniert mit allen Bildformaten',
+ 'Regelmässige Sicherheitsupdates',
+ 'Unternehmensgesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Abonnement erforderlich'
+ ]
+ }
+ },
+ {
+ category: '3D & Video',
+ openSource: {
+ name: 'Blender',
+ icon: Film,
+ cost: 'Kostenlos',
+ comparisons: [
+ '3D/VFX/Animation in Studioqualität',
+ 'Riesiges Plugin-Ökosystem',
+ 'Regelmässige Sicherheitsupdates',
+ 'Community-gesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Keine Wasserzeichen oder Einschränkungen'
+ ]
+ },
+ proprietary: {
+ name: 'Autodesk Maya/3ds Max',
+ icon: Video,
+ cost: 'Komplexe Lizenzgebühren',
+ comparisons: [
+ 'Branchenübliche Werkzeuge',
+ 'Funktioniert mit allen Formaten',
+ 'Regelmässige Sicherheitsupdates',
+ 'Unternehmensgesteuerte Entwicklung',
+ 'Verfügbar in mehreren Sprachen',
+ 'Lizenz und Support erforderlich'
+ ]
+ }
+ },
+ {
+ category: 'Soziale Medien',
+ openSource: {
+ name: 'Mastodon/Pixelfed',
+ icon: Users,
+ cost: 'Kostenlos, selbst gehostet oder einem Server beitreten',
+ comparisons: [
+ 'Dezentrales Netzwerk (Fediverse)',
+ 'Keine Algorithmus-Manipulation',
+ 'Keine Datenerfassung oder Werbung',
+ 'Community-gesteuerte Moderation',
+ 'Verfügbar in mehreren Sprachen',
+ 'Exportieren Sie Ihre Daten jederzeit'
+ ]
+ },
+ proprietary: {
+ name: 'X/Instagram',
+ icon: Share2,
+ cost: 'Kostenlos mit Werbung und Datenerfassung',
+ comparisons: [
+ 'Zentralisierte Plattformkontrolle',
+ 'Algorithmus-gesteuerter Inhalt',
+ 'Umfangreiche Datenerfassung',
+ 'Unternehmensmoderation',
+ 'Verfügbar in mehreren Sprachen',
+ 'Begrenzte Datenportabilität'
+ ]
+ }
+ }
+]
+
+export const businessComparisons: Comparison[] = [
+ {
+ category: 'Datenbank',
+ openSource: {
+ name: 'PostgreSQL/MariaDB',
+ icon: Database,
+ cost: 'Kostenlos, keine Platzgebühren',
+ comparisons: [
+ 'Leistung auf Unternehmensebene',
+ 'Unbegrenzte Erweiterungen und Plugins',
+ 'Starke ACID-Konformität',
+ 'Community-gesteuerte Sicherheit',
+ 'Verfügbar für alle Plattformen',
+ 'Vollständige Kontrolle über die Daten'
+ ]
+ },
+ proprietary: {
+ name: 'Oracle DB',
+ icon: Database,
+ cost: 'Komplexe Lizenzgebühren',
+ comparisons: [
+ 'Funktionen auf Unternehmensebene',
+ 'Offizieller Support und Schulungen',
+ 'Starke Sicherheitsfunktionen',
+ 'Unternehmensgesteuerte Updates',
+ 'Verfügbar für alle Plattformen',
+ 'Lizenz und Support erforderlich'
+ ]
+ }
+ },
+ {
+ category: 'Virtualisierung',
+ openSource: {
+ name: 'KVM/QEMU',
+ icon: Server,
+ cost: 'Kostenlos, keine Lizenzen',
+ comparisons: [
+ 'Vollständig offener Hypervisor',
+ 'Integriert sich in jede Toolchain',
+ 'Funktionen auf Unternehmensebene',
+ 'Community-gesteuerte Sicherheit',
+ 'Verfügbar für alle Plattformen',
+ 'Vollständige Kontrolle über VMs'
+ ]
+ },
+ proprietary: {
+ name: 'VMware vSphere',
+ icon: Server,
+ cost: 'Lizenzen pro CPU/Sockel',
+ comparisons: [
+ 'Funktionen auf Unternehmensebene',
+ 'Offizieller Support und Schulungen',
+ 'Starke Sicherheitsfunktionen',
+ 'Unternehmensgesteuerte Updates',
+ 'Verfügbar für alle Plattformen',
+ 'Lizenz und Support erforderlich'
+ ]
+ }
+ },
+ {
+ category: 'Container-Plattform',
+ openSource: {
+ name: 'Kubernetes',
+ icon: Box,
+ cost: 'Kostenlos, kein Lock-in',
+ comparisons: [
+ 'Überall lauffähig, kein Cloud-Lock',
+ 'Nach Bedarf forken und anpassen',
+ 'Funktionen auf Unternehmensebene',
+ 'Community-gesteuerte Sicherheit',
+ 'Verfügbar für alle Plattformen',
+ 'Vollständige Kontrolle über Container'
+ ]
+ },
+ proprietary: {
+ name: 'AWS ECS/EKS',
+ icon: Cloud,
+ cost: 'Komplexes Preismodell',
+ comparisons: [
+ 'Verwalteter Dienst mit Support',
+ 'Integriert in das AWS-Ökosystem',
+ 'Funktionen auf Unternehmensebene',
+ 'Unternehmensgesteuerte Updates',
+ 'Verfügbar auf der AWS-Plattform',
+ 'Potenzial für Anbieter-Lock-in'
+ ]
+ }
+ },
+ {
+ category: 'CI/CD',
+ openSource: {
+ name: 'Jenkins/GitLab CI',
+ icon: GitBranch,
+ cost: 'Kostenlos, selbst gehostet',
+ comparisons: [
+ 'Unendliche Plugins und Erweiterungen',
+ 'Selbst-Hosting oder Cloud-Bereitstellung',
+ 'Funktionen auf Unternehmensebene',
+ 'Community-gesteuerte Sicherheit',
+ 'Verfügbar für alle Plattformen',
+ 'Vollständige Kontrolle über die Pipeline'
+ ]
+ },
+ proprietary: {
+ name: 'TeamCity/CircleCI',
+ icon: GitBranch,
+ cost: 'Gebühren pro Benutzer oder pro Build',
+ comparisons: [
+ 'Verwalteter Dienst mit Support',
+ 'Integriert mit anderen Tools',
+ 'Funktionen auf Unternehmensebene',
+ 'Unternehmensgesteuerte Updates',
+ 'Verfügbar für alle Plattformen',
+ 'Nutzungsabhängige Preise'
+ ]
+ }
+ },
+ {
+ category: 'Überwachung',
+ openSource: {
+ name: 'Prometheus + Grafana',
+ icon: Activity,
+ cost: 'Kostenlos, selbst gehostet',
+ comparisons: [
+ 'Pull-Modell-Metrikerfassung',
+ 'Flexible Abfragesprache',
+ 'Umfangreiches Plugin-Ökosystem',
+ 'Community-gesteuerte Sicherheit',
+ 'Verfügbar für alle Plattformen',
+ 'Vollständige Kontrolle über die Überwachung'
+ ]
+ },
+ proprietary: {
+ name: 'Datadog/New Relic',
+ icon: Activity,
+ cost: 'Gebühren pro Host/pro Metrik',
+ comparisons: [
+ 'Verwalteter Dienst mit Support',
+ 'Integriert mit anderen Tools',
+ 'Funktionen auf Unternehmensebene',
+ 'Unternehmensgesteuerte Updates',
+ 'Verfügbar für alle Plattformen',
+ 'Nutzungsabhängige Preise'
+ ]
+ }
+ },
+ {
+ category: 'Zusammenarbeit',
+ openSource: {
+ name: 'Mattermost/Rocket.Chat',
+ icon: MessageSquare,
+ cost: 'Kostenlos, selbst gehostet',
+ comparisons: [
+ 'Selbst gehostete Slack-Alternative',
+ 'Keine Datenerfassung',
+ 'Daten jederzeit exportieren',
+ 'Community-gesteuerte Sicherheit',
+ 'Verfügbar für alle Plattformen',
+ 'Vollständige Kontrolle über die Daten'
+ ]
+ },
+ proprietary: {
+ name: 'Slack/Teams',
+ icon: MessageSquare,
+ cost: 'Abonnement pro Benutzer',
+ comparisons: [
+ 'Einfach zu bedienen und einzurichten',
+ 'Integriert mit anderen Diensten',
+ 'Funktionen auf Unternehmensebene',
+ 'Unternehmensgesteuerte Updates',
+ 'Verfügbar für alle Plattformen',
+ 'Es gelten Datenaufbewahrungsrichtlinien'
+ ]
+ }
+ }
+]
+
+export const emergingTechComparisons: Comparison[] = [
+ {
+ category: 'Digitale Währung',
+ openSource: {
+ name: 'Bitcoin',
+ icon: Coins,
+ cost: 'Transparente Netzwerkgebühren',
+ comparisons: [
+ 'Open-Source-Protokoll mit öffentlichem Prüfpfad',
+ 'Vorhersehbares Angebot mit 21 Millionen Obergrenze',
+ 'Selbstverwahrung: volle Kontrolle über die Gelder',
+ 'Globales Netzwerk mit 24/7-Verfügbarkeit',
+ 'Genehmigungsfreie Transaktionen',
+ 'Keine zentrale Behörde'
+ ]
+ },
+ proprietary: {
+ name: 'Traditionelles Bankwesen',
+ icon: Banknote,
+ cost: 'Mehrere Gebühren und Entgelte',
+ comparisons: [
+ 'Zentralisierte Kontrolle und Regulierung',
+ 'Unbegrenztes Angebot durch Zentralbanken',
+ 'Verwahrung: Banken kontrollieren die Gelder',
+ 'Begrenzt durch Banköffnungszeiten',
+ 'Genehmigungspflichtige Transaktionen',
+ 'Zentrale Behörde erforderlich'
+ ]
+ }
+ },
+ {
+ category: 'Künstliche Intelligenz',
+ openSource: {
+ name: 'Open-Source-KI',
+ icon: Brain,
+ cost: 'Kostenlos nutzbar, Bezahlung für Rechenleistung',
+ examples: [
+ 'LLaMA 2 (Meta) - Leistungsstarkes Sprachmodell',
+ 'Stable Diffusion - Bilderzeugung',
+ 'Whisper - Spracherkennung',
+ 'BERT - Verarbeitung natürlicher Sprache',
+ 'TensorFlow/PyTorch - ML-Frameworks'
+ ],
+ comparisons: [
+ 'Vollständig überprüfbarer Code und Modelle',
+ 'Keine erzwungene Telemetrie oder Tracking',
+ 'Läuft auf jeder kompatiblen Hardware',
+ 'Community-gesteuerte Sicherheit',
+ 'Demokratisierte Entwicklung',
+ 'Vollständige Anpassung möglich'
+ ]
+ },
+ proprietary: {
+ name: 'Proprietäre KI',
+ icon: Network,
+ cost: 'Pay-per-Use oder Abonnement',
+ examples: [
+ 'ChatGPT (OpenAI)',
+ 'DALL-E (OpenAI)',
+ 'Claude (Anthropic)',
+ 'Midjourney',
+ 'Google Bard'
+ ],
+ comparisons: [
+ 'Closed-Source mit Einschränkungen',
+ 'Integriertes Nutzungs-Tracking',
+ 'Nur Cloud-Bereitstellung',
+ 'Unternehmensgesteuerte Updates',
+ 'Roadmap eines einzelnen Unternehmens',
+ 'Begrenzte Anpassungsmöglichkeiten'
+ ]
+ }
+ }
+]
+
+
+
diff --git a/src/app/services/open-source-solutions/page.tsx b/src/app/services/open-source-solutions/page.tsx
new file mode 100644
index 000000000..1e7ca2cca
--- /dev/null
+++ b/src/app/services/open-source-solutions/page.tsx
@@ -0,0 +1,77 @@
+import { Metadata } from 'next'
+import { ResponsiveHero } from '@/components/layout/ResponsiveHero'
+import { BenefitsSection } from './components/BenefitsSection'
+import { ServicesSection } from './components/ServicesSection'
+import { ComparisonSection } from './components/ComparisonSection'
+import { CTASection } from './components/CTASection'
+import { getTextColor } from '@/lib/design-system'
+import { cn } from '@/lib/utils'
+import {
+ benefits,
+ popularApps,
+ features,
+ consumerComparisons,
+ businessComparisons,
+ emergingTechComparisons
+} from './data'
+
+export const metadata: Metadata = {
+ title: 'Open-Source-Lösungen | RevampIT',
+ description: 'Professionelle Implementierung, Unterstützung und Schulung für Open-Source-Software für Unternehmen und Privatpersonen.',
+}
+
+export default function OpenSourceSolutionsPage() {
+ return (
+
+ {/* Hero Section */}
+
+
+ {/* Benefits Section */}
+
+
+ {/* Services Section */}
+
+
+ {/* CTA Section */}
+
+
+ {/* Verification Note */}
+
+
+
+ Alle bereitgestellten Informationen sind zum {new Date().toLocaleDateString('de-CH', { year: 'numeric', month: 'long' })} korrekt.
+ Wir aktualisieren unsere Inhalte regelmässig, um die neuesten Entwicklungen in der Open-Source-Software widerzuspiegeln.
+
+
+
+
+ {/* Comparison Section */}
+
+
+
+
+ Open-Source-Lösungen
+
+
+ Entdecken Sie leistungsstarke Open-Source-Alternativen zu teurer proprietärer Software.
+ Alle diese Lösungen sind kostenlos, werden regelmässig aktualisiert und von der Community vorangetrieben.
+
+
+
+ {/* Consumer Solutions */}
+
+
+ {/* Business Solutions */}
+
+
+ {/* Emerging Technologies */}
+
+
+
+
+ )
+}
diff --git a/src/components/admin/ProductManagement.tsx b/src/components/admin/ProductManagement.tsx
index 4607f1838..59289a980 100644
--- a/src/components/admin/ProductManagement.tsx
+++ b/src/components/admin/ProductManagement.tsx
@@ -13,7 +13,6 @@
import React from 'react'
import { Loader2, AlertTriangle } from 'lucide-react'
-import Heading from '@/components/admin/AdminHeading'
import {
ProductTabSwitcher,
ProductStatsCards,
@@ -45,11 +44,11 @@ export default function ProductManagement() {
-
+
Fehler beim Laden der Produkte
-
+
- {actions.error.message || 'Bitte versuche es später erneut.'}
+ {actions.error.message || 'Bitte versuchen Sie es später erneut.'}
actions.refetch()}
diff --git a/src/components/dashboard/OnboardingChecklist.tsx b/src/components/dashboard/OnboardingChecklist.tsx
new file mode 100644
index 000000000..d57e6ef3a
--- /dev/null
+++ b/src/components/dashboard/OnboardingChecklist.tsx
@@ -0,0 +1,70 @@
+'use client'
+
+import { cn } from '@/lib/utils'
+import { UserRole, ROLES } from '@/lib/constants'
+import { CheckCircle, Circle } from 'lucide-react'
+
+interface Step {
+ label: string
+ done: boolean
+ href?: string
+}
+
+interface OnboardingChecklistProps {
+ role: UserRole
+ emailVerified: boolean
+ className?: string
+}
+
+export function OnboardingChecklist({ role, emailVerified, className }: OnboardingChecklistProps) {
+ const steps: Step[] = [
+ { label: 'E-Mail-Adresse bestätigen', done: emailVerified, href: '/dashboard/profile' },
+ { label: 'Profil vervollständigen', done: false, href: '/dashboard/profile' },
+ ]
+
+ if (role === ROLES.SELLER) {
+ steps.push({ label: 'Seller-Profil eingerichtet', done: true })
+ steps.push({ label: 'Erstes Produkt inserieren', done: false, href: '/dashboard/seller' })
+ } else if (role === ROLES.REPAIRER) {
+ steps.push({ label: 'Techniker-Profil eingerichtet', done: true })
+ steps.push({ label: 'Erste Dienstleistung publizieren', done: false, href: '/dashboard/repairer' })
+ }
+
+ const allDone = steps.every((s) => s.done)
+ if (allDone) return null
+
+ const remaining = steps.filter((s) => !s.done).length
+
+ return (
+
+
+
+ Erste Schritte
+
+
+ {steps.length - remaining}/{steps.length} erledigt
+
+
+
+ {steps.map((step) => (
+
+ {step.done ? (
+
+ ) : (
+
+ )}
+ {step.href && !step.done ? (
+
+ {step.label}
+
+ ) : (
+
+ {step.label}
+
+ )}
+
+ ))}
+
+
+ )
+}
diff --git a/src/components/layout/MainLayout.tsx b/src/components/layout/MainLayout.tsx
index c647f9726..4287cafbb 100644
--- a/src/components/layout/MainLayout.tsx
+++ b/src/components/layout/MainLayout.tsx
@@ -15,7 +15,7 @@ export default function MainLayout({ children }: MainLayoutProps) {
-
+
{children}
diff --git a/src/components/layout/ResponsiveHero.tsx b/src/components/layout/ResponsiveHero.tsx
index c55afcbc5..8e45c9acc 100644
--- a/src/components/layout/ResponsiveHero.tsx
+++ b/src/components/layout/ResponsiveHero.tsx
@@ -13,8 +13,7 @@ import { ReactNode } from 'react'
import { responsiveSpacing, responsiveTypography, responsiveButtons } from '@/lib/responsive'
import { cn } from '@/lib/utils'
import { getTextColor, getBackgroundColor, getButtonVariant } from '@/lib/design-system'
-import { Link } from '@/i18n/navigation'
-import Heading from '@/components/ui/Heading'
+import Link from 'next/link'
export interface ResponsiveHeroProps {
title: string
@@ -105,15 +104,15 @@ export function ResponsiveHero({
-
+
{title}
-
+
{subtitle && (
-
{subtitle}
-
+
)}
{description && (
diff --git a/src/components/marketplace/constants.ts b/src/components/marketplace/constants.ts
new file mode 100644
index 000000000..770902d6b
--- /dev/null
+++ b/src/components/marketplace/constants.ts
@@ -0,0 +1,36 @@
+/**
+ * Product Listing Constants
+ *
+ * Constants for product listing form.
+ * Conditions derived from SSOT: @/config/erfassung/conditions
+ * Categories derived from SSOT: @/config/erfassung/categories
+ */
+
+import { ZUSTAND_OPTIONS } from '@/config/erfassung/conditions'
+import { KATEGORIEN } from '@/config/erfassung/categories'
+import type { ProductCondition, ProductCategory } from './types'
+
+/**
+ * Product categories for marketplace listings.
+ * Derived from KATEGORIEN SSOT (main categories only).
+ */
+export const PRODUCT_CATEGORIES: ProductCategory[] = KATEGORIEN.map(k => ({
+ value: k.label,
+ label: k.label,
+}))
+
+/**
+ * Conditions available for seller product listings.
+ * Subset of ZUSTAND_OPTIONS — excludes 'poor' and 'defect' (not suitable for sale).
+ */
+const SELLER_CONDITION_VALUES = ['new', 'like_new', 'good', 'fair'] as const
+
+export const PRODUCT_CONDITIONS: ProductCondition[] = SELLER_CONDITION_VALUES.map(value => {
+ const condition = ZUSTAND_OPTIONS.find(c => c.value === value)!
+ return {
+ value: condition.value,
+ label: condition.label,
+ description: condition.description,
+ }
+})
+
diff --git a/src/components/marketplace/hooks/useAISearch.ts b/src/components/marketplace/hooks/useAISearch.ts
new file mode 100644
index 000000000..9c87ff2c4
--- /dev/null
+++ b/src/components/marketplace/hooks/useAISearch.ts
@@ -0,0 +1,50 @@
+'use client'
+
+import { useState, useCallback } from 'react'
+
+interface SearchResult {
+ id: string
+ name: string
+ brand: string
+ category: string
+ estimatedPrice: number
+ confidence: number
+ features: string[]
+ condition: string
+}
+
+interface UseAISearchReturn {
+ searchQuery: string
+ setSearchQuery: (query: string) => void
+ isSearching: boolean
+ searchResults: SearchResult[]
+ search: () => Promise
+ clearResults: () => void
+}
+
+export function useAISearch(): UseAISearchReturn {
+ const [searchQuery, setSearchQuery] = useState('')
+ const [isSearching, setIsSearching] = useState(false)
+ const [searchResults, setSearchResults] = useState([])
+
+ const search = useCallback(async () => {
+ if (!searchQuery.trim()) return
+ setIsSearching(true)
+ try {
+ const res = await fetch(`/api/ai/search-products?q=${encodeURIComponent(searchQuery)}`)
+ if (res.ok) {
+ const data = await res.json()
+ setSearchResults(data.results ?? [])
+ }
+ } finally {
+ setIsSearching(false)
+ }
+ }, [searchQuery])
+
+ const clearResults = useCallback(() => {
+ setSearchResults([])
+ setSearchQuery('')
+ }, [])
+
+ return { searchQuery, setSearchQuery, isSearching, searchResults, search, clearResults }
+}
diff --git a/src/components/marketplace/hooks/useProductForm.ts b/src/components/marketplace/hooks/useProductForm.ts
new file mode 100644
index 000000000..105a89ed4
--- /dev/null
+++ b/src/components/marketplace/hooks/useProductForm.ts
@@ -0,0 +1,98 @@
+/**
+ * useProductForm Hook
+ *
+ * Custom hook for product form state management
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted form state management from ProductListingForm
+ */
+
+import { useState } from 'react'
+import { ProductFormData, ProductListingErrors } from '../types'
+import { MARKETPLACE_LIMITS } from '@/config/marketplace'
+
+function validateProductForm(formData: ProductFormData): ProductListingErrors {
+ const errors: ProductListingErrors = {}
+ if (!formData.title.trim()) errors.title = 'Titel ist erforderlich'
+ if (!formData.description.trim()) errors.description = 'Beschreibung ist erforderlich'
+ if (!formData.price.trim()) errors.price = 'Preis ist erforderlich'
+ if (!formData.category) errors.category = 'Kategorie ist erforderlich'
+ if (!formData.condition) errors.condition = 'Zustand ist erforderlich'
+ if (!formData.location.trim()) errors.location = 'Standort ist erforderlich'
+ return errors
+}
+
+function isFormValid(errors: ProductListingErrors): boolean {
+ return Object.keys(errors).length === 0
+}
+
+const initialFormData: ProductFormData = {
+ title: '',
+ description: '',
+ price: '',
+ category: '',
+ brand: '',
+ condition: '',
+ images: [],
+ location: '',
+ contactInfo: '',
+}
+
+export function useProductForm() {
+ const [formData, setFormData] = useState(initialFormData)
+ const [errors, setErrors] = useState({})
+
+ const updateField = (field: keyof ProductFormData, value: string | File[]) => {
+ setFormData(prev => ({ ...prev, [field]: value }))
+ // Clear error for this field when user starts typing
+ if (errors[field as keyof ProductListingErrors]) {
+ setErrors(prev => {
+ const newErrors = { ...prev }
+ delete newErrors[field as keyof ProductListingErrors]
+ return newErrors
+ })
+ }
+ }
+
+ const addImages = (files: File[]) => {
+ if (formData.images.length + files.length > MARKETPLACE_LIMITS.MAX_IMAGES) {
+ throw new Error(`Maximal ${MARKETPLACE_LIMITS.MAX_IMAGES} Bilder erlaubt`)
+ }
+ setFormData(prev => ({
+ ...prev,
+ images: [...prev.images, ...files]
+ }))
+ }
+
+ const removeImage = (index: number) => {
+ setFormData(prev => ({
+ ...prev,
+ images: prev.images.filter((_, i) => i !== index)
+ }))
+ }
+
+ const validate = (): boolean => {
+ const validationErrors = validateProductForm(formData)
+ setErrors(validationErrors)
+ return isFormValid(validationErrors)
+ }
+
+ const reset = () => {
+ setFormData(initialFormData)
+ setErrors({})
+ }
+
+ return {
+ formData,
+ errors,
+ updateField,
+ addImages,
+ removeImage,
+ validate,
+ reset,
+ }
+}
+
+
+
diff --git a/src/components/marketplace/index.ts b/src/components/marketplace/index.ts
new file mode 100644
index 000000000..a3e4cdfc3
--- /dev/null
+++ b/src/components/marketplace/index.ts
@@ -0,0 +1,30 @@
+/**
+ * Marketplace Components Index
+ *
+ * Central export point for marketplace components
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Created index file for marketplace components
+ */
+
+// Form sections
+export { BasicInfoSection } from './sections/BasicInfoSection'
+export { ConditionSection } from './sections/ConditionSection'
+export { ImageUploadSection } from './sections/ImageUploadSection'
+export { ContactInfoSection } from './sections/ContactInfoSection'
+
+// Modals
+export { AISearchModal } from './modals/AISearchModal'
+// Hooks
+export { useProductForm } from './hooks/useProductForm'
+export { useAISearch } from './hooks/useAISearch'
+
+// Types
+export type { ProductFormData, ProductCondition, ProductCategory, ProductListingErrors } from './types'
+
+// Constants
+export { PRODUCT_CATEGORIES, PRODUCT_CONDITIONS } from './constants'
+
+
+
diff --git a/src/components/marketplace/modals/AISearchModal.tsx b/src/components/marketplace/modals/AISearchModal.tsx
new file mode 100644
index 000000000..aa20fd2c4
--- /dev/null
+++ b/src/components/marketplace/modals/AISearchModal.tsx
@@ -0,0 +1,274 @@
+/**
+ * AISearchModal Component
+ *
+ * Modal for AI-powered product search
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted from ProductListingForm
+ */
+
+'use client'
+
+import { motion, AnimatePresence } from 'framer-motion'
+import { Search, Package, CheckCircle, Loader2, X } from 'lucide-react'
+import { cn } from '@/lib/utils'
+import { getTextColor, getStatusColors } from '@/lib/design-system'
+
+interface SearchResult {
+ id: string
+ name: string
+ brand: string
+ category: string
+ estimatedPrice: number
+ confidence: number
+ features: string[]
+ condition: string
+}
+
+interface AISearchModalProps {
+ isOpen: boolean
+ onClose: () => void
+ searchQuery: string
+ onSearchQueryChange: (query: string) => void
+ onSearch: () => void
+ isSearching: boolean
+ searchResults: SearchResult[]
+ onSelectResult: (result: SearchResult) => void
+}
+
+export function AISearchModal({
+ isOpen,
+ onClose,
+ searchQuery,
+ onSearchQueryChange,
+ onSearch,
+ isSearching,
+ searchResults,
+ onSelectResult,
+}: AISearchModalProps) {
+ const searchExamples = [
+ 'iPhone 13 Pro Max',
+ 'MacBook Air M1',
+ 'Dell Latitude E7470',
+ 'Samsung Galaxy S21',
+ 'Artikel-Nr. 12345'
+ ]
+
+ return (
+
+ {isOpen && (
+
+ e.stopPropagation()}
+ >
+ {/* Header */}
+
+
+
+
+
+
+
+
+ AI Schnellsuche
+
+
+ Geben Sie einen Produktnamen oder Artikelnummer ein
+
+
+
+
+
+
+
+
+
+ {/* Content */}
+
+ {/* Search Input */}
+
+
+
+
+ onSearchQueryChange(e.target.value)}
+ onKeyPress={(e) => e.key === 'Enter' && onSearch()}
+ placeholder="z.B. iPhone 13 Pro Max, Dell XPS 13, Artikel-Nr. 12345..."
+ className="w-full pl-10 pr-4 py-3 border-2 border-neutral-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-info-500 focus:border-info-500 text-base"
+ />
+
+
+ {isSearching ? (
+
+ ) : (
+
+ )}
+ Suchen
+
+
+
+ {/* Search Examples */}
+
+
+ Beispiele:
+
+
+ {searchExamples.map((example) => (
+ onSearchQueryChange(example)}
+ className="px-3 py-1 bg-info-100 text-info-700 rounded-full text-xs hover:bg-info-200 transition-colors min-h-[touch] touch-target"
+ >
+ {example}
+
+ ))}
+
+
+
+
+ {/* Search Results */}
+ {searchResults.length > 0 && (
+
+
+ {searchResults.length} Produkt{searchResults.length !== 1 ? 'e' : ''} gefunden
+
+
+
+ {searchResults.map((result) => {
+ const confidenceColors =
+ result.confidence > 0.8 ? getStatusColors('success') :
+ result.confidence > 0.6 ? getStatusColors('warning') :
+ getStatusColors('error')
+
+ return (
+
onSelectResult(result)}
+ className="p-4 border-2 border-neutral-200 rounded-lg hover:border-info-300 hover:bg-info-50 cursor-pointer transition-colors"
+ >
+
+
+
+
+
+ {result.name}
+
+
+ {Math.round(result.confidence * 100)}% Übereinstimmung
+
+
+
+ {result.brand} • {result.category} • CHF {result.estimatedPrice}
+
+
+ {result.features.slice(0, 3).map((feature, index) => (
+
+ {feature}
+
+ ))}
+
+
+
+
+
+ )
+ })}
+
+
+ {/* Actions */}
+
+ {
+ onSearchQueryChange('')
+ // Clear results handled by parent
+ }}
+ className="flex-1 px-4 py-2 border-2 border-neutral-300 text-neutral-700 rounded-lg hover:bg-neutral-50 transition-colors min-h-[touch] touch-target"
+ >
+ Neue Suche
+
+
+ Manueller Eintrag
+
+
+
+ )}
+
+ {/* Loading State */}
+ {isSearching && (
+
+
+
+ Produkt wird gesucht...
+
+
+ Durchsuche Produktdatenbank nach passenden Artikeln
+
+
+ )}
+
+ {/* No Results State */}
+ {!isSearching && searchResults.length === 0 && searchQuery && (
+
+
+
+ Keine Produkte gefunden
+
+
+ Für "{searchQuery}" wurden keine passenden Produkte gefunden.
+
+
+ onSearchQueryChange('')}
+ className="px-4 py-2 bg-info-600 text-white rounded-lg hover:bg-info-700 transition-colors min-h-[touch] touch-target"
+ >
+ Neue Suche
+
+
+ Manueller Eintrag
+
+
+
+ )}
+
+
+
+ )}
+
+ )
+}
+
+
+
diff --git a/src/components/marketplace/sections/BasicInfoSection.tsx b/src/components/marketplace/sections/BasicInfoSection.tsx
new file mode 100644
index 000000000..e1ace190c
--- /dev/null
+++ b/src/components/marketplace/sections/BasicInfoSection.tsx
@@ -0,0 +1,169 @@
+/**
+ * BasicInfoSection Component
+ *
+ * Form section for basic product information
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted from ProductListingForm
+ */
+
+import { DollarSign } from 'lucide-react'
+import { ProductFormData, ProductListingErrors } from '../types'
+import { PRODUCT_CATEGORIES } from '../constants'
+import { cn } from '@/lib/utils'
+import { getTextColor } from '@/lib/design-system'
+
+interface BasicInfoSectionProps {
+ formData: ProductFormData
+ errors: ProductListingErrors
+ onFieldChange: (field: keyof ProductFormData, value: string) => void
+}
+
+export function BasicInfoSection({ formData, errors, onFieldChange }: BasicInfoSectionProps) {
+ return (
+
+
+ Grundinformationen
+
+
+
+
+
+ Produkt-Titel *
+
+
onFieldChange('title', e.target.value)}
+ aria-required="true"
+ aria-invalid={!!errors.title}
+ aria-describedby={errors.title ? 'title-error' : undefined}
+ className={cn(
+ "w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
+ errors.title ? "border-error-300" : "border-neutral-300"
+ )}
+ placeholder="z.B. Dell Latitude E7470 Laptop"
+ />
+ {errors.title && (
+
{errors.title}
+ )}
+
+
+
+
+ Preis (CHF) *
+
+
+
+ onFieldChange('price', e.target.value)}
+ aria-required="true"
+ aria-invalid={!!errors.price}
+ aria-describedby={errors.price ? 'price-error' : undefined}
+ className={cn(
+ "w-full pl-10 pr-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
+ errors.price ? "border-error-300" : "border-neutral-300"
+ )}
+ placeholder="599.00"
+ />
+
+ {errors.price && (
+
{errors.price}
+ )}
+
+
+
+
+
+
+
+
+ Kategorie *
+
+
onFieldChange('category', e.target.value)}
+ aria-required="true"
+ aria-invalid={!!errors.category}
+ aria-describedby={errors.category ? 'category-error' : undefined}
+ className={cn(
+ "w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
+ errors.category ? "border-error-300" : "border-neutral-300"
+ )}
+ >
+ Kategorie wählen
+ {PRODUCT_CATEGORIES.map(category => (
+ {category.label}
+ ))}
+
+ {errors.category && (
+
{errors.category}
+ )}
+
+
+
+
+ Marke
+
+ onFieldChange('brand', e.target.value)}
+ className="w-full px-3 py-2 border border-neutral-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
+ placeholder="z.B. Dell, Apple, Lenovo"
+ />
+
+
+
+
+ Standort *
+
+
onFieldChange('location', e.target.value)}
+ aria-required="true"
+ aria-invalid={!!errors.location}
+ aria-describedby={errors.location ? 'location-error' : undefined}
+ className={cn(
+ "w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
+ errors.location ? "border-error-300" : "border-neutral-300"
+ )}
+ placeholder="z.B. Zürich, Bern, Basel"
+ />
+ {errors.location && (
+
{errors.location}
+ )}
+
+
+
+ )
+}
+
+
+
diff --git a/src/components/marketplace/sections/ConditionSection.tsx b/src/components/marketplace/sections/ConditionSection.tsx
new file mode 100644
index 000000000..191c0943b
--- /dev/null
+++ b/src/components/marketplace/sections/ConditionSection.tsx
@@ -0,0 +1,75 @@
+/**
+ * ConditionSection Component
+ *
+ * Form section for product condition selection
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted from ProductListingForm
+ */
+
+import { CheckCircle } from 'lucide-react'
+import { ProductFormData, ProductListingErrors } from '../types'
+import { PRODUCT_CONDITIONS } from '../constants'
+import { cn } from '@/lib/utils'
+import { getTextColor, getStatusColors } from '@/lib/design-system'
+
+interface ConditionSectionProps {
+ formData: ProductFormData
+ errors: ProductListingErrors
+ onConditionChange: (value: string) => void
+}
+
+export function ConditionSection({ formData, errors, onConditionChange }: ConditionSectionProps) {
+ return (
+
+
+ Zustand *
+
+
+ {PRODUCT_CONDITIONS.map((condition) => {
+ const isSelected = formData.condition === condition.value
+ const selectedColors = getStatusColors('info')
+
+ return (
+
+ onConditionChange(e.target.value)}
+ className="sr-only"
+ />
+
+
+ {condition.label}
+
+
+ {condition.description}
+
+
+ {isSelected && (
+
+ )}
+
+ )
+ })}
+
+ {errors.condition && (
+
{errors.condition}
+ )}
+
+ )
+}
+
+
+
diff --git a/src/components/marketplace/sections/ContactInfoSection.tsx b/src/components/marketplace/sections/ContactInfoSection.tsx
new file mode 100644
index 000000000..dcdf25f9b
--- /dev/null
+++ b/src/components/marketplace/sections/ContactInfoSection.tsx
@@ -0,0 +1,43 @@
+/**
+ * ContactInfoSection Component
+ *
+ * Form section for contact information
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted from ProductListingForm
+ */
+
+import { ProductFormData } from '../types'
+import { cn } from '@/lib/utils'
+import { getTextColor } from '@/lib/design-system'
+
+interface ContactInfoSectionProps {
+ contactInfo: string
+ onContactInfoChange: (value: string) => void
+}
+
+export function ContactInfoSection({ contactInfo, onContactInfoChange }: ContactInfoSectionProps) {
+ return (
+
+
+ Kontaktinformationen
+
+
+
+ Zusätzliche Kontaktinformationen (optional)
+
+
+
+ )
+}
+
+
+
diff --git a/src/components/marketplace/sections/ImageUploadSection.tsx b/src/components/marketplace/sections/ImageUploadSection.tsx
new file mode 100644
index 000000000..5e3f3d6bb
--- /dev/null
+++ b/src/components/marketplace/sections/ImageUploadSection.tsx
@@ -0,0 +1,83 @@
+/**
+ * ImageUploadSection Component
+ *
+ * Form section for product image upload and management
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted from ProductListingForm
+ */
+
+import { Image as ImageIcon, X } from 'lucide-react'
+import { MARKETPLACE_LIMITS } from '@/config/marketplace'
+import { cn } from '@/lib/utils'
+import { getTextColor } from '@/lib/design-system'
+
+interface ImageUploadSectionProps {
+ images: File[]
+ onImageUpload: (e: React.ChangeEvent) => void
+ onImageRemove: (index: number) => void
+}
+
+export function ImageUploadSection({ images, onImageUpload, onImageRemove }: ImageUploadSectionProps) {
+ return (
+
+
+ Produkt-Bilder
+
+
+ Fügen Sie bis zu {MARKETPLACE_LIMITS.MAX_IMAGES} klare Bilder Ihres Produkts hinzu
+
+
+
+ {/* Existing images */}
+ {images.map((image, index) => (
+
+
+
onImageRemove(index)}
+ className="absolute -top-2 -right-2 w-6 h-6 bg-error-500 text-white rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity min-h-[touch] touch-target"
+ aria-label="Bild entfernen"
+ >
+
+
+
+ ))}
+
+ {/* Upload button */}
+ {images.length < MARKETPLACE_LIMITS.MAX_IMAGES && (
+
+
+
+
+ Bild hinzufügen
+
+
+
+
+ )}
+
+
+ {images.length >= MARKETPLACE_LIMITS.MAX_IMAGES && (
+
+ Maximum {MARKETPLACE_LIMITS.MAX_IMAGES} Bilder erreicht
+
+ )}
+
+ )
+}
+
+
+
diff --git a/src/components/marketplace/types.ts b/src/components/marketplace/types.ts
new file mode 100644
index 000000000..c14f1b988
--- /dev/null
+++ b/src/components/marketplace/types.ts
@@ -0,0 +1,53 @@
+/**
+ * Product Listing Types
+ *
+ * Type definitions for product listing form
+ *
+ * Created: 2025-12-17
+ * Last Modified: 2025-12-17
+ * Last Modified Summary: Extracted types from ProductListingForm
+ */
+
+export interface ProductFormData {
+ title: string
+ description: string
+ price: string
+ category: string
+ brand: string
+ condition: string
+ images: File[]
+ location: string
+ contactInfo: string
+}
+
+export interface ProductCondition {
+ value: string
+ label: string
+ description: string
+}
+
+export interface ProductCategory {
+ value: string
+ label: string
+}
+
+export interface ProductListingErrors {
+ title?: string
+ description?: string
+ price?: string
+ category?: string
+ condition?: string
+ location?: string
+}
+
+export interface ListedProduct {
+ id: string
+ title: string
+ price: string
+ brand?: string
+ condition?: string
+ images?: string[]
+ createdAt: string
+ views?: number
+}
+
diff --git a/src/components/projects/ProjectCallToAction.tsx b/src/components/projects/ProjectCallToAction.tsx
index b2fd9d4dd..dede1ce76 100644
--- a/src/components/projects/ProjectCallToAction.tsx
+++ b/src/components/projects/ProjectCallToAction.tsx
@@ -5,8 +5,7 @@
*/
import { Button } from '@/components/ui/button'
-import Heading from '@/components/ui/Heading'
-import { Link } from '@/i18n/navigation'
+import Link from 'next/link'
import { ProjectCard } from './types'
import { getTextColor, getBackgroundColor, getButtonVariant } from '@/lib/design-system'
import { cn } from '@/lib/utils'
@@ -42,9 +41,9 @@ export function ProjectCallToAction({
-
+
{title}
-
+
{subtitle && (
{subtitle}
@@ -59,9 +58,9 @@ export function ProjectCallToAction({
backgroundColor === 'gray' ? 'bg-white' : 'bg-white/10'
}`}
>
-
+
{action.title}
-
+
{action.description}
diff --git a/src/components/projects/ProjectHero.tsx b/src/components/projects/ProjectHero.tsx
index fde8fe19f..55ed54bd0 100644
--- a/src/components/projects/ProjectHero.tsx
+++ b/src/components/projects/ProjectHero.tsx
@@ -6,8 +6,7 @@
*/
import { ProjectHero as ProjectHeroType } from './types'
-import Heading from '@/components/ui/Heading'
-import { Link } from '@/i18n/navigation'
+import Link from 'next/link'
import { cn } from '@/lib/utils'
import { getTextColor, getButtonVariant } from '@/lib/design-system'
@@ -35,7 +34,7 @@ export function ProjectHero({ hero }: ProjectHeroProps) {
-
{title}
+
{title}
{description}
diff --git a/src/components/projects/ProjectSection.tsx b/src/components/projects/ProjectSection.tsx
index 5f11d46a1..e099d38c0 100644
--- a/src/components/projects/ProjectSection.tsx
+++ b/src/components/projects/ProjectSection.tsx
@@ -5,7 +5,6 @@
*/
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
-import Heading from '@/components/ui/Heading'
import { ProjectSection as ProjectSectionType } from './types'
import { CheckCircle } from 'lucide-react'
import { getTextColor, getBackgroundColor } from '@/lib/design-system'
@@ -39,9 +38,9 @@ export function ProjectSection({ section }: ProjectSectionProps) {
{(section.title || section.description) && (
{section.title && (
-
+
{section.title}
-
+
)}
{section.description && (
@@ -76,16 +75,17 @@ export function ProjectSection({ section }: ProjectSectionProps) {
) : typeof card.icon === 'function' ? (
- {(() => { const Icon = card.icon as React.ComponentType<{ className?: string }>; return })()}
+ {/* @ts-ignore - Component type handling */}
+
) : (
{card.icon}
)}
-
+
{card.title}
-
+
)}
diff --git a/src/components/services/AppointmentBookingForm.tsx b/src/components/services/AppointmentBookingForm.tsx
index 324f5ce20..59f6ca2e5 100644
--- a/src/components/services/AppointmentBookingForm.tsx
+++ b/src/components/services/AppointmentBookingForm.tsx
@@ -4,12 +4,7 @@ import { useState } from 'react'
import { useSession } from 'next-auth/react'
import { useRouter } from 'next/navigation'
import { Calendar, Clock, AlertCircle, CheckCircle, Loader2, Wrench } from 'lucide-react'
-import { Link } from '@/i18n/navigation'
-import { useTranslations } from 'next-intl'
-import { apiFetch } from '@/lib/api/client'
-import { Modal } from '@/components/ui/Modal'
-import Heading from '@/components/ui/Heading'
-import { URGENCY } from '@/config/it-hilfe'
+import Link from 'next/link'
interface AppointmentBookingFormProps {
serviceSlug: string
@@ -18,13 +13,12 @@ interface AppointmentBookingFormProps {
}
export default function AppointmentBookingForm({ serviceSlug, serviceTitle, pricing }: AppointmentBookingFormProps) {
- const t = useTranslations('services.appointment')
const { data: session } = useSession()
const router = useRouter()
const [isOpen, setIsOpen] = useState(false)
- const [formData, setFormData] = useState<{ description: string; urgency: string; preferredDate: string; preferredTime: string }>({
+ const [formData, setFormData] = useState({
description: '',
- urgency: URGENCY.NORMAL,
+ urgency: 'normal' as 'normal' | 'high' | 'urgent',
preferredDate: '',
preferredTime: ''
})
@@ -45,27 +39,32 @@ export default function AppointmentBookingForm({ serviceSlug, serviceTitle, pric
setSubmitResult(null)
try {
- const { data: result, error: apiError } = await apiFetch<{ message?: string }>('/api/appointments', {
+ const response = await fetch('/api/appointments', {
method: 'POST',
- body: {
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
serviceSlug,
description: formData.description,
urgency: formData.urgency,
preferredDate: formData.preferredDate && formData.preferredTime
? `${formData.preferredDate}T${formData.preferredTime}`
: null
- },
+ })
})
- if (!apiError) {
+ const result = await response.json()
+
+ if (result.success) {
setSubmitResult({
success: true,
- message: result?.message || t('successFallback')
+ message: result.message || 'Termin erfolgreich gebucht!'
})
// Reset form
setFormData({
description: '',
- urgency: URGENCY.NORMAL,
+ urgency: 'normal',
preferredDate: '',
preferredTime: ''
})
@@ -79,13 +78,13 @@ export default function AppointmentBookingForm({ serviceSlug, serviceTitle, pric
} else {
setSubmitResult({
success: false,
- message: apiError,
+ message: result.error || 'Fehler beim Buchen des Termins'
})
}
} catch (error) {
setSubmitResult({
success: false,
- message: t('networkError')
+ message: 'Netzwerkfehler. Bitte versuchen Sie es erneut.'
})
} finally {
setIsSubmitting(false)
@@ -99,18 +98,33 @@ export default function AppointmentBookingForm({ serviceSlug, serviceTitle, pric
className="inline-block bg-primary-600 text-white px-4 sm:px-6 md:px-8 py-3 sm:py-4 rounded-lg font-semibold hover:bg-primary-700 transition-colors duration-300 text-base sm:text-lg mr-4 min-h-[touch] touch-target"
>
- {t('bookButton')}
+ Termin buchen
)
}
return (
-
setIsOpen(false)} title={t('modalTitle', { serviceTitle })}>
+
+
+
+
+
+ Termin für {serviceTitle} buchen
+
+ setIsOpen(false)}
+ className="text-neutral-500 hover:text-neutral-700 min-w-[touch] min-h-[touch] touch-target p-2 -mr-2"
+ aria-label="Schliessen"
+ >
+ ✕
+
+
+
{pricing && (
- {t('priceInfo', { pricing })}
+ Preis: {pricing}
)}
@@ -135,24 +149,24 @@ export default function AppointmentBookingForm({ serviceSlug, serviceTitle, pric
{!session?.user ? (
-
- {t('loginRequired')}
-
+
+ Anmeldung erforderlich
+
- {t('loginDescription')}
+ Bitte melden Sie sich an, um einen Termin zu buchen.
- {t('loginSignIn')}
+ Anmelden
- {t('loginRegister')}
+ Registrieren
@@ -160,14 +174,14 @@ export default function AppointmentBookingForm({ serviceSlug, serviceTitle, pric
)
}
diff --git a/src/components/services/ServiceCTA.tsx b/src/components/services/ServiceCTA.tsx
index fa5dc2c18..5358229c0 100644
--- a/src/components/services/ServiceCTA.tsx
+++ b/src/components/services/ServiceCTA.tsx
@@ -5,12 +5,8 @@
* Maintains consistent branding and CTAs.
*/
-'use client'
-
-import { Link } from '@/i18n/navigation'
-import { useTranslations } from 'next-intl'
+import Link from 'next/link'
import AppointmentBookingForm from './AppointmentBookingForm'
-import Heading from '@/components/ui/Heading'
interface ServiceCTAProps {
serviceTitle: string
@@ -19,13 +15,12 @@ interface ServiceCTAProps {
}
export default function ServiceCTA({ serviceTitle, serviceSlug, pricing }: ServiceCTAProps) {
- const t = useTranslations('components.serviceCta')
return (
-
{t('heading')}
+
Bereit loszulegen?
- {t('desc', { serviceTitle })}
+ Buchen Sie jetzt Ihren Termin für unsere {serviceTitle} Dienstleistungen.
{serviceSlug && (
@@ -39,16 +34,17 @@ export default function ServiceCTA({ serviceTitle, serviceSlug, pricing }: Servi
href="/contact"
className="inline-block bg-white text-primary-800 px-4 sm:px-6 md:px-8 py-3 sm:py-4 rounded-lg font-semibold hover:bg-primary-50 transition-colors duration-300 text-base sm:text-lg min-h-[44px] touch-target"
>
- {t('contact')}
+ Kontakt
- {t('backToServices')}
+ Zurück zu Services
)
}
+
diff --git a/src/components/services/ServiceFeatures.tsx b/src/components/services/ServiceFeatures.tsx
index 2e94bf8a3..6e5cdadd3 100644
--- a/src/components/services/ServiceFeatures.tsx
+++ b/src/components/services/ServiceFeatures.tsx
@@ -8,7 +8,6 @@
import type { ServiceFeature } from '@/lib/services'
import { getTextColor } from '@/lib/design-system'
import { cn } from '@/lib/utils'
-import Heading from '@/components/ui/Heading'
interface ServiceFeaturesProps {
features: ServiceFeature[]
@@ -26,7 +25,7 @@ export default function ServiceFeatures({ features }: ServiceFeaturesProps) {
-
{feature.title}
+
{feature.title}
{feature.description}
diff --git a/src/components/services/ServicePricing.tsx b/src/components/services/ServicePricing.tsx
index 1105c2357..48af2e6f7 100644
--- a/src/components/services/ServicePricing.tsx
+++ b/src/components/services/ServicePricing.tsx
@@ -9,21 +9,17 @@ import { CheckCircle2 } from 'lucide-react'
import type { ServicePricing } from '@/lib/services'
import { getTextColor } from '@/lib/design-system'
import { cn } from '@/lib/utils'
-import Heading from '@/components/ui/Heading'
-import { getTranslations } from 'next-intl/server'
interface ServicePricingProps {
pricing: ServicePricing
}
-export default async function ServicePricingSection({ pricing }: ServicePricingProps) {
- const t = await getTranslations('services')
-
+export default function ServicePricingSection({ pricing }: ServicePricingProps) {
return (
-
{t('pricingTitle')}
+
Preise
@@ -38,7 +34,7 @@ export default async function ServicePricingSection({ pricing }: ServicePricingP
{pricing.mediaPrices && pricing.mediaPrices.length > 0 && (
-
{t('mediaCostsTitle')}
+
Medienkosten
{pricing.mediaPrices.map((price, index) => (
diff --git a/src/components/services/ServiceProcess.tsx b/src/components/services/ServiceProcess.tsx
index 863a3d896..45dd54ce1 100644
--- a/src/components/services/ServiceProcess.tsx
+++ b/src/components/services/ServiceProcess.tsx
@@ -8,27 +8,23 @@
import type { ServiceProcess } from '@/lib/services'
import { getTextColor } from '@/lib/design-system'
import { cn } from '@/lib/utils'
-import Heading from '@/components/ui/Heading'
-import { getTranslations } from 'next-intl/server'
interface ServiceProcessProps {
process: ServiceProcess[]
}
-export default async function ServiceProcessSection({ process }: ServiceProcessProps) {
- const t = await getTranslations('services')
-
+export default function ServiceProcessSection({ process }: ServiceProcessProps) {
return (
-
{t('processTitle')}
+
Unser Prozess
{process.map((step, index) => (
{step.step}
-
{step.title}
+
{step.title}
{step.description}
))}
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 96b427006..44e50e2cf 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -22,15 +22,30 @@
* @see @/lib/permissions.ts
*/
export const ROLES = {
- // Staff role — used in auth fallback. Migrate to is_staff + staff_permissions.
+ // Organization Roles - DEPRECATED: Use is_staff + staff_permissions instead
+ REVAMPIT_SUPER_ADMIN: 'revampit_super_admin',
REVAMPIT_ADMIN: 'revampit_admin',
+ REVAMPIT_EDITOR: 'revampit_editor',
+ REVAMPIT_SUPPORT: 'revampit_support',
- // Community Roles — actively used for seller/repairer profiles
+ // Business Partner Roles - DEPRECATED
+ PARTNER_ADMIN: 'partner_admin',
+ PARTNER_STAFF: 'partner_staff',
+
+ // Hirn Dashboard Roles - DEPRECATED: Use staff_permissions instead
+ HIRN_ADMIN: 'hirn_admin',
+ HIRN_USER: 'hirn_user',
+
+ // Community Roles - STILL ACTIVE: Used for seller/repairer profiles
+ MODERATOR: 'moderator',
SELLER: 'seller',
REPAIRER: 'repairer',
+ TECHNICAL_EXPERT: 'technical_expert',
- // Default role for regular users
- CUSTOMER: 'customer',
+ // Customer Roles - DEPRECATED: Regular users don't need roles
+ PREMIUM_CUSTOMER: 'premium_customer',
+ VERIFIED_CUSTOMER: 'verified_customer',
+ CUSTOMER: 'customer'
} as const
export type UserRole = typeof ROLES[keyof typeof ROLES]