link,[object Object]
Skip to content

Admin Guide ​

Overview ​

Administrative tools for managing listings, users, transactions, and platform operations.

Admin Routes ​

Admin pages are under src/pages/admin/* and guarded in src/components/routing/AppRoutes.tsx:396-516 via AdminProtectedRoute.

  • /admin — Main dashboard (src/pages/admin/AdminDashboard.tsx)
  • /admin/listings — Listing moderation (AdminListings.tsx), and details /admin/listings/:id, /admin/listings/:id/details
  • /admin/users — User management (AdminUsers.tsx)
  • /admin/transactions — Transactions (AdminTransactions.tsx)
  • /admin/offers — Offers (AdminOffers.tsx)
  • /admin/reports — Reports (AdminReports.tsx)
  • /admin/analytics — Analytics (AdminAnalytics.tsx - refactorized with modular components)
  • /admin/blog, /admin/blog/:id — Blog manager (AdminBlog*.tsx)
  • /admin/pages — CMS pages (AdminPages.tsx)
  • /admin/profile-verifications — Seller/Profile verification (AdminSellerVerifications.tsx)
  • /admin/subscription-plans — Subscription plans (AdminSubscriptionPlans.tsx)
  • /admin/storage — Storage manager (AdminStorage.tsx)
  • /admin/sitemap — Sitemap tools (AdminSitemap.tsx)
  • /admin/settings — Platform settings (AdminSettings.tsx)
  • /admin/logs — Logs (AdminLogs.tsx)
  • /admin/message-history — System messages (AdminMessageHistory.tsx)
  • /admin/price-alerts — Price alerts overview (AdminPriceAlerts.tsx)
  • /admin/templates — Template management system (AdminTemplates.tsx)

Key Features ​

Listing Moderation ​

File: src/pages/admin/AdminListings.tsx

  • Review pending listings
  • Add field-specific comments
  • Approve/reject with feedback
  • Track moderation history

Important: Listing Approval Flow ​

When approving a listing, the system now automatically checks if the seller is verified:

For Verified Sellers:

  • Updates status to 'active'
  • Updates verification_status to 'approved'
  • Listing becomes visible to ALL users (public)

For Unverified Sellers:

  • Updates only status to 'active'
  • Keeps verification_status as 'pending'
  • Listing visible only to owner and admin

Why This Matters:

  • Public visibility requires BOTH status='active' AND verification_status='approved'
  • If seller is not verified, listing won't appear on /explore for regular users
  • Always verify seller first, then approve listing for full visibility

Listing Admin Review Checklist ​

  • Basic Information
    • title (RO/EN when provided)
    • category
    • website_url (valid URL)
    • screenshot_url (present)
    • images (≥ 1 image)
  • Overview
    • business_model (RO/EN when provided)
    • established_date
    • number_of_customers
  • Financial Data
    • monthly_revenue
    • monthly_profit
    • price
    • allow_negotiation (optional)
    • price_reasoning (optional)
    • revenue_metrics_screenshot (optional)
  • Traffic & Audience
    • monthly_traffic
    • target_audience (optional)
    • traffic_metrics_screenshot (optional)
  • Business Details
    • competitors (optional)
    • growth_opportunities (optional)
    • reason_for_selling
  • Resources & Technologies
    • technologies (optional)
    • included_assets (optional)
  • Additional Terms
    • terms_conditions (optional)
  • Evidence & Docs (Admin UI)
    • financial documents uploaded when requested (PDF/CSV/XLSX)

Notes:

  • Validate blur policy compliance for sensitive fields (see Blur Policy docs).
  • Ensure content matches i18n expectations (RO/EN variants if provided).

User Management ​

  • View all user profiles
  • Manage subscription levels
  • Handle verification requests
  • Suspend/activate accounts

Transaction Oversight ​

  • Monitor deal progress
  • Force status progression when needed
  • Handle dispute resolution
  • Process refunds and payouts
  • Enhanced Admin Actions:
    • Tooltips: All action buttons have descriptive tooltips explaining their purpose
    • Status-based Alerts: Dynamic alert messages based on transaction status
      • Completed: "This deal has been completed successfully..."
      • Payout Released: "Payout has been released to the seller..."
      • Ready: "All conditions are met. The deal is ready for final approval..."
    • Stripe Transfer Monitoring: Real-time transfer details display
      • Transfer ID, amount, status, processing time
      • Automatic status updates every 30 seconds
      • Processing time estimates and arrival dates
  • Visual Transaction Marking:
    • Completed transactions marked with green background and left border
    • Consistent styling across admin and user transaction views

Analytics Dashboard ​

File: src/pages/admin/AdminAnalytics.tsx (refactorized)

The analytics page has been refactorized into modular components for better maintainability:

Component Structure ​

  • AnalyticsHeader.tsx - Page title, subtitle, and period selection dropdown
  • AnalyticsStatsCards.tsx - Main statistics cards (revenue, users, listings, transactions)
  • AnalyticsCharts.tsx - All charts and graphs (user growth, views, transactions, conversion rate, category distribution)
  • AnalyticsTable.tsx - Detailed analytics data table
  • AnalyticsSkeleton.tsx - Loading skeleton component
  • ErrorState.tsx - Error display component

Custom Hook ​

  • useAnalytics.ts - Centralized data fetching and processing logic

Benefits of Refactorization ​

  • Maintainability: Each component has a single responsibility
  • Reusability: Components can be used in other parts of the application
  • Testability: Individual components can be tested independently
  • Readability: Code is much easier to understand and navigate
  • Performance: Components can be optimized individually
  • Debugging: Errors are easier to locate and fix

Analytics Features ​

  • Real-time platform metrics
  • User growth tracking
  • Listing performance analytics
  • Transaction volume and revenue
  • Category distribution analysis
  • Conversion rate monitoring
  • Customizable time periods (30/90/365 days)
  • Interactive charts with Recharts library

Template Management System ​

File: src/pages/admin/AdminTemplates.tsx

The template management system provides comprehensive control over all platform communications:

Template Categories ​

  1. Email Templates (/admin/templates → Email Templates tab)

    • Authentication emails (signup, login, password recovery)
    • Business emails (admin notifications, payment confirmations)
    • Marketing emails (sponsored notifications, price alerts)
    • Note: Deal-related emails (Escrow, DD, Offer, NDA, LOI, APA, Dispute, Payout, Finalize) are managed in the Timeline tab
  2. In-App Notifications (/admin/templates → In-App Notifications tab)

    • Real-time notifications from database (admin_notification_types table)
    • User verification requests, new listings, system messages
    • Configurable frequency and cron schedules
    • Features: Inline editing, multilingual support (EN/RO), fallback indicators
  3. Edge Functions (/admin/templates → Edge Functions tab)

    • Server-side email templates implemented in Supabase Edge Functions
    • Authentication flows, admin notifications, payment processing
    • Features: Inline editing, variable substitution, testing capabilities
  4. Database Templates (/admin/templates → Database tab)

    • Email templates stored in database
    • Features: Inline editing, multilingual support, variable management
  5. Timeline Events (/admin/templates → Timeline tab)

    • Deal lifecycle event notifications
    • Role-based toggles (Buyer/Seller/Admin)
    • Channel toggles (Email/App notifications)
    • Features: Multilingual messages, preview/test functionality, centralized configuration

Key Features ​

  • Inline Editing: All templates support inline editing below the table (no modals)
  • Multilingual Support: EN/RO content with fallback indicators
  • Role-Based Management: Timeline events support different messages per role
  • Testing & Preview: Built-in preview and test functionality
  • Consolidated Management: Single interface for all communication templates
  • Real-time Updates: Changes are applied immediately
  • Variable Substitution: Support for dynamic content insertion

Template Editor Features ​

  • Auto-focus: Automatically focuses and scrolls to editing section
  • Fallback Indicators: Shows when content is displayed from English fallback
  • Preview Mode: Real-time preview of template content
  • Test Functionality: Send test notifications/emails
  • Variable Support: Dynamic content insertion with {variableName} syntax

Timeline Event Management ​

  • Event Types: offer_sent, offer_accepted, nda_signed, loi_signed, apa_signed_buyer, apa_signed_seller, assets_delivered, dd_started, dd_completed, dispute_opened, payout_released, deal_completed
  • Role Configuration: Separate messages for Buyer, Seller, Admin roles
  • Channel Control: Toggle email and app notifications independently
  • Message Customization: Multilingual content with variable substitution
  • Centralized Storage: Configuration stored in app_settings.timeline_notifications

Notification Settings ​

  • Global Toggles: Admin notifications, User notifications, Email notifications
  • Per-Event Control: Individual toggles for each timeline event
  • Role-Based Delivery: Different notification preferences per user role
  • Frequency Management: Real-time, manual, or cron-scheduled notifications

Email Logs ​

  • Table: email_logs (see Data Model)
  • Admin UI: src/pages/admin/AdminLogs.tsx

Admin Functions ​

sql
-- Key admin RPC functions
get_admin_all_unresolved_comments()
admin_toggle_blurred_field(id, plan, enabled)
send_admin_comments_to_user(listing_id)

Blurred Fields Management ​

  • UI: Settings → Subscription Plans → Blurred Fields Manager
    • File: src/components/admin/subscription-plans/BlurredFieldsManager.tsx
    • Actions: list fields, toggle per plan (unauth/free/starter/pro), add field, presets, add missing fields
  • Table: public.blurred_fields (config per field_key)
  • Functions: public.can_view_field (enforcement), view public.listing_view_secure
  • Documentation: docs/architecture/blur-policy.md

Security ​

  • Admin role required (is_admin_user())
  • All actions logged for audit trail
  • Protected routes with AdminProtectedRoute

Standard Feedback Template (Admin → Seller) ​

Use this structure when rejecting or requesting changes on a listing. Copy/paste and fill the missing items.

Subject: Listing Review Feedback — Required Changes

Hello {{seller_name}},

Thank you for submitting your listing "{{listing_title}}". Before we can approve it, please address the following items:

Required
- [ ] Title: (if missing/incomplete)
- [ ] Category: (choose best match)
- [ ] Website URL: (valid, publicly accessible)
- [ ] Screenshot (general): (upload a representative screenshot)
- [ ] Images: (upload at least 1, recommended 3–5)
- [ ] Business Model: (be specific on monetization)
- [ ] Established Date: (YYYY-MM-DD)
- [ ] Number of Customers: (integer, average active)
- [ ] Monthly Revenue/Profit: (last 3 months average)
- [ ] Price: (numeric)
- [ ] Reason for Selling: (1–3 paragraphs)
- [ ] Monthly Traffic: (last 3 months average)

Optional (recommended for higher approval chance)
- [ ] Price Reasoning: (explain valuation)
- [ ] Traffic/Revenue Screenshots: (analytics/payments proof)
- [ ] Target Audience
- [ ] Competitors / Growth Opportunities
- [ ] Included Assets / Tech Stack
- [ ] Additional Terms & Conditions

If you have questions, reply to this email. Once updated, resubmit the listing for review.

Best regards,
Admin Team

Related: Security & Privacy

Last updated: