-
Notifications
You must be signed in to change notification settings - Fork 1
Example 21 coding platform
Build:
cmake --preset linux-ninja-release && cmake --build --preset linux-ninja-release
Eine vollstΓ€ndige Coding-Plattform, die ThemisDB als Backend nutzt, um Code-Snippets, Projekte und Dokumentationen zu verwalten. Die Plattform bietet VSCode-Integration und kann Code-Beispiele aus dem Internet scrapen und intelligent indexieren.
- β Code-Snippet-Verwaltung - Speichern und organisieren von Code-Fragmenten
- β Projekt-Management - VollstΓ€ndige Projekte mit Dateien und Strukturen
- β Dokumentations-Hub - Technische Dokumentationen zentral verwalten
- β Tagging & Kategorisierung - Flexible Organisation nach Sprachen, Frameworks, Topics
- β Internet-Quellen scrapen - Automatisches Extrahieren von Code-Beispielen
- β GitHub-Integration - Repositories und Gists importieren
- β Stack Overflow - Fragen und Antworten crawlen
- β Dokumentations-Crawler - ReadTheDocs, DevDocs, etc.
- β Smart Parsing - Automatische Erkennung von Code-BlΓΆcken und Sprachen
- β Duplikat-Erkennung - Γhnliche Code-Snippets identifizieren
- β Vector Search - Semantische Code-Suche mit Embeddings
- β Code2Vec - Code in hochdimensionale Vektoren konvertieren
- β Γhnlichkeits-Suche - "Finde Γ€hnlichen Code"
- β Natural Language Queries - "Zeige mir Python Beispiele fΓΌr async/await"
- β Code-Empfehlungen - Basierend auf aktuellem Kontext
- β Extension - Native VSCode-Erweiterung
- β Snippet-Browser - Code-Snippets direkt in VSCode durchsuchen
- β Quick Insert - Snippets mit einem Klick einfΓΌgen
- β Context-Aware - VorschlΓ€ge basierend auf aktuellem Code
- β Sync - Lokale Snippets mit ThemisDB synchronisieren
- β Code-Editor - Syntax-Highlighting und Bearbeitung
- β Tree-View - Hierarchische Projektstruktur
- β Search Interface - Leistungsstarke Suchfunktionen
- β Import/Export - Batch-Import von Code-Dateien
- β Preview - Live-Vorschau von Code-Rendering
{
"id": "snippet_uuid",
"title": "Async HTTP Request in Python",
"description": "Example of async HTTP requests using aiohttp",
"code": "import aiohttp\n...",
"language": "python",
"framework": "aiohttp",
"tags": ["async", "http", "networking"],
"embedding": [0.123, -0.456, ...], # 512D code embedding
"metadata": {
"author": "max@example.com",
"source_url": "https://github.com/...",
"source_type": "github",
"license": "MIT",
"stars": 125,
"created_at": "2025-12-22T10:00:00Z",
"updated_at": "2025-12-22T15:30:00Z"
},
"stats": {
"views": 245,
"copies": 18,
"likes": 12
}
}{
"id": "project_uuid",
"name": "FastAPI REST API Example",
"description": "Complete REST API with authentication",
"language": "python",
"framework": "fastapi",
"files": [
{
"path": "main.py",
"content": "from fastapi import FastAPI\n...",
"language": "python"
},
{
"path": "requirements.txt",
"content": "fastapi==0.104.1\n...",
"language": "text"
}
],
"structure": {
"type": "tree",
"root": {
"name": "project_root",
"children": [...]
}
},
"dependencies": ["fastapi", "uvicorn", "pydantic"],
"readme": "# FastAPI Example\n...",
"tags": ["api", "rest", "authentication"],
"metadata": {
"source_url": "https://github.com/...",
"source_type": "github_repo",
"stars": 1500,
"forks": 234
}
}{
"id": "doc_uuid",
"title": "Python AsyncIO Guide",
"content": "# AsyncIO\n\nAsync programming in Python...",
"type": "guide", # guide, tutorial, reference, api_doc
"language": "python",
"framework": "asyncio",
"sections": [
{
"title": "Introduction",
"content": "...",
"code_examples": ["snippet_id_1", "snippet_id_2"]
}
],
"embedding": [0.234, -0.567, ...],
"metadata": {
"source_url": "https://docs.python.org/...",
"source_type": "official_docs",
"version": "3.12",
"last_updated": "2025-12-01"
},
"related_snippets": ["snippet_uuid_1", "snippet_uuid_2"],
"related_projects": ["project_uuid_1"]
}{
"id": "job_uuid",
"type": "github_repo", # github_repo, stackoverflow, docs_site
"source_url": "https://github.com/user/repo",
"status": "completed", # pending, running, completed, failed
"config": {
"max_depth": 3,
"file_patterns": ["*.py", "*.js", "*.md"],
"exclude_patterns": ["test_*", "*_test.py"],
"min_file_size": 100,
"max_file_size": 100000
},
"results": {
"snippets_created": 45,
"projects_created": 1,
"docs_created": 8,
"duplicates_found": 12,
"errors": 2
},
"started_at": "2025-12-22T10:00:00Z",
"completed_at": "2025-12-22T10:15:23Z",
"error_log": []
}# Python 3.8+
python --version
# ThemisDB Server
docker run -d \
--name themisdb \
-p 8080:8080 \
-p 18765:18765 \
themisdb/themisdb:latest
# Node.js fΓΌr VSCode Extension (optional)
node --version # v16+cd examples/21_coding_platform
# Python Dependencies installieren
pip install -r requirements.txt
# Embedding-Modell herunterladen (automatisch beim ersten Start)
python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('microsoft/codebert-base')"cd vscode_extension
npm install
npm run compile
# Extension in VSCode laden
# DrΓΌcke F5 in VSCode, um Extension Development Host zu startenpython main.py# GitHub Repository scrapen
from web_scraper import GitHubScraper
scraper = GitHubScraper()
job_id = scraper.scrape_repository(
url="https://github.com/fastapi/fastapi",
max_files=100,
file_patterns=["*.py"]
)
# Status prΓΌfen
status = scraper.get_job_status(job_id)
print(f"Scraped {status['results']['snippets_created']} snippets")# Stack Overflow scrapen
from web_scraper import StackOverflowScraper
scraper = StackOverflowScraper()
job_id = scraper.scrape_questions(
tags=["python", "asyncio"],
min_score=10,
max_questions=50
)# Dokumentation crawlen
from web_scraper import DocsCrawler
crawler = DocsCrawler()
job_id = crawler.crawl_documentation(
base_url="https://docs.python.org/3/library/asyncio.html",
max_depth=2
)from code_indexer import CodeIndexer
from themis_client import ThemisClient
client = ThemisClient()
indexer = CodeIndexer(client)
# Natural Language Query
results = indexer.search_by_description(
query="asynchronous HTTP requests in Python",
limit=10
)
for snippet in results:
print(f"{snippet['title']} - Similarity: {snippet['score']:.2f}")
print(snippet['code'][:200])
print("---")- Extension installieren: Siehe Installation
-
Command Palette ΓΆffnen (
Ctrl+Shift+P) - "ThemisDB: Search Snippets" eingeben
- Suchbegriff eingeben
- Snippet auswΓ€hlen und automatisch einfΓΌgen
Oder:
- Sidebar ΓΆffnen: ThemisDB Icon in der Activity Bar
- Snippets durchsuchen: Hierarchische Ansicht nach Sprachen
- Drag & Drop: Snippet in Editor ziehen
- HOW_TO.md - Schritt-fΓΌr-Schritt Bedienungsanleitung
- VSCODE_INTEGRATION.md - VSCode Extension Setup
- WEB_SCRAPING.md - Web Scraping und Ingestion
- ARCHITECTURE.md - System-Architektur und Design
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Tkinter Desktop App β
β ββββββββββββ ββββββββββββ ββββββββββββββββββββββββ β
β β Editor β β Search β β Scraper Dashboard β β
β ββββββββββββ ββββββββββββ ββββββββββββββββββββββββ β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βββββββββββββ΄ββββββββββββ
β β
ββββββββββΌβββββββββ ββββββββββΌββββββββββ
β Code Indexer β β Web Scraper β
β - Embeddings β β - GitHub β
β - Vector DB β β - StackOverflow β
β - Similarity β β - Docs Sites β
ββββββββββ¬βββββββββ ββββββββββ¬ββββββββββ
β β
βββββββββββββ¬ββββββββββββ
β
ββββββββββΌβββββββββ
β ThemisDB API β
β - Vector Model β
β - Doc Model β
β - Graph Model β
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β ThemisDB Core β
βββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββ
β VSCode Extension β
β ββββββββββββ βββββββββββββββββββββββ β
β β Sidebar β β Command Palette β β
β β Browser β β - Search β β
β β β β - Insert β β
β β β β - Sync β β
β ββββββββββββ βββββββββββββββββββββββ β
ββββββββββββββ¬βββββββββββββββββββββββββββββ
β REST API
β
ββββββββββΌβββββββββ
β ThemisDB API β
βββββββββββββββββββ
Sammeln und organisieren Sie Ihre eigenen Code-Snippets:
# Snippet speichern
client.create_snippet(
title="JWT Authentication Decorator",
code=my_decorator_code,
language="python",
tags=["auth", "jwt", "decorator"]
)
# SpΓ€ter finden
snippets = client.search_snippets(
query="authentication decorator",
language="python"
)Teilen Sie Code-Wissen im Team:
# Projekt importieren
project = client.import_project_from_github(
url="https://github.com/company/internal-lib",
visibility="team"
)
# Team-Mitglieder kΓΆnnen suchen
results = client.search_projects(
query="database connection pooling",
team="backend"
)Lernen Sie aus echtem Code:
# Beispiele von GitHub sammeln
scraper.scrape_repositories(
search_query="fastapi authentication",
min_stars=100,
max_repos=20
)
# Tutorials generieren
tutorial = client.generate_tutorial(
topic="FastAPI JWT Authentication",
level="beginner"
)Finden Sie Best Practices:
# Γhnlichen Code finden
similar = client.find_similar_code(
code=my_implementation,
language="python",
min_similarity=0.7
)
# Best Practices identifizieren
best_practices = [s for s in similar if s['metadata']['stars'] > 500]-
ThemisDB - Multi-Model Database
- Vector Model fΓΌr Code-Embeddings
- Document Model fΓΌr Snippets und Docs
- Graph Model fΓΌr Beziehungen
- Python 3.8+ - Hauptsprache
- Tkinter - Desktop GUI
- tkinter-code-editor - Syntax-Highlighting
- requests - HTTP Client
- beautifulsoup4 - HTML Parsing
- PyGithub - GitHub API Client
- selenium (optional) - JavaScript-rendered Seiten
- tree-sitter - Code Parsing
- pygments - Syntax-Highlighting
- sentence-transformers - Text-Embeddings
- microsoft/codebert-base - Code-Embeddings
- TypeScript - Extension Sprache
- VSCode Extension API - Integration
- axios - API Client
21_coding_platform/
βββ README.md # Diese Datei
βββ HOW_TO.md # Bedienungsanleitung
βββ VSCODE_INTEGRATION.md # VSCode Setup
βββ WEB_SCRAPING.md # Scraping Guide
βββ ARCHITECTURE.md # System-Design
βββ requirements.txt # Python Dependencies
βββ main.py # Desktop App Entry Point
βββ themis_client.py # ThemisDB Client
βββ models.py # Datenmodelle
βββ web_scraper.py # Web Scraping Module
βββ code_indexer.py # Code Embedding & Search
βββ ui/
β βββ main_window.py # Hauptfenster
β βββ editor_panel.py # Code-Editor
β βββ search_panel.py # SuchoberflΓ€che
β βββ scraper_panel.py # Scraper Dashboard
β βββ project_tree.py # Projekt-Browser
βββ scrapers/
β βββ github_scraper.py # GitHub Integration
β βββ stackoverflow_scraper.py # Stack Overflow
β βββ docs_crawler.py # Dokumentations-Crawler
βββ vscode_extension/
β βββ package.json # Extension Manifest
β βββ src/
β β βββ extension.ts # Main Extension
β β βββ snippetProvider.ts # Snippet TreeView
β β βββ api_client.ts # ThemisDB API Client
β βββ README.md # Extension Docs
βββ tests/
βββ test_scraper.py
βββ test_indexer.py
βββ test_client.py
# .env Datei verwenden
GITHUB_TOKEN=ghp_xxxxxxxxxxxxx
STACKOVERFLOW_KEY=xxxxxxxxxxxxx
# In Code laden
from dotenv import load_dotenv
load_dotenv()- GitHub API: Max 5000 requests/hour (authenticated)
- Stack Overflow: Max 300 requests/day (free tier)
- Implementiert mit exponential backoff
- Keine Speicherung von PasswΓΆrtern oder Tokens in ThemisDB
- Nur ΓΆffentlicher Code wird gescrapet
- Respektierung von robots.txt
Error: GitHub API rate limit exceeded
LΓΆsung: GitHub Personal Access Token konfigurieren:
export GITHUB_TOKEN=ghp_your_token_hereWarning: Embedding generation taking > 5s per snippet
LΓΆsung: GPU-Beschleunigung aktivieren:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118Error: Cannot find module 'axios'
LΓΆsung:
cd vscode_extension
npm install
npm run compileWollen Sie neue Scraper hinzufΓΌgen oder Features verbessern?
- Forken Sie das Repository
- Erstellen Sie einen Feature Branch
- Implementieren Sie Ihre Γnderungen
- FΓΌgen Sie Tests hinzu
- Erstellen Sie einen Pull Request
# scrapers/my_scraper.py
from web_scraper import BaseScraper
class MyScraper(BaseScraper):
def scrape(self, url: str) -> List[CodeSnippet]:
# Ihre Implementierung
passDieses Beispiel ist unter der MIT-Lizenz lizenziert - siehe LICENSE fΓΌr Details.
Bei Fragen oder Problemen:
NΓ€chste Schritte:
- Starten Sie mit HOW_TO.md fΓΌr eine detaillierte Anleitung
- Lesen Sie WEB_SCRAPING.md um Code aus dem Internet zu importieren
- Installieren Sie die VSCode Extension fΓΌr nahtlose Integration
Status: Ready | Letzte Aktualisierung: 2025-12-24
ThemisDB 1.9.0-beta Β· Home Β· Module-Index Β· GitHub Β· Issues
ThemisDB 1.9.0-beta Β· Home Β· Wiki-Index Β· Module-Index Β· FAQ Β· Quick-Reference Β· GitHub Β· Issues Β· Discussions Β· License
- Batch Operations
- Best Practices
- CRUD Tutorial
- Custom Document Ingestion
- Getting Started Tutorial
- Interactive Examples
- Schema Design
- Video Tutorials
- AQL Reference
- AQL Examples
- AQL Overview
- AQL Feature Roadmap
- AQL Geospatial Guide
- AQL LLM Migration Guide
- AQL API
- AQL Grammar (EBNF)
- AQL Root Overview
- AQL Examples (root)
- API Reference
- API Module README
- OpenAPI Overview
- Client SDK Overview
- SDK Overview
- Operations
- Operations Overview
- Operations Runbook
- Operations Handbook
- ThemisCtl Admin Guide
- Pipeline E2E SOPs
- Deploy Overview
- Docker Overview
- Docker Hub README
- Helm Overview
- Packaging Overview
- Operator Overview
- Security Policy
- Production Hardening Checklist
- Security Hardening Guide
- Encryption Key Management
- Access Control Framework
- Zero Trust Policy
- API Authentication & Authorization
- HSM Production Setup
- PKCS11 Integration
- DSGVO / SOC2 Checklist
- Access Model Runbooks
- Access Model Dashboard
- Maturity Automation Runbook
- Access Review Automation
- Access Model Dashboard
- Access Model Runbooks
- Rights Revocation
- Dr Checklists
- Dr Testing
- Incident Response Playbook
- Incident Response Testing
- GPU Oom Recovery
- Grammar Debugging
- Metrics Scrape Troubleshooting
- Model Swap Procedure
- Quota Tuning
- Subagent Deployment
- Logging Configuration
- Content Model
- Crypto & Keys
- Feature Flags Reference
- Modular Architecture Roadmap
- Modularization Guide
- Module Architecture Index
- PostgreSQL Wire Protocol
- Query Scheduling
- Raft Consensus Design
- Resource Pooling
- Source Directory Guide
- Unified Access Model
- E1 001 Layered Retrieval Design
- E1 002 Ann Abstraction Strategy
- E1 003 Tensor Summary Types
- E1 004 Lora Package Distinction
- E1 005 Model Switch Compatibility
- E1 006 Federated Tensor Summaries
- E2 001 Evaluation Framework Design
- E2 002 Hardware Profile Strategy
- E2 003 Query Planner Routing Model
- E2 004 Approximation Governance Rules
- E2 005 Cross Layer Fallback Confidence Policy
- E3 001 Distributed Tensor Design
- E3 002 Manifest Coordination Strategy
- E3 003 Recovery And Erasure Choice
- E3 004 Tensor Fabric Infrastructure
- Contributing
- Contributing (root)
- Code of Conduct
- Support
- Maintainers
- CTest Guide
- Build Quick Reference
- Developer Wiki Index
- Build / Test / CI
- Module Index
- Branching Strategy
- Disabled Stub Policy
- Docs PR Policy
- GA Promotion Sign Off
- Github Milestones Setup
- Maturity Claim Verification Checklist
- Maturity Evidence Registry
- Merge Gate Bot Config
- Merge Gate Status Live
- Phase 1 Closure Report
- Phase Closure Policy
- Phase Dependency Graph
- Phase3 Enforcement Runbook
- Plugin Submodule Rollback
- PR Version Targeting
- PR Version Targeting Backfill
- Production Ready 2026 Delivery Plan
- Query Module Status
- Readme
- Release Promotion Gate Policy
- Release Validation Checklist
- Security Module 5671 Evidence Summary
- Sharding P6 Residual Risk Acceptance
- Sourcecode Compliance Governance
- Updates Development Status Sign Off
- Wave C Implementation Complete
- Blob Storage
- Cuda
- Ethics Ai
- Exporters
- Huggingface
- Image Analysis
- Importers
- RPC
- Scraper
- Themisdb Ai Watermark Detector
- User Storage Encrypted
- Chimera Architecture
- Chimera Future
- Chimera Readme
- Chimera Roadmap
- Covina Fastapi Ingestion Architecture
- Covina Fastapi Ingestion Future
- Covina Fastapi Ingestion Roadmap
- Vcc Base Architecture
- Vcc Base Future
- Vcc Base Roadmap
- Vcc Clara Ingestion Architecture
- Vcc Clara Ingestion Future
- Vcc Clara Ingestion Roadmap
- Vcc Veritas Architecture
- Vcc Veritas Future
- Vcc Veritas Roadmap
- 01 Hello World
- 02 Todo App
- 03 Contact Manager
- 04 Inventory System
- 05 Time Series Monitor
- 06 Graph Social Network
- 07 Vector Search Documents
- 08 Dms Erp System
- 09 Iot Sensor Network
- 10 Drone Image Analysis
- 11 Blog Wiki
- 12 Expense Tracker
- 13 Recipe Manager
- 14 Ecommerce Catalog
- 15 Event Management
- 16 Kanban Board
- 17 Crm
- 18 Realtime Chat
- 19 Recommendation Engine
- 20 Smart Home
- 21 Coding Platform
- 22 AQL Diagram Tool
- 23 Traveling Salesman
- 24 Moral Philosophy Debates
- API Versioning
- Distributed Sharding
- Feedback Plugins
- Geo
- Gnn
- Image Analysis
- Legal Lora Training
- LLM
- Lora Sync
- Migration
- Nlp
- Performance
- Railway
- Replication
- Rope Visualization
- Sample Product Config
- Security
- Client SDK Overview
- Quickstart
- Sdk Enhancements
- Sdk Implementation Summary
- Test Suite Readme
- Go
- Java
- Javascript
- Php
- Python
- Ruby
- Rust
- Typescript
- 01 Grundlegende Operationen
- 02 AQL Queries
- 03 Graph Daten
- 04 Multimodell Anwendung
- 01 Quickstart Guide
- 02 AQL Referenz Kurzuebersicht
- 03 Datenmodellierung Guide
- 04 Uebungsaufgaben
- 05 Best Practices Guide
- Training Documents
- Training Overview
- 01 Einfuehrung Und Uebersicht
- 02 Datenmodelle Und Architektur
- 03 AQL Abfragesprache
- 04 Installation Und Setup
- 05 Anwendungsbeispiele
- Training Presentations
- Dependencies Readme
- Processmonitor Readme
- Themis.admintools.shared Readme
- Themis.aqlquerybuilder Readme
- Themis.aqlquerybuilder Roadmap
- Themis.auditlogviewer Readme
- Themis.auditlogviewer Roadmap
- Themis.classificationdashboard Readme
- Themis.classificationdashboard Roadmap
- Themis.compliancereports Readme
- Themis.compliancereports Roadmap
- Themis.gisviewer.controlpanel Readme
- Themis.gisviewer.controlpanel Roadmap
- Themis.impactanalysisviewer Readme
- Themis.impactanalysisviewer Roadmap
- Themis.ingestiontool Readme
- Themis.ingestiontool Roadmap
- Themis.keyrotationdashboard Readme
- Themis.keyrotationdashboard Roadmap
- Themis.piimanager Readme
- Themis.piimanager Roadmap
- Themis.retentionmanager Readme
- Themis.retentionmanager Roadmap
- Themis.sagaverifier Readme
- Themis.sagaverifier Roadmap
- Themis.usbadmintool Readme
- Themis.usbadmintool Roadmap
- CI Readme
- CI Roadmap
- Compiler Diagnostics Readme
- Compiler Diagnostics Roadmap
- Completion Readme
- Copilot Ollama Router Readme
- Copilot Ollama Router Roadmap
- Gnn Readme
- Gnn Roadmap
- Rope Visualizer Readme
- Rope Visualizer Roadmap
- Tco Calculator Readme
- Tco Calculator Roadmap
- Tests Readme
- Tests Roadmap
- Themis Config Wx Readme
- Themis Docs Builder Readme
- Wikipedia Ingestion Readme