How koldbringer/gobeklitepe works
Project Type and Purpose
• This is a full-stack CRM/ERP web application specialized for HVAC companies.
• Frontend: Streamlit PWA running in a Docker container (or as a managed Fly.io app).
• Backend: Python “modular monolith” with pluggable service modules and gRPC microservices (including a Rust-based quantum engine).
• Data Stores: PostgreSQL (primary relational DB), Supabase (auth, storage), Qdrant (vector DB for embeddings), plus file-based OCR/DMS.
• External Services: ElevenLabs TTS API, SMTP/email gateways, SMS/voice gateways.
A. Frontend Layer
• Streamlit (app.py, components/, pages/)
• HTTP/WS endpoints for health checks, WebSocket tests
B. Backend Application Layer
• Core Python process (app.py imports config.py, utils/, services/)
• Business-logic modules in services/ (communication_service, email_service, voice_communication, quantum_communication)
• gRPC server (grpc_server.py), gRPC client stubs (grpc_client.py, generate_grpc.py)
C. Quantum Engine Microservice
• Rust code under przestrzeń_kwantowa/ compiled as a separate service
• Exposes gRPC interface defined in protos/service.proto
D. Persistence Layer
• PostgreSQL (utils/db.py, schemas in przestrzeń_kwantowa/schemat_bazy_danych.sql)
• Supabase client (utils/supabase_client.py)
• Qdrant vector store connector (src/qdrant_connector.rs and Python wrappers)
• OCR/DMS storage (local files or S3 via Supabase)
E. External Integrations
• ElevenLabs TTS (voice_interface)
• SMTP/email (templates/email/*.html)
• SMS/telephony APIs (voice interface, transcription services)
F. Infrastructure & Deployment
• NGINX reverse proxy (nginx/*.conf)
• Docker (Dockerfile via build.sh, entrypoint.sh)
• Fly.io (fly.toml), Heroku (Procfile)
• CI/CD scripts (deploy.sh, build_context.sh)
• Health checks (health_check.py, network_health_check.py)
Relationships & Data Flows
• The user’s browser/mobile calls the Streamlit frontend (HTTP/WS).
• Frontend invokes backend functions directly (in-process calls) or via gRPC to the quantum microservice.
• Backend modules call:
• PostgreSQL for transactional data (clients, orders, inventory)
• Qdrant for vector searches (quantum-inspired prioritization)
• Supabase for auth and file storage (DMS/OCR assets)
• External APIs (ElevenLabs, SMTP, SMS gateways).
• Rust quantum service computes entanglement scores and returns results over gRPC.
• NGINX sits in front to route traffic, terminate TLS, and serve static files (robots.txt, health.json).
Architectural Patterns & Principles
• Modular Monolith / Microservices hybrid
• Layered architecture (UI → Services → Data)
• Clean separation between:
• Presentation (Streamlit UI)
• Business Logic (services/)
• Infrastructure (utils/, networking, deployment scripts)
• Use of Protobuf/gRPC for inter-service contracts (language-agnostic quantum engine)
• Config-driven (config.py, .env templates) to toggle features (quantum, voice)