Project Map (Codebase)
Questi contenuti non sono ancora disponibili nella tua lingua.
ποΈ Project Map (Codebase)
Section titled βποΈ Project Map (Codebase)βLiving Document - Questa mappa riflette la struttura del repository
BLACKTRAILS-PLATFORM.
π³ Albero Strutturale
Section titled βπ³ Albero StrutturaleβBLACKTRAILS-PLATFORM/ββββ π ROOT DOCS # Documentazione di Progettoβ βββ ANTHROPIC_MIGRATION.md # Migrazione a Claudeβ βββ DEPLOY_CHECKLIST.md # Checklist Deployβ βββ PRODUCTION_AUDIT.md # Audit Produzioneβ βββ PRODUCTION_READY.txt # Status Produzioneβ βββ PRODUCTION_TEST_GUIDE.md # Guida Test Produzioneβ βββ SUMMARY.md # Sommario Generaleββββ ποΈ db/ # Database Schemaβ βββ schema.sql # Schema PostgreSQL (Neon)ββββ π docs/ # Documentazione Tecnicaβ βββ DATABASE.md # β Schema Multi-Databaseβ βββ DB_MIGRATION_PLAN.md # Piano Migrazione DBβ βββ GITHUB_AUDIT_2025-12-18.md # Audit GitHub Reposβ βββ in1_algoritmo.md # Algoritmo IN-1 (ALMA)β βββ LIBRARY_PIPELINE_ANALYSIS.md # Analisi Pipeline Docsβ βββ MIGRATION_REPORT_2025-12-18.mdβ βββ structure.md # Struttura Generaleββββ π library/ # π― Source of Truth (Docs as Code)β βββ public/ # Docs Pubblici (Sync DB)β β βββ en/ # English Docsβ β β βββ algorithms/β β β βββ legal/β β β βββ philosophy/β β β β βββ rhama.mdβ β β β βββ rhama-paradigm.mdβ β β βββ projects/β β βββ it/ # Italian Docsβ β βββ algoritmi/β β βββ filosofia/β β β βββ manifesto.mdβ β β βββ rhama.mdβ β β βββ rhama-paradigm.mdβ β βββ legal/β β βββ progetti/β βββ private/ # Docs Privati (Solo Git)β β βββ finanza/β β βββ strategie/β βββ README.mdββββ π οΈ maintenance/ # Script Manutenzioneβ βββ deploy-worker.ps1 # Deploy Cloudflare Workerβ βββ deploy.ps1 # Deploy Generaleβ βββ maintenance-*.html # Pagine Manutenzione Brandβ βββ worker-split.js # Split Worker Codeβ βββ README.mdββββ π¦ scripts/ # Automation Scriptsβ βββ sync-library.js # β Sync Docs β DBβ βββ migrate-haiku-to-rhama.js # Migrazione Haiku β Rhamaβ βββ setup-production-db.js # Setup DB Produzioneβ βββ cloudflare-deploy-v2.js # Deploy Cloudflare Pagesβ βββ generate-phonetics.js # Generazione Foneticheβ βββ translate-rhamas.js # Traduzione Rhamaβ βββ verify-production.js # Verifica Produzioneβ βββ [altri 15+ script utility]ββββ π¨ src/ # Codice Sorgenteβ βββ brands/ # Multi-Brand Architectureβ β βββ blacktrails/β β β βββ routes.jsβ β β βββ views/β β βββ elements/β β β βββ routes.jsβ β β βββ views/β β βββ forest/β β β βββ routes.jsβ β β βββ views/β β βββ gcore/β β β βββ routes.jsβ β β βββ views/ [9 *.ejs]β β βββ in1/β β βββ routes.js # 14 endpoints (Rhama, Soul Card, API)β β βββ services/β β β βββ almaOrchestrator.js # ALMA orchestration layerβ β β βββ almaRhama.js # Rhama generation logicβ β β βββ almaService.js # ALMA API clientβ β β βββ poetService.js # Poet model integrationβ β β βββ config/β β β β βββ almaConfig.jsβ β β βββ prompts/β β β βββ alma.js # β ALMA system prompt (Alchemy Detection)β β β βββ alma_BACKUP_PRE_ZENSPHERE.jsβ β β βββ poeta.jsβ β βββ views/β β βββ index.ejs # IN-1 homepageβ β βββ rhama.ejs # Rhama generator UIβ β βββ soul-card.ejs # β Soul Card (Aurora Boreale)β β βββ vision.ejs # Vision pageβ β βββ legal.ejs # Legal docsβ ββ βββ core/ # Core Systemβ β βββ index.js # Entry Pointβ β βββ db.js # Database Clientβ β βββ auth.js # Authenticationβ β βββ middleware.js # Express Middlewareβ β βββ permissions.js # RBAC Permissionsβ β βββ email.js # Email Serviceβ ββ βββ public/ # Public Assetsβ βββ routes/β β βββ auth.jsβ β βββ landing.jsβ βββ server.js # Main Serverβ βββ utils/core/β βββ views/β βββ content/ [3 *.md]β βββ css/ [4 *.css]β βββ js/ [7 *.js]β βββ favicons/ββββ π§ͺ tests/ # Test Suiteβ βββ test-alma-*.js # ALMA AI Testsβ βββ test-poeta.js # Poet Model Testβ βββ test-emotion-analyzer.js # Emotion Analysisβ βββ test-conversation.js # Conversation Flowβ βββ test-end-to-end.js # E2E Testβ βββ [altri 30+ test files]ββββ π package.json # Dependenciesβββ package-lock.jsonβββ server.log # Runtime Logπ Architettura Modulare
Section titled βπ Architettura Modulareβ1. Multi-Brand System
Section titled β1. Multi-Brand Systemβsrc/brands/βββ blacktrails/ β blacktrails.io (Hub)βββ elements/ β elements.blacktrails.io (Property Mgmt)βββ forest/ β forest.blacktrails.io (AI Gallery)βββ gcore/ β gcore.blacktrails.io (Analytics)βββ in1/ β in-1.ai (Rhama Generator)2. Core System
Section titled β2. Core Systemβcore/db.jsβ Neon PostgreSQL Clientcore/auth.jsβ JWT + Session Managementcore/middleware.jsβ Express Middleware Layercore/permissions.jsβ Role-Based Access Control
3. Library Pipeline
Section titled β3. Library Pipelineβlibrary/public/*.md β (Git Commit)scripts/sync-library.js β (Parse Frontmatter + MD5 Hash)PostgreSQL: library.documents β (pgvector Embeddings)AI RAG Search (IN-1, Forest)4. Database Architecture
Section titled β4. Database ArchitectureβNeon Cluster: blacktrails
- Branch:
main(Produzione) - Branch:
dev(Sviluppo)
Schemas:
authβ Users, Sessionsin1β Rhamas (with Alchemy Detection: Piombo/Transition/Oro)elementsβ Properties, Bookingsfinanceβ Transactionslibraryβ Documents (pgvector for RAG)aiβ Models, Promptssystemβ Config, Logsorganizationβ Teams, Invites
π Entry Points
Section titled βπ Entry Pointsβ| Brand | Dominio | Entry Point | Tech Stack |
|---|---|---|---|
| BlackTrails | blacktrails.io | src/brands/blacktrails/routes.js | Node.js + EJS |
| IN-1 | in-1.ai | src/brands/in1/routes.js | ALMA AI + Claude |
| Elements | elements.blacktrails.io | src/brands/elements/routes.js | Property Mgmt |
| Forest | forest.blacktrails.io | src/brands/forest/routes.js | AI Gallery |
| gCore | gcore.blacktrails.io | src/brands/gcore/routes.js | Analytics |
π² IN-1 Routes Detail
Section titled βπ² IN-1 Routes DetailβMain Routes (Public):
GET /- HomepageGET /rhama- Rhama generator UI (main experience)GET /soul-card- β Soul Card (collective emotional state visualization)GET /vision- Vision & philosophy pageGET /legal,/privacy,/terms,/contact- Legal pages
API Routes:
POST /api/rhama- Main Rhama generation API (rate-limited)- Input:
{ messages: [...], turn: N } - Output:
{ status, response, rhama?, turn, alchemy? } - Alchemy Detection: Evaluates baseline emotional state (first turn)
- Database: Saves to
in1.rhamaswith emotion tag
- Input:
GET /api/rhamas/random- Random Rhama from databasePOST /api/tree- Tree planting trigger (future)
User Routes (Auth Required):
GET /app- User dashboard (personal Rhama history)GET /app/create- New Rhama creation page
Special Features:
- Soul Card (
/soul-card):- Queries
in1.rhamasfor today + historical emotional states - Calculates weighted color mix (Piombo=indigo, Transition=violet, Oro=gold)
- Renders animated gradient card (Aurora Boreale effect)
- CSS animations:
aurora(15s),breathe(4s),cardFloat(4s) - Interactive 3D flip on click
- Queries
π§ͺ Test Coverage
Section titled βπ§ͺ Test Coverageβ| Categoria | File | Focus |
|---|---|---|
| AI Flow | test-alma-v2-flow.js | ALMA Pipeline Completo |
| Emotion | test-emotion-analyzer.js | Analisi Emotiva |
| Conversation | test-conversation.js | Multi-Turn Dialogue |
| Safety | test-safety-keyword.js | Content Moderation |
| E2E | test-end-to-end.js | Full User Journey |
π€ Agent Update Instructions
Section titled βπ€ Agent Update InstructionsβAI Assistant: Quando la struttura del codice cambia (nuove cartelle, moduli, brand), esegui:
# 1. Scansiona la root del progettolist_dir E:\BLACKTRAILS-PLATFORM (ricorsivo, escludi node_modules)
# 2. Aggiorna questo file mantenendo:# - Albero ASCII completo# - Tabelle Entry Points# - Descrizioni moduli chiave
# 3. Commit con messaggio:git commit -m "docs(truth): update project map"Last Auto-Update: 2025-12-22 00:30 UTC
Last Changes: IN-1 routes detail (Soul Card, Alchemy Detection)
Next Review: On major refactoring
Maintainer: BlackTrails AI Agent
Source Repo: BLACKTRAILS-PLATFORM