Files
Brancheneinstufung2/company-explorer/backend/interfaces.py
Floke 2c7bb262ef feat(company-explorer): Initial Web UI & Backend with Enrichment Flow
This commit introduces the foundational elements for the new "Company Explorer" web application, marking a significant step away from the legacy Google Sheets / CLI system.

Key changes include:
- Project Structure: A new  directory with separate  (FastAPI) and  (React/Vite) components.
- Data Persistence: Migration from Google Sheets to a local SQLite database () using SQLAlchemy.
- Core Utilities: Extraction and cleanup of essential helper functions (LLM wrappers, text utilities) into .
- Backend Services: , ,  for AI-powered analysis, and  logic.
- Frontend UI: Basic React application with company table, import wizard, and dynamic inspector sidebar.
- Docker Integration: Updated  and  for multi-stage builds and sideloading.
- Deployment & Access: Integrated into central Nginx proxy and dashboard, accessible via .

Lessons Learned & Fixed during development:
- Frontend Asset Loading: Addressed issues with Vite's  path and FastAPI's .
- TypeScript Configuration: Added  and .
- Database Schema Evolution: Solved  errors by forcing a new database file and correcting  override.
- Logging: Implemented robust file-based logging ().

This new foundation provides a powerful and maintainable platform for future B2B robotics lead generation.
2026-01-07 17:55:08 +00:00

57 lines
1.7 KiB
Python

from abc import ABC, abstractmethod
from typing import List, Optional, Dict, Any
from pydantic import BaseModel
# --- Generisches Datenmodell ---
# Damit ist unsere App unabhängig davon, wie SuperOffice Felder benennt.
class LeadData(BaseModel):
name: str
website: Optional[str] = None
city: Optional[str] = None
country: str = "DE"
industry: Optional[str] = None
# Enrichment Data
robotics_potential_score: int = 0
robotics_potential_reason: Optional[str] = None
# Meta
source_id: Optional[str] = None # ID im Quellsystem (z.B. SuperOffice ID)
class TaskData(BaseModel):
subject: str
description: str
deadline: Optional[str] = None
# --- Der Vertrag (Repository Interface) ---
class CRMRepository(ABC):
"""
Abstrakte Basisklasse für alle CRM-Integrationen.
Egal ob Notion, SuperOffice oder Odoo - alle müssen diese Methoden haben.
"""
@abstractmethod
def get_name(self) -> str:
"""Gibt den Namen des Systems zurück (z.B. 'SuperOffice')"""
pass
@abstractmethod
def find_company(self, name: str, email: str = None) -> Optional[str]:
"""Sucht eine Firma und gibt die externe ID zurück, falls gefunden."""
pass
@abstractmethod
def create_lead(self, lead: LeadData) -> str:
"""Erstellt einen neuen Lead und gibt die externe ID zurück."""
pass
@abstractmethod
def update_lead(self, external_id: str, lead: LeadData) -> bool:
"""Aktualisiert einen bestehenden Lead mit neuen Enrichment-Daten."""
pass
@abstractmethod
def create_task(self, external_id: str, task: TaskData) -> bool:
"""Erstellt eine Aufgabe/Wiedervorlage für den Vertriebler beim Lead."""
pass