CoolFace
Apppublic

AiCenterSolutions/concept-map-ai

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

AI Concept Map Generator

Web App/PWA che, dato un testo (incolla/PDF/URL), estrae concetti (NER, keyphrases, TF‑IDF/embeddings), costruisce una mappa concettuale interattiva (Cytoscape) e consente registrazione/login con salvataggio progetti.

Stack (vincolante)

  • Backend: Python 3.11, FastAPI, Pydantic v2, SQLAlchemy 2, spaCy (it/en), yake, scikit‑learn (TF‑IDF), sentence‑transformers/all‑MiniLM‑L6‑v2, networkx, cdlib, PyMuPDF, langdetect, bcrypt, JWT (HS256).
  • Frontend: React + TypeScript + Vite, Tailwind, Cytoscape.js (+ cose‑bilkent), router, PWA (manifest + SW), UI responsive.
  • DB: SQLite (dev), predisposizione Postgres.
  • Deploy: Docker; il Dockerfile builda il frontend e lo serve dal backend.

Monorepo

backend/ (FastAPI, NLP, auth, DB) frontend/ (React+TS+Vite, Tailwind, Cytoscape, PWA) deployment/ (materiale di deploy) scripts/ (utility) tests/ (pytest backend, test UI) docs/ (documentazione)

Roadmap (estratto)

  1. 1.Allineamento
  2. 2.Bootstrap repo
  3. 3.Backend base: FastAPI, CORS, config
  4. 4.DB & Auth: SQLAlchemy, JWT, /auth, test
  5. 5.Projects CRUD: /projects protetto, schema, test
  6. 6.Ingestione: PDF/URL/Text, test
  7. 7.NLP Core: cleaner, chunker, keyphrases, NER, embeddings cache, test
  8. 8.Graph Build: co‑occorrenze/SEM links, clustering, ranking, export, test
  9. 9.Frontend: Vite, Tailwind, routing, tema
  10. 10.Auth UI: login/register, guard, test
  11. 11.Editor & Graph: GraphView (Cytoscape), toolbar, export
  12. 12.PWA: manifest, icone, service worker
  13. 13.Docker
  14. 14.E2E
  15. 15.Deploy

Variabili d'ambiente (anticipazione)

  • DATABASE_URL (es. sqlite:///./dev.db)
  • JWTSECRET, JWTEXPIRES_MINUTES
  • CORS_ORIGINS
  • EMBEDDINGS_MODEL (default all‑MiniLM‑L6‑v2)
  • EMBEDDINGSCACHEDIR (default .cache/embeddings)

Requisiti locali

  • Python 3.11, Node.js LTS, Docker, Git.

Qualità, a11y, sicurezza

  • Contrast AA/AAA; focus ring; aria‑label.
  • Minimizzazione dati: salviamo grafo/metadati, non il testo completo.
  • CORS ristretto in produzione; segreti solo in variabili d'ambiente.
  • Limiti ingestione: dimensione file, timeout URL, pagine PDF.

Deploy gratuito su Hugging Face Spaces

Questa repo è pronta per deploy su Hugging Face Spaces usando il Dockerfile incluso: il frontend viene buildato e copiato in backend/app/static/web; Uvicorn serve API + bundle sullo stesso dominio.

Passi rapidi:

  • Crea uno Space di tipo "Docker" e collega questo repository.
  • In Settings → Variables aggiungi (almeno):
  • ENV=production
  • LOG_LEVEL=info
  • JWT_SECRET=<stringa_lunga_casuale>
  • EMBEDDINGS_FAKE=1 (demo veloce; evita download modelli pesanti)
  • Opzionale (LLM lato server): LLM_PROVIDER=gemini, LLM_MODEL=gemini-2.5-flash, LLM_API_KEY=<chiave_rotata>
  • Il Dockerfile rispetta ${PORT} del provider e avvia Uvicorn.
  • Se UI e API stanno sullo stesso dominio (default), nessuna configurazione CORS è necessaria.
  • Nota DB: SQLite è effimero su Spaces; per persistenza usa un DB esterno e imposta DATABASE_URL.