Spaces:
Running

ArchLens / web /static /index.html
knnarin's picture
Update home screen stats and feature cards to reflect actual check counts
f6727f7
Raw History Blame Contribute Delete
110 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>ArchLens — Architecture Security & Cost Analyzer</title> <style> *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } html { scroll-behavior: smooth; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0d1224; color: #e2e8f0; min-height: 100vh; } /* NAV */ nav { padding: 16px 40px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: rgba(13,18,36,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid #1e2d4a; z-index: 100; } .nav-logo { font-size: 22px; font-weight: 900; letter-spacing: -1px; } .nav-logo .arch { color: #818cf8; } .nav-logo .lens { color: #a78bfa; } .nav-cta { padding: 9px 22px; background: linear-gradient(135deg, #3730a3, #5b21b6); color: #c7d2fe; border: none; border-radius: 99px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; box-shadow: 0 4px 14px rgba(55,48,163,0.4); transition: transform 0.2s, box-shadow 0.2s; } .nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(55,48,163,0.5); } /* HERO */ .hero-wrap { background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 40%, #1a0533 100%); padding: 80px 24px 100px; text-align: center; position: relative; overflow: hidden; } .hero-wrap::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); } .hero { max-width: 780px; margin: 0 auto; position: relative; } .hero-badge { display: inline-block; background: rgba(255,255,255,0.2); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 16px; border-radius: 99px; margin-bottom: 24px; letter-spacing: 1px; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.3); } .hero h1 { font-size: clamp(32px, 6vw, 58px); font-weight: 900; line-height: 1.1; letter-spacing: -1.5px; color: #fff; margin-bottom: 20px; } .hero h1 em { font-style: normal; color: #c4b5fd; } .hero p { font-size: 18px; color: rgba(255,255,255,0.85); line-height: 1.7; max-width: 560px; margin: 0 auto 36px; } .hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; } .btn-white { padding: 13px 28px; background: #ede9fe; color: #3730a3; border: none; border-radius: 99px; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,0.15); transition: transform 0.2s; } .btn-white:hover { transform: translateY(-2px); } .btn-outline-white { padding: 13px 28px; background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.6); border-radius: 99px; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; transition: background 0.2s, border-color 0.2s; } .btn-outline-white:hover { background: rgba(255,255,255,0.1); border-color: #fff; } /* PREVIEW CARD */ .preview-wrap { max-width: 780px; margin: -50px auto 60px; padding: 0 24px; } .preview-box { background: #131d35; border-radius: 16px; box-shadow: 0 20px 60px rgba(99,102,241,0.2), 0 4px 20px rgba(0,0,0,0.3); padding: 24px 28px; font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.9; border: 1px solid #1e2d4a; } .preview-header { font-family: -apple-system, sans-serif; font-size: 12px; color: #94a3b8; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; } .dot { width: 10px; height: 10px; border-radius: 50%; } .dot-r { background: #ef4444; } .dot-y { background: #f59e0b; } .dot-g { background: #22c55e; } .preview-box .crit { color: #ef4444; font-weight: 700; } .preview-box .high { color: #f97316; font-weight: 700; } .preview-box .med { color: #eab308; font-weight: 700; } .preview-box .sav { color: #10b981; font-weight: 700; } .preview-box .fix { color: #94a3b8; padding-left: 20px; font-size: 12px; display: block; margin-bottom: 6px; } /* STATS */ .stats-wrap { max-width: 780px; margin: 0 auto 70px; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .stat-card { background: #131d35; border-radius: 14px; padding: 24px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.2); border: 1px solid #1e2d4a; } .stat-num { font-size: 32px; font-weight: 900; letter-spacing: -1px; } .stat-num.purple { color: #a5b4fc; } .stat-num.orange { color: #fbbf24; } .stat-num.green { color: #6ee7b7; } .stat-label { font-size: 13px; color: #94a3b8; margin-top: 4px; } /* FEATURES */ .section { max-width: 900px; margin: 0 auto 70px; padding: 0 24px; } .section-label { text-align: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 10px; } .section-title { text-align: center; font-size: clamp(22px, 4vw, 34px); font-weight: 900; letter-spacing: -0.5px; color: #e2e8f0; margin-bottom: 40px; } .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; } .feature-card { border-radius: 16px; padding: 28px 24px; position: relative; overflow: hidden; } .feature-card.purple { background: linear-gradient(135deg, #1e1b4b, #2e1065); border: 1px solid #3730a3; color: #c4b5fd; } .feature-card.orange { background: linear-gradient(135deg, #1c1007, #2d1a00); border: 1px solid #78350f; color: #fcd34d; } .feature-card.teal { background: linear-gradient(135deg, #0c1a2e, #0d2137); border: 1px solid #0e4d6e; color: #7dd3fc; } .feature-card.green { background: linear-gradient(135deg, #052e16, #0a2e1f); border: 1px solid #065f46; color: #6ee7b7; } .feature-card.pink { background: linear-gradient(135deg, #1f0a2e, #2d0f40); border: 1px solid #6b21a8; color: #d8b4fe; } .feature-card.dark { background: linear-gradient(135deg, #0f172a, #1e293b); border: 1px solid #334155; color: #94a3b8; } .feature-icon { font-size: 28px; margin-bottom: 14px; } .feature-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; } .feature-card p { font-size: 13px; opacity: 0.88; line-height: 1.6; } /* HOW IT WORKS */ .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; } .step { background: #131d35; border-radius: 16px; padding: 28px 20px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.2); border: 1px solid #1e2d4a; } .step-num { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 900; margin: 0 auto 16px; } .step-num.s1 { background: #1e1b4b; color: #a5b4fc; } .step-num.s2 { background: #1c1007; color: #fbbf24; } .step-num.s3 { background: #052e16; color: #6ee7b7; } .step h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; color: #e2e8f0; } .step p { font-size: 13px; color: #94a3b8; line-height: 1.5; } /* INPUT CHIPS */ .chip-wrap { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; } .chip { display: flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 99px; font-size: 13px; font-weight: 600; border: 2px solid; } .chip.c1 { background: #1e1b4b; color: #a5b4fc; border-color: #3730a3; } .chip.c2 { background: #1c1007; color: #fbbf24; border-color: #78350f; } .chip.c3 { background: #052e16; color: #6ee7b7; border-color: #065f46; } .chip.c4 { background: #0c1a2e; color: #7dd3fc; border-color: #0e4d6e; } .chip.c5 { background: #1f0a2e; color: #d8b4fe; border-color: #6b21a8; } .chip.c6 { background: #0a2e1f; color: #86efac; border-color: #166534; } /* DIVIDER */ hr { border: none; border-top: 2px dashed #1e2d4a; max-width: 860px; margin: 0 auto 60px; } /* ANALYZER GUIDE */ .analyzer-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; margin-bottom: 14px; } @media (max-width: 720px) { .analyzer-guide { grid-template-columns: 1fr; } } .ag-item { display: flex; gap: 11px; align-items: flex-start; text-align: left; background: #0a1322; border: 1.5px solid #1e2d4a; border-radius: 12px; padding: 14px 16px; font-family: inherit; font-size: 12.5px; color: #94a3b8; line-height: 1.5; cursor: pointer; transition: border-color 0.15s, transform 0.15s; } .ag-item:hover { border-color: #4c1d95; transform: translateY(-2px); } .ag-emo { font-size: 20px; line-height: 1.2; } .ag-item strong { display: block; color: #dde8ff; font-size: 13.5px; margin-bottom: 3px; } .ag-foot { font-size: 12.5px; color: #4a6080; text-align: center; margin-bottom: 22px; line-height: 1.5; } /* ANALYZER */ .analyzer-section { max-width: 860px; margin: 0 auto; padding: 0 24px 80px; } .analyzer-section .section-title { text-align: left; margin-bottom: 24px; } .input-panel { background: #131d35; border: 2px solid #1e2d4a; border-radius: 16px; padding: 28px; margin-bottom: 28px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); } .tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; } .tab { padding: 9px 20px; border-radius: 99px; font-size: 13px; font-weight: 700; cursor: pointer; border: 2px solid #1e2d4a; background: transparent; color: #64748b; transition: all 0.15s; } .tab.active { background: #2e1065; color: #c4b5fd; border-color: #4c1d95; } .tab:hover:not(.active) { border-color: #4c1d95; color: #a5b4fc; } .tab-content { display: none; } .tab-content.active { display: block; } .drop-zone { border: 2px dashed #2d3f6b; border-radius: 12px; padding: 40px; text-align: center; cursor: pointer; background: #0d1a30; transition: all 0.2s; } .drop-zone:hover, .drop-zone.drag-over { border-color: #6366f1; background: #131d3d; } .drop-zone input[type="file"] { display: none; } .drop-zone .icon { font-size: 32px; margin-bottom: 10px; } .drop-zone p { font-size: 14px; color: #818cf8; } .drop-zone p strong { font-weight: 700; color: #a5b4fc; } .drop-zone .file-name { margin-top: 10px; font-size: 13px; color: #818cf8; font-weight: 700; } textarea { width: 100%; height: 160px; background: #0d1a30; border: 2px solid #1e2d4a; border-radius: 10px; color: #e2e8f0; font-size: 14px; padding: 14px; resize: vertical; font-family: inherit; line-height: 1.6; outline: none; transition: border-color 0.2s; } textarea:focus { border-color: #6366f1; } textarea::placeholder { color: #3d5080; } .analyze-btn { margin-top: 16px; width: 100%; padding: 14px; background: linear-gradient(135deg, #2e1065, #1e1b4b); color: #c4b5fd; border: 1px solid #4c1d95; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 20px rgba(46,16,101,0.5); transition: transform 0.2s, box-shadow 0.2s; } .analyze-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(46,16,101,0.7); color: #ddd6fe; } .analyze-btn:disabled { background: #1e2533; color: #4a5568; cursor: not-allowed; box-shadow: none; border-color: #1e2533; } .loader { display: none; text-align: center; padding: 40px; } .spinner { width: 38px; height: 38px; border: 4px solid #1e2d4a; border-top-color: #a5b4fc; border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 14px; } @keyframes spin { to { transform: rotate(360deg); } } .loader p { color: #64748b; font-size: 14px; font-weight: 500; } .error-box { display: none; background: #450a0a; border: 1px solid #991b1b; border-radius: 12px; padding: 16px 20px; color: #fca5a5; font-size: 14px; font-weight: 500; margin-bottom: 24px; } /* RESULTS */ .results { display: none; } .summary-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; } .summary-card { border-radius: 14px; padding: 20px 22px; box-shadow: 0 4px 14px rgba(0,0,0,0.08); } .summary-card.arch { background: linear-gradient(135deg, #1e1b4b, #2e1065); border: 1px solid #4c1d95; color: #c4b5fd; } .summary-card.sec { background: linear-gradient(135deg, #450a0a, #7f1d1d); border: 1px solid #991b1b; color: #fca5a5; } .summary-card.cost { background: linear-gradient(135deg, #052e16, #0a2e1f); border: 1px solid #065f46; color: #6ee7b7; } .summary-card .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; margin-bottom: 6px; } .summary-card .value { font-size: 28px; font-weight: 900; } .summary-card .card-sub { font-size: 12px; margin-top: 5px; opacity: 0.75; } .sev-pills { display: flex; gap: 5px; margin-top: 9px; flex-wrap: wrap; } .sev-pill { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; } .sev-pill.critical { background: #7f1d1d; color: #fca5a5; border: 1px solid #ef4444; } .sev-pill.high { background: #431407; color: #fdba74; border: 1px solid #f97316; } .sev-pill.medium { background: #422006; color: #fde68a; border: 1px solid #f59e0b; } .sev-pill.low { background: #1c1917; color: #d6d3d1; border: 1px solid #78716c; } .sev-pill.info { background: #0c1a2e; color: #93c5fd; border: 1px solid #3b82f6; } .card-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; } .card-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #312e81; color: #a5b4fc; border: 1px solid #4338ca; } .export-bar { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 24px; } .export-btn { display: flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 99px; font-size: 13px; font-weight: 700; cursor: pointer; border: 2px solid; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; } .export-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); } .export-btn.json { background: #1a1f40; color: #818cf8; border-color: #3730a3; } .export-btn.md { background: #0d2a1f; color: #34d399; border-color: #065f46; } .findings-section { margin-bottom: 28px; } .section-hdr { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; } .section-hdr .count { background: #1e2d4a; color: #94a3b8; font-size: 11px; padding: 2px 8px; border-radius: 99px; } .finding-card { background: #131d35; border: 2px solid #1e2d4a; border-left: 4px solid; border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); } .finding-card.critical { border-left-color: #ef4444; } .finding-card.high { border-left-color: #f97316; } .finding-card.medium { border-left-color: #eab308; } .finding-card.low { border-left-color: #3b82f6; } .finding-card.info { border-left-color: #94a3b8; } .finding-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; } .severity-pill { font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; } .severity-pill.critical { background: #450a0a; color: #fca5a5; } .severity-pill.high { background: #431407; color: #fdba74; } .severity-pill.medium { background: #422006; color: #fcd34d; } .severity-pill.low { background: #0c1a2e; color: #93c5fd; } .severity-pill.info { background: #1e2533; color: #94a3b8; } .finding-title { font-size: 14px; font-weight: 700; color: #e2e8f0; } .finding-component { font-size: 12px; color: #64748b; margin-bottom: 6px; } .finding-desc { font-size: 13px; color: #94a3b8; margin-bottom: 8px; line-height: 1.5; } .finding-rec { font-size: 13px; color: #a5b4fc; background: #1a1f40; border-radius: 8px; padding: 8px 12px; line-height: 1.5; } .finding-rec::before { content: 'Fix: '; font-weight: 700; } .finding-refs { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; } .finding-ref-link { font-size: 11px; font-weight: 700; color: #93c5fd; background: #0c1a2e; border: 1px solid #1e3050; border-radius: 99px; padding: 3px 10px; text-decoration: none; white-space: nowrap; } .finding-ref-link:hover { background: #142338; border-color: #2d4a73; } .savings-badge { margin-left: auto; font-size: 12px; font-weight: 800; color: #6ee7b7; background: #052e16; padding: 3px 10px; border-radius: 99px; white-space: nowrap; border: 1px solid #065f46; } /* BUILDER TAB */ .analyzer-section.builder-wide { max-width: 1100px; } .builder-intro { display:flex; align-items:center; gap:14px; background:#0a1628; border:1.5px solid #1e3050; border-radius:12px; padding:16px 20px; margin-bottom:20px; } .builder-intro-icon { font-size:28px; flex-shrink:0; } .builder-intro-title { font-size:15px; font-weight:800; color:#dde8ff; margin-bottom:3px; } .builder-intro-sub { font-size:13px; color:#6b85a8; line-height:1.5; } .builder-layout { display:flex; gap:18px; align-items:flex-start; } .builder-main { flex:1; min-width:0; } .builder-sidebar { width:270px; flex-shrink:0; display:flex; flex-direction:column; gap:14px; position:sticky; top:80px; } .stack-empty { font-size:13px; color:#3d5070; font-style:italic; } .analyze-note { font-size:12px; color:#4a6080; text-align:center; line-height:1.4; } .picker-controls { display:flex; flex-direction:column; gap:12px; margin-bottom:16px; } .service-search { width:100%; padding:11px 16px; background:#0d1a30; border:1.5px solid #1e2d4a; border-radius:10px; color:#e2e8f0; font-size:14px; outline:none; } .service-search:focus { border-color:#6366f1; } .service-search::placeholder { color:#4a6090; } .cat-tabs { display:flex; flex-wrap:wrap; gap:7px; } .cat-tab { padding:7px 16px; border-radius:99px; font-size:13px; font-weight:700; cursor:pointer; border:1.5px solid #1e2d4a; background:transparent; color:#64748b; transition:all 0.15s; } .cat-tab.active { background:#1e1b4b; color:#c4b5fd; border-color:#3730a3; } .cat-tab:hover:not(.active) { border-color:#4c1d95; color:#a5b4fc; } .service-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; max-height:320px; overflow-y:auto; padding-right:6px; margin-bottom:18px; scrollbar-width:thin; scrollbar-color:#1e2d4a transparent; } .service-card { background:#101e36; border:1.5px solid #1e3050; border-radius:12px; padding:14px 10px; cursor:pointer; text-align:center; transition:all 0.15s; user-select:none; position:relative; } .service-card:hover { border-color:#5b4fcf; background:#16254a; transform:translateY(-2px); box-shadow:0 4px 14px rgba(0,0,0,0.3); } .service-card.selected { border-color:#818cf8; background:#1e1d4a; box-shadow:0 0 0 2px rgba(129,140,248,0.2); } .service-card.selected::after { content:'✓'; position:absolute; top:6px; right:9px; font-size:11px; color:#a5b4fc; font-weight:900; } .svc-prov { font-size:10px; font-weight:800; text-transform:uppercase; padding:3px 7px; border-radius:99px; display:inline-block; margin-bottom:7px; letter-spacing:0.3px; } .prov-aws { background:#2a1a06; color:#fbbf24; } .prov-gcp { background:#062a14; color:#6ee7b7; } .prov-azure { background:#091f3a; color:#7dd3fc; } .prov-generic { background:#1a1d30; color:#a3b4cc; } .prov-nvidia { background:#1a2906; color:#76b900; } .svc-icon { font-size:20px; font-weight:900; color:#c4b5fd; margin:4px 0 6px; font-family:monospace; letter-spacing:-1px; } .svc-name { font-size:13px; font-weight:700; color:#dde8ff; line-height:1.3; } .stack-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; border-top:1px solid #1e2d4a; padding-top:16px; margin-bottom:14px; } .stack-label { font-size:12px; font-weight:800; color:#64748b; text-transform:uppercase; white-space:nowrap; letter-spacing:0.3px; } .stack-chips { display:flex; flex-wrap:wrap; gap:6px; flex:1; min-height:28px; } .stack-chip { display:flex; align-items:center; gap:5px; padding:5px 12px; border-radius:99px; font-size:12px; font-weight:700; background:#1e1b4b; color:#c4b5fd; border:1.5px solid #3730a3; cursor:pointer; } .stack-chip:hover { background:#2d1d6b; } .stack-chip-x { font-size:10px; color:#818cf8; } .continue-btn { padding:11px 24px; border-radius:99px; font-size:14px; font-weight:800; cursor:pointer; background:linear-gradient(135deg,#3730a3,#4c1d95); color:#ddd6fe; border:none; transition:transform 0.15s,opacity 0.15s,box-shadow 0.15s; white-space:nowrap; box-shadow:0 4px 16px rgba(55,48,163,0.4); } .continue-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 22px rgba(55,48,163,0.6); } .continue-btn:disabled { opacity:0.3; cursor:not-allowed; box-shadow:none; } .sugg-panel { background:#0a1322; border:1.5px solid #1e2d4a; border-radius:12px; padding:16px 18px; } .sugg-title { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; color:#64748b; margin-bottom:12px; } .sugg-item { display:flex; align-items:flex-start; gap:9px; font-size:13px; color:#94a3b8; margin-bottom:9px; line-height:1.5; } .sugg-item.warn { color:#fdba74; } .sugg-item.good { color:#6ee7b7; } .sugg-item.crit { color:#fca5a5; } .sugg-item.info { color:#93c5fd; } .sugg-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:4px; } .sugg-dot.warn { background:#f97316; } .sugg-dot.good { background:#34d399; } .sugg-dot.crit { background:#ef4444; } .sugg-dot.info { background:#60a5fa; } /* CANVAS (step 2) */ .canvas-header { display:flex; align-items:center; gap:9px; margin-bottom:12px; flex-wrap:wrap; } .mode-btn { padding:9px 18px; border-radius:99px; font-size:13px; font-weight:700; cursor:pointer; border:1.5px solid #1e2d4a; background:transparent; color:#64748b; transition:all 0.15s; } .mode-btn.active { background:#1e1b4b; color:#c4b5fd; border-color:#3730a3; } .mode-btn.danger { color:#f87171; border-color:#991b1b; } .mode-btn.danger:hover { background:#450a0a; color:#fca5a5; } .mode-btn:hover:not(.active):not(.danger) { border-color:#4c1d95; color:#a5b4fc; } .mode-hint { font-size:13px; color:#4a6080; margin-left:auto; font-style:italic; } .canvas-wrap { display:flex; gap:14px; align-items:flex-start; } .diagram-canvas { flex:1; position:relative; height:520px; min-width:0; background:#07101e; background-image: linear-gradient(rgba(99,102,241,0.06) 1px,transparent 1px), linear-gradient(90deg,rgba(99,102,241,0.06) 1px,transparent 1px); background-size:32px 32px; border:1.5px solid #1e2d4a; border-radius:14px; overflow:hidden; } .edge-layer { position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; overflow:visible; } .diagram-node { position:absolute; min-width:130px; background:#131d35; border:2px solid #253554; border-radius:10px; padding:10px 14px; user-select:none; z-index:10; transition:border-color 0.12s,box-shadow 0.12s; box-shadow:0 2px 8px rgba(0,0,0,0.4); } .diagram-node.connect-mode:hover { border-color:#6366f1; box-shadow:0 0 0 2px rgba(99,102,241,0.2); } .diagram-node.connect-source { border-color:#818cf8; box-shadow:0 0 0 4px rgba(129,140,248,0.3); } .node-badge { font-size:10px; font-weight:800; text-transform:uppercase; padding:3px 8px; border-radius:99px; display:inline-block; margin-bottom:5px; letter-spacing:0.3px; } .node-name { font-size:14px; font-weight:700; color:#e2e8f0; line-height:1.3; } .node-prov { font-size:11px; color:#64748b; margin-top:2px; text-transform:uppercase; letter-spacing:0.3px; } .nt-COMPUTE { background:#1e1b4b; color:#a5b4fc; } .nt-DATABASE { background:#0e4d6e; color:#7dd3fc; } .nt-STORAGE { background:#2a1800; color:#fbbf24; } .nt-SERVERLESS { background:#2d0a4e; color:#d8b4fe; } .nt-CONTAINER { background:#0a2e1f; color:#6ee7b7; } .nt-NETWORK { background:#0c2a1a; color:#86efac; } .nt-IAM { background:#3d1a00; color:#fdba74; } .nt-MONITORING { background:#221f00; color:#fde047; } .nt-QUEUE { background:#1a0a2e; color:#c4b5fd; } .nt-CACHE { background:#2a0808; color:#fca5a5; } .nt-CDN { background:#002828; color:#5eead4; } .nt-GATEWAY { background:#221800; color:#fcd34d; } .nt-OTHER { background:#1a1e28; color:#94a3b8; } .canvas-sugg { width:240px; flex-shrink:0; background:#0a1322; border:1.5px solid #1e2d4a; border-radius:14px; padding:16px 18px; max-height:520px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#1e2d4a transparent; } .canvas-footer { display:flex; justify-content:space-between; align-items:center; margin-top:16px; } .back-btn { padding:10px 22px; border-radius:99px; font-size:13px; font-weight:700; cursor:pointer; border:1.5px solid #1e2d4a; background:transparent; color:#64748b; transition:all 0.15s; } .back-btn:hover { border-color:#4c1d95; color:#a5b4fc; } .builder-analyze-btn { padding:13px 32px; border-radius:99px; font-size:14px; font-weight:800; cursor:pointer; background:linear-gradient(135deg,#2e1065,#1e1b4b); color:#ddd6fe; border:1px solid #4c1d95; box-shadow:0 4px 20px rgba(46,16,101,0.5); transition:transform 0.15s,box-shadow 0.15s; } .builder-analyze-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 28px rgba(46,16,101,0.7); } .builder-analyze-btn:disabled { opacity:0.35; cursor:not-allowed; box-shadow:none; } /* RECOMMEND TAB */ .rec-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-bottom:18px; } .rec-field { display:flex; flex-direction:column; gap:6px; } .rec-field label { font-size:12px; font-weight:800; color:#64748b; text-transform:uppercase; letter-spacing:0.3px; } .rec-select, .rec-multiselect { width:100%; padding:10px 14px; background:#0d1a30; border:1.5px solid #1e2d4a; border-radius:10px; color:#e2e8f0; font-size:14px; outline:none; font-family:inherit; } .rec-select:focus, .rec-multiselect:focus { border-color:#6366f1; } .rec-multiselect { height:150px; } .rec-multiselect optgroup { color:#64748b; font-weight:800; font-style:normal; } .rec-multiselect option { color:#dde8ff; padding:3px 0; } .rec-field-wide { grid-column:1/-1; } .rec-checkbox-row { display:flex; align-items:center; gap:8px; grid-column:1/-1; } .rec-checkbox-row input { width:16px; height:16px; accent-color:#6366f1; } .rec-checkbox-row label { font-size:13px; color:#94a3b8; font-weight:600; text-transform:none; letter-spacing:normal; } .rec-submit-btn { padding:13px 32px; border-radius:99px; font-size:14px; font-weight:800; cursor:pointer; background:linear-gradient(135deg,#3730a3,#4c1d95); color:#ddd6fe; border:none; box-shadow:0 4px 16px rgba(55,48,163,0.4); transition:transform 0.15s,box-shadow 0.15s; } .rec-submit-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 22px rgba(55,48,163,0.6); } .rec-submit-btn:disabled { opacity:0.4; cursor:not-allowed; } .rec-result { margin-top:22px; border-top:1px solid #1e2d4a; padding-top:18px; } .rec-summary { background:#0a1628; border:1.5px solid #1e3050; border-radius:12px; padding:14px 18px; font-size:13px; color:#cbd5e1; line-height:1.6; margin-bottom:16px; } .rec-list-title, .rec-tips-title { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; color:#64748b; margin:16px 0 10px; } .rec-item { display:flex; gap:12px; align-items:flex-start; padding:10px 0; border-bottom:1px solid #16213b; } .rec-item:last-child { border-bottom:none; } .rec-item-name { display:flex; flex-direction:column; gap:3px; min-width:180px; flex-shrink:0; font-size:13px; font-weight:700; color:#dde8ff; } .rec-item-why { font-size:13px; color:#94a3b8; line-height:1.5; padding-top:1px; } .rec-role { font-size:10px; font-weight:800; color:#64748b; text-transform:uppercase; letter-spacing:0.3px; } .rec-tips { font-size:13px; color:#94a3b8; line-height:1.6; padding-left:18px; margin:0; } .rec-tips li { margin-bottom:6px; } .rec-use-btn { margin-top:18px; } .warn-banner { background:#422006; border:1px solid #92400e; border-radius:10px; padding:12px 16px; color:#fcd34d; font-size:13px; font-weight:600; margin-bottom:20px; } .text-hint { font-size:12px; margin-top:8px; min-height:18px; font-weight:600; } .text-hint.bad { color:#f87171; } .text-hint.good { color:#34d399; } /* FOOTER */ footer { background: #1e293b; color: #94a3b8; padding: 28px 40px; text-align: center; font-size: 13px; } footer a { color: #818cf8; text-decoration: none; font-weight: 600; } footer a:hover { color: #a5b4fc; } /* MOBILE */ @media (max-width: 860px) { .builder-layout { flex-direction: column; } .builder-sidebar { width: 100%; position: static; top: auto; } } @media (max-width: 640px) { nav { padding: 14px 18px; } .nav-logo { font-size: 19px; } .nav-cta { padding: 8px 16px; font-size: 13px; } footer { padding: 24px 18px; } .stats-wrap { gap: 8px; padding: 0 16px; } .stat-card { padding: 14px 6px; } .stat-num { font-size: 22px; } .stat-label { font-size: 10.5px; } .tab { padding: 8px 14px; font-size: 12px; } .summary-bar { grid-template-columns: 1fr; } .summary-card .value { font-size: 22px; word-break: break-word; } } </style> </head> <body> <!-- NAV --> <nav> <div class="nav-logo"><span class="arch">Arch</span><span class="lens">Lens</span></div> <a class="nav-cta" href="#analyzer">Analyze Now</a> </nav> <!-- HERO --> <div class="hero-wrap"> <div class="hero"> <div class="hero-badge">Free &amp; Open Source</div> <h1>Spot security risks &amp;<br><em>cut cloud costs</em> instantly</h1> <p>Upload Terraform, Kubernetes YAML, Helm, Docker Compose, Dockerfile, Serverless, OpenAPI, GitHub Actions, Ansible, CloudFormation, ARM, draw.io, AWS Config, GCP Asset Inventory — or describe in plain English. 59+ security checks and 15+ cost optimisations, including AI/ML workload analysis.</p> <div class="hero-actions"> <a class="btn-white" href="#analyzer">Start Analyzing</a> <a class="btn-outline-white" href="https://github.com/narin-kura/ArchLens" target="_blank">View on GitHub</a> </div> </div> </div> <!-- PREVIEW --> <div class="preview-wrap"> <div class="preview-box"> <div class="preview-header"> <div class="dot dot-r"></div><div class="dot dot-y"></div><div class="dot dot-g"></div> &nbsp; ArchLens Report &mdash; my-startup-aws </div> <span class="crit">[CRIT] S3 bucket 'assets' is publicly accessible <em style="color:#64748b;font-size:11px;">terraform</em></span> <span class="fix">Fix: Set bucket ACL to private. Use pre-signed URLs for public content.</span> <span class="crit">[CRIT] Deployment 'api' runs a privileged container <em style="color:#64748b;font-size:11px;">kubernetes</em></span> <span class="fix">Fix: Remove privileged: true. Use specific capabilities instead.</span> <span class="high">[HIGH] LLM API keys may not be managed securely <em style="color:#64748b;font-size:11px;">ai stack</em></span> <span class="fix">Fix: Store API keys in Secrets Manager. Use IAM roles — not hardcoded env vars.</span> <span class="high">[HIGH] Workflow 'deploy.yml' has unpinned third-party actions <em style="color:#64748b;font-size:11px;">github actions</em></span> <span class="fix">Fix: Pin actions to a full commit SHA (e.g. uses: org/action@a1b2c3d).</span> <span class="sav"> [COST] GPU/ML compute — use Spot instances for training <em style="color:#64748b;font-size:11px;">ai stack</em></span> <span class="fix">Fix: AWS Spot saves up to 90%. Checkpoint every epoch to resume on interruption.</span> <span class="sav"> [COST] RDS db.r5.2xlarge may be oversized &mdash; est. -$687/mo <em style="color:#64748b;font-size:11px;">terraform</em></span> <span class="fix">Fix: Switch to db.r5.large after reviewing CloudWatch metrics.</span> </div> </div> <!-- STATS --> <div class="stats-wrap"> <div class="stat-card"> <div class="stat-num purple">59+</div> <div class="stat-label">Security checks</div> </div> <div class="stat-card"> <div class="stat-num orange">15+</div> <div class="stat-label">Cost optimizations</div> </div> <div class="stat-card"> <div class="stat-num green">15+</div> <div class="stat-label">Input formats supported</div> </div> </div> <!-- FEATURES --> <section class="section"> <div class="section-label">What it does</div> <div class="section-title">Everything you need to review your architecture</div> <div class="feature-grid"> <div class="feature-card purple"> <div class="feature-icon">&#128274;</div> <h3>Security Analysis</h3> <p>59+ checks across cloud infra, Kubernetes, CI/CD pipelines, and AI stacks — public buckets, unencrypted data, overpermissive IAM, privileged containers, missing NetworkPolicies, exposed LLM endpoints, and more.</p> </div> <div class="feature-card orange"> <div class="feature-icon">&#128176;</div> <h3>Cost Optimization</h3> <p>15+ optimisations: oversized RDS, GPU spot instances for AI training, LLM API caching, SageMaker serverless rightsizing, NAT Gateway vs VPC endpoints, Reserved Instance savings, and more.</p> </div> <div class="feature-card teal"> <div class="feature-icon">&#129302;</div> <h3>AI/ML Architecture Analysis</h3> <p>Detects your AI workload type — RAG pipeline, fine-tuning, real-time inference, batch processing, MLOps — and fires targeted findings: GPU cost, LLM key security, vector DB auth, semantic caching, and training/serving skew.</p> </div> <div class="feature-card green"> <div class="feature-icon">&#128196;</div> <h3>Multi-Format Input</h3> <p>15 parsers: Terraform, Kubernetes YAML, Helm charts, Docker Compose, Dockerfile, Azure ARM, CloudFormation, Serverless Framework, OpenAPI/Swagger, GitHub Actions, Ansible, AWS Config, GCP Asset Inventory, draw.io, and plain English.</p> </div> <div class="feature-card pink"> <div class="feature-icon">&#128270;</div> <h3>Actionable Findings</h3> <p>Every finding includes a clear fix recommendation and estimated monthly savings — not just a list of problems.</p> </div> <div class="feature-card dark"> <div class="feature-icon">&#128196;</div> <h3>Export Reports</h3> <p>Download findings as JSON or Markdown to share with your team or include in architecture review docs.</p> </div> </div> </section> <!-- HOW IT WORKS --> <section class="section"> <div class="section-label">How it works</div> <div class="section-title">Three steps to a safer, cheaper stack</div> <div class="steps"> <div class="step"> <div class="step-num s1">1</div> <h3>Provide your architecture</h3> <p>Upload any of 15 supported formats — Terraform, Kubernetes, Helm, Docker, Serverless, OpenAPI, Ansible, ARM and more — or describe in plain English</p> </div> <div class="step"> <div class="step-num s2">2</div> <h3>AI analyzes it</h3> <p>Runs 77+ security rules and cost checks across cloud infra, Kubernetes, containers, IAM, networking, CI/CD, and APIs</p> </div> <div class="step"> <div class="step-num s3">3</div> <h3>Get actionable findings</h3> <p>See exactly what to fix and how much you could save per month</p> </div> </div> </section> <!-- INPUT TYPES --> <section class="section"> <div class="section-label">Supported inputs</div> <div class="section-title">Works with what you already have</div> <div class="chip-wrap"> <div class="chip c1">&#128196; Terraform (.tf)</div> <div class="chip c2">&#9729; CloudFormation</div> <div class="chip c3">&#128172; Plain English</div> <div class="chip c4">&#128065; draw.io diagram</div> <div class="chip c5">&#9729; AWS Config export</div> <div class="chip c6">&#9729; GCP Asset Inventory</div> <div class="chip c5">&#9096; Kubernetes YAML</div> <div class="chip c2">&#128679; Helm Chart</div> <div class="chip c3">&#128011; Docker Compose</div> <div class="chip c4">&#128011; Dockerfile</div> <div class="chip c6">&#9729; Azure ARM</div> <div class="chip c1">&#128196; Serverless Framework</div> <div class="chip c2">&#128196; OpenAPI / Swagger</div> <div class="chip c3">&#9881; GitHub Actions</div> <div class="chip c4">&#9881; Ansible Playbook</div> <div class="chip c1">&#9999; Interactive Builder</div> </div> </section> <hr /> <!-- ANALYZER --> <section class="analyzer-section" id="analyzer"> <div class="section-title">Analyze your architecture</div> <div class="analyzer-guide"> <button type="button" class="ag-item" onclick="switchTab('file')"> <span class="ag-emo">&#128194;</span> <div><strong>Upload File</strong>Drop Terraform, Kubernetes, Docker, CloudFormation or any of the 15 supported formats.</div> </button> <button type="button" class="ag-item" onclick="switchTab('text')"> <span class="ag-emo">&#128172;</span> <div><strong>Describe in Text</strong>No config handy? Write a plain-English description and AI extracts the components.</div> </button> <button type="button" class="ag-item" onclick="switchTab('builder')"> <span class="ag-emo">&#129521;</span> <div><strong>Build your stack</strong>Pick services from a catalog and watch live security &amp; cost suggestions as you go.</div> </button> <button type="button" class="ag-item" onclick="switchTab('recommend')"> <span class="ag-emo">&#10024;</span> <div><strong>Recommend My Stack</strong>Answer a few questions and get a cost-optimized, secure stack picked for you.</div> </button> </div> <p class="ag-foot">Whichever way you start, you get the same report below — security findings with fixes, estimated monthly savings, and JSON / Markdown export.</p> <div class="input-panel"> <div class="tabs"> <button class="tab active" data-tab="file" onclick="switchTab('file')">Upload File</button> <button class="tab" data-tab="text" onclick="switchTab('text')">Describe in Text</button> <button class="tab" data-tab="builder" onclick="switchTab('builder')">No file? Add your stack</button> <button class="tab" data-tab="recommend" onclick="switchTab('recommend')">Recommend My Stack</button> </div> <div id="tab-file" class="tab-content active"> <div class="drop-zone" id="dropZone" onclick="document.getElementById('fileInput').click()"> <input type="file" id="fileInput" accept=".tf,.json,.yaml,.yml,.xml,.drawio,.txt,.md,.dockerfile" onchange="onFileSelect(this)" /> <div class="icon">&#128194;</div> <p><strong>Click to upload</strong> or drag &amp; drop</p> <p>Terraform &nbsp;&#183;&nbsp; Kubernetes YAML &nbsp;&#183;&nbsp; Helm &nbsp;&#183;&nbsp; Docker Compose &nbsp;&#183;&nbsp; Dockerfile &nbsp;&#183;&nbsp; Azure ARM &nbsp;&#183;&nbsp; CloudFormation &nbsp;&#183;&nbsp; Serverless Framework &nbsp;&#183;&nbsp; OpenAPI/Swagger &nbsp;&#183;&nbsp; GitHub Actions &nbsp;&#183;&nbsp; Ansible &nbsp;&#183;&nbsp; draw.io &nbsp;&#183;&nbsp; Text</p> <div class="file-name" id="fileName"></div> </div> </div> <div id="tab-text" class="tab-content"> <textarea id="textInput" placeholder="Describe your cloud infrastructure — services, databases, tools...&#10;&#10;Example: We run a Node.js API on AWS EC2, a PostgreSQL RDS database with no encryption, an S3 bucket for file uploads, Jenkins for CI/CD, and no monitoring configured." oninput="validateTextInput(this)"></textarea> <div class="text-hint" id="textHint"></div> </div> <!-- BUILDER TAB --> <div id="tab-builder" class="tab-content"> <div class="builder-intro"> <div class="builder-intro-icon">&#128270;</div> <div> <div class="builder-intro-title">Don't have a file to upload?</div> <div class="builder-intro-sub">Pick the services in your stack — security &amp; cost suggestions appear live as you go.</div> </div> </div> <div class="builder-layout"> <!-- Left: search + grid --> <div class="builder-main"> <input class="service-search" id="serviceSearch" type="text" placeholder="Search — EC2, RDS, Jenkins, Vault..." oninput="renderServiceGrid()"> <div class="cat-tabs" style="margin:12px 0 14px;"> <button class="cat-tab active" data-cat="all" onclick="setCat(this)">All</button> <button class="cat-tab" data-cat="aws" onclick="setCat(this)">AWS</button> <button class="cat-tab" data-cat="gcp" onclick="setCat(this)">GCP</button> <button class="cat-tab" data-cat="azure" onclick="setCat(this)">Azure</button> <button class="cat-tab" data-cat="data" onclick="setCat(this)">Data</button> <button class="cat-tab" data-cat="gpu" onclick="setCat(this)">GPU / NVIDIA</button> <button class="cat-tab" data-cat="cicd" onclick="setCat(this)">CI/CD</button> <button class="cat-tab" data-cat="monitoring" onclick="setCat(this)">Monitoring</button> <button class="cat-tab" data-cat="security" onclick="setCat(this)">Security</button> <button class="cat-tab" data-cat="ai" onclick="setCat(this)">AI / ML</button> <button class="cat-tab" data-cat="embedded" onclick="setCat(this)">Hardware / IoT</button> </div> <div class="service-grid" id="serviceGrid"></div> <div class="stack-row"> <span class="stack-label">Your stack:</span> <div class="stack-chips" id="stackChips"> <span class="stack-empty">Click services above to add them</span> </div> </div> </div> <!-- Right: live suggestions + analyze --> <div class="builder-sidebar"> <div class="sugg-panel" style="flex:1;"> <div class="sugg-title">&#128161; Live Suggestions</div> <div id="suggList"><div class="sugg-item info"><div class="sugg-dot info"></div><span>Pick services to see instant recommendations</span></div></div> </div> <button class="builder-analyze-btn" id="builderAnalyzeBtn" onclick="runBuilderAnalysis()" disabled> Analyze My Stack &#8594; </button> <div class="analyze-note">Runs full security &amp; cost analysis on your selections</div> </div> </div> </div> <!-- /BUILDER TAB --> <!-- RECOMMEND TAB --> <div id="tab-recommend" class="tab-content"> <div class="builder-intro"> <div class="builder-intro-icon">&#10024;</div> <div> <div class="builder-intro-title">Not sure where to start?</div> <div class="builder-intro-sub">Answer a few questions and we'll pick a cost-optimized, secure starter stack from the catalog — you can tweak it before analyzing.</div> </div> </div> <div class="rec-form"> <div class="rec-field"> <label for="recProjectType">What are you building?</label> <select class="rec-select" id="recProjectType"> <option value="web_api">Web app / API backend</option> <option value="microservices">Microservices platform</option> <option value="data_pipeline">Data pipeline / analytics</option> <option value="ai_llm">AI / LLM application</option> <option value="mobile_backend">Mobile app backend</option> <option value="iot_embedded">IoT / embedded system</option> </select> </div> <div class="rec-field"> <label for="recScale">Expected scale</label> <select class="rec-select" id="recScale"> <option value="startup">Startup / MVP — low traffic</option> <option value="growth">Growth — moderate traffic</option> <option value="enterprise">Enterprise — high scale</option> </select> </div> <div class="rec-field"> <label for="recCloud">Preferred cloud</label> <select class="rec-select" id="recCloud"> <option value="generic">No preference / self-hosted</option> <option value="aws">AWS</option> <option value="gcp">GCP</option> <option value="azure">Azure</option> </select> </div> <div class="rec-field"> <label for="recPriority">Optimize for</label> <select class="rec-select" id="recPriority"> <option value="cost">Lowest cost</option> <option value="balanced" selected>Balanced</option> <option value="performance">Best performance &amp; scale</option> </select> </div> <div class="rec-field"> <label for="recDatabase">Database needs</label> <select class="rec-select" id="recDatabase"> <option value="relational">Relational (SQL)</option> <option value="nosql">NoSQL / document</option> <option value="analytics">Analytics / data warehouse</option> <option value="none">None</option> </select> </div> <div class="rec-field"> <label for="recAiNeeds">AI / ML needs</label> <select class="rec-select" id="recAiNeeds"> <option value="none">None</option> <option value="llm_api">LLM API — chatbot / RAG</option> <option value="custom_ml">Custom ML training</option> <option value="gpu_inference">Self-hosted LLM / GPU inference</option> </select> </div> <div class="rec-field"> <label for="recSecurityLevel">Security level</label> <select class="rec-select" id="recSecurityLevel"> <option value="basic">Basic</option> <option value="standard" selected>Standard (recommended)</option> <option value="high">High — regulated / compliance</option> </select> </div> <div class="rec-checkbox-row"> <input type="checkbox" id="recRealtime" /> <label for="recRealtime">Needs async / event-driven processing (queues, streaming)</label> </div> <div class="rec-field rec-field-wide"> <label for="recMustHaves">Already know some services you want to use? (optional, ctrl/cmd-click for multiple)</label> <select class="rec-multiselect" id="recMustHaves" multiple></select> </div> </div> <button class="rec-submit-btn" id="recSubmitBtn" onclick="getRecommendation()">Get My Recommendation &#8594;</button> <div class="rec-result" id="recResult" style="display:none;"> <div class="rec-summary" id="recSummary"></div> <div class="rec-list-title">Recommended Stack</div> <div id="recList"></div> <div class="rec-tips-title">Cost Tips</div> <ul class="rec-tips" id="recCostTips"></ul> <div class="rec-tips-title">Security Tips</div> <ul class="rec-tips" id="recSecurityTips"></ul> <button class="builder-analyze-btn rec-use-btn" onclick="useRecommendation()">Use This Stack &#8594;</button> </div> </div> <!-- /RECOMMEND TAB --> <button class="analyze-btn" id="analyzeBtn" onclick="runAnalysis()">Analyze Architecture</button> </div> <div class="loader" id="loader"> <div class="spinner"></div> <p>Analyzing your architecture...</p> </div> <div class="error-box" id="errorBox"></div> <div class="results" id="results"> <div class="summary-bar"> <div class="summary-card arch"> <div class="label">Architecture</div> <div class="value" id="archName" style="font-size:15px; margin-top:6px;"></div> <div class="card-sub" id="compCount"></div> <div class="card-tags" id="workloadTags"></div> </div> <div class="summary-card sec"> <div class="label">Security Findings</div> <div class="value" id="secCount">0</div> <div class="sev-pills" id="sevPills"></div> </div> <div class="summary-card cost"> <div class="label">Cost Optimizations</div> <div class="value" id="costCount">0</div> <div class="card-sub" id="costSavings"></div> </div> </div> <div class="warn-banner" id="warnBanner" style="display:none;"> &#9888; No components were detected in your input. The file may be empty, unsupported, or in an unexpected format. </div> <div class="export-bar"> <button class="export-btn json" onclick="downloadReport('json')">&#8595; JSON</button> <button class="export-btn md" onclick="downloadReport('markdown')">&#8595; Markdown</button> </div> <div class="findings-section"> <div class="section-hdr">Security Findings <span class="count" id="secCountBadge">0</span></div> <div id="secFindings"></div> </div> <div class="findings-section"> <div class="section-hdr">Cost Optimizations <span class="count" id="costCountBadge">0</span></div> <div id="costFindings"></div> </div> </div> </section> <footer> <strong>ArchLens</strong> &mdash; <a href="https://github.com/narin-kura/ArchLens" target="_blank">GitHub</a> &nbsp;|&nbsp; <a href="https://huggingface.co/spaces/knnarin/ArchLens" target="_blank">Hugging Face</a> <br/> <span style="font-size:.75rem;opacity:.65"> © 2026 <a href="https://github.com/narin-kura" target="_blank" rel="noopener" style="color:#818cf8">K.N.Narin</a> &nbsp;·&nbsp; Non-commercial use only &nbsp;·&nbsp; Commercial licensing: <a href="https://github.com/narin-kura" target="_blank" rel="noopener" style="color:#818cf8">contact via GitHub</a><br/> For informational purposes only — not a substitute for a professional security audit. See LICENSE for full terms. </span> </footer> <script> const ARCH_KEYWORDS = [ 'aws','gcp','azure','amazon','ec2','lambda','rds','s3','ecs','eks','fargate', 'docker','kubernetes','k8s','container','server','instance','database','db', 'mysql','postgres','mongodb','dynamodb','redis','elasticsearch','aurora', 'storage','bucket','blob','vpc','subnet','load balancer','alb','elb','nginx', 'api gateway','cdn','cloudfront','firewall','nat','queue','kafka','rabbitmq', 'sqs','sns','pubsub','terraform','ansible','jenkins','ci/cd','pipeline','deploy', 'cloudwatch','datadog','grafana','prometheus','monitoring','microservice','api', 'backend','frontend','infrastructure','service','endpoint','application','iam', 'security group','cache','serverless','cloud run','cloud sql','spanner','gke', 'compute engine','github actions','gitlab','helm', 'llm','openai','anthropic','gemini','gpt','claude','bedrock','vertex ai','sagemaker', 'machine learning','embedding','vector database','vector db','pinecone','weaviate', 'chroma','qdrant','langchain','llamaindex','rag','inference','training','hugging face', 'ollama','mlflow','wandb','triton','ai model','language model','generative ai','chatbot', ]; function looksLikeArchitecture(text) { const lower = text.toLowerCase(); const words = lower.trim().split(/\s+/); if (words.length < 5) return false; return ARCH_KEYWORDS.some(kw => lower.includes(kw)); } function validateTextInput(el) { const hint = document.getElementById('textHint'); const val = el.value.trim(); if (!val) { hint.textContent = ''; hint.className = 'text-hint'; return; } if (looksLikeArchitecture(val)) { hint.textContent = 'Looks good — ready to analyze.'; hint.className = 'text-hint good'; } else { hint.textContent = 'Please describe your infrastructure (services, databases, tools). General questions are not supported.'; hint.className = 'text-hint bad'; } } let selectedFile = null; let activeTab = 'file'; function switchTab(tab) { activeTab = tab; document.querySelectorAll('.tab').forEach(t => t.classList.toggle('active', t.dataset.tab === tab)); ['file','text','builder','recommend'].forEach(id => { document.getElementById('tab-' + id).classList.toggle('active', id === tab); }); const analyzeBtn = document.getElementById('analyzeBtn'); analyzeBtn.style.display = (tab === 'builder' || tab === 'recommend') ? 'none' : 'block'; document.querySelector('.analyzer-section').classList.toggle('builder-wide', tab === 'builder'); if (tab === 'builder') renderServiceGrid(); if (tab === 'recommend') populateMustHaves(); } function onFileSelect(input) { selectedFile = input.files[0]; document.getElementById('fileName').textContent = selectedFile ? selectedFile.name : ''; } const dz = document.getElementById('dropZone'); dz.addEventListener('dragover', e => { e.preventDefault(); dz.classList.add('drag-over'); }); dz.addEventListener('dragleave', () => dz.classList.remove('drag-over')); dz.addEventListener('drop', e => { e.preventDefault(); dz.classList.remove('drag-over'); const f = e.dataTransfer.files[0]; if (f) { selectedFile = f; document.getElementById('fileName').textContent = f.name; } }); async function runAnalysis() { const btn = document.getElementById('analyzeBtn'); const loader = document.getElementById('loader'); const results = document.getElementById('results'); const errorBox = document.getElementById('errorBox'); errorBox.style.display = 'none'; results.style.display = 'none'; loader.style.display = 'block'; btn.disabled = true; try { const form = new FormData(); if (activeTab === 'file' && selectedFile) { form.append('file', selectedFile); } else { const text = document.getElementById('textInput').value.trim(); if (!text) throw new Error('Please enter an architecture description.'); if (!looksLikeArchitecture(text)) throw new Error('Please describe your cloud infrastructure — include services, databases, or tools. General questions are not supported.'); form.append('text', text); form.append('format_hint', 'text'); } const res = await fetch('/analyze', { method: 'POST', body: form }); const data = await res.json(); if (!res.ok) throw new Error(data.detail || 'Analysis failed'); renderResults(data); } catch (err) { errorBox.textContent = err.message; errorBox.style.display = 'block'; } finally { loader.style.display = 'none'; btn.disabled = false; } } function renderResults(data) { lastReport = data; document.getElementById('archName').textContent = data.architecture; // Security card document.getElementById('secCount').textContent = data.summary.security_count; document.getElementById('secCountBadge').textContent = data.summary.security_count; // Severity breakdown pills const sec = data.findings.filter(f => f.type === 'security'); const sevOrder = ['critical','high','medium','low','info']; const sevCounts = {}; for (const f of sec) sevCounts[f.severity] = (sevCounts[f.severity] || 0) + 1; document.getElementById('sevPills').innerHTML = sevOrder .filter(s => sevCounts[s]) .map(s => `<span class="sev-pill ${s}">${sevCounts[s]} ${s}</span>`) .join(''); // Cost card — count + savings document.getElementById('costCount').textContent = data.summary.cost_count; document.getElementById('costCountBadge').textContent = data.summary.cost_count; const savings = data.summary.estimated_savings; document.getElementById('costSavings').textContent = savings > 0 ? '$' + Math.round(savings) + '/mo potential savings' : 'No savings estimated'; // Architecture card — components + workload tags const n = data.components_found || 0; document.getElementById('compCount').textContent = n + ' component' + (n === 1 ? '' : 's') + ' detected'; const allText = data.findings.map(f => f.title + ' ' + (f.description || '')).join(' '); const workloadMap = [ ['RAG', /rag pipeline|retrieval/i], ['Fine-tuning',/fine.tuning|training workload/i], ['Inference', /inference endpoint|model serving/i], ['Batch AI', /batch inference/i], ['MLOps', /mlops|experiment tracking|feature store/i], ['Managed AI', /single llm provider|managed.*llm/i], ]; const tags = workloadMap.filter(([,re]) => re.test(allText)).map(([label]) => label); document.getElementById('workloadTags').innerHTML = tags.map(t => `<span class="card-tag">\u{1F916} ${t}</span>`).join(''); const warn = document.getElementById('warnBanner'); warn.style.display = n === 0 ? 'block' : 'none'; const secEl = document.getElementById('secFindings'); const costEl = document.getElementById('costFindings'); secEl.innerHTML = ''; costEl.innerHTML = ''; const cost = data.findings.filter(f => f.type === 'cost'); const order = ['critical','high','medium','low','info']; sec.sort((a,b) => order.indexOf(a.severity) - order.indexOf(b.severity)); sec.forEach(f => secEl.appendChild(findingCard(f))); cost.forEach(f => costEl.appendChild(findingCard(f))); if (!sec.length) secEl.innerHTML = '<div style="text-align:center;padding:28px;color:#94a3b8;font-size:14px;font-weight:500;">No security issues found</div>'; if (!cost.length) costEl.innerHTML = '<div style="text-align:center;padding:28px;color:#94a3b8;font-size:14px;font-weight:500;">No cost issues found</div>'; document.getElementById('results').style.display = 'block'; document.getElementById('results').scrollIntoView({ behavior: 'smooth' }); } let lastReport = null; function downloadReport(format) { if (!lastReport) return; let content, filename, mime; if (format === 'json') { content = JSON.stringify(lastReport, null, 2); filename = `archlens-report-${lastReport.architecture}.json`; mime = 'application/json'; } else { content = toMarkdown(lastReport); filename = `archlens-report-${lastReport.architecture}.md`; mime = 'text/markdown'; } const blob = new Blob([content], { type: mime }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = filename; a.click(); URL.revokeObjectURL(url); } function toMarkdown(data) { const lines = []; lines.push(`# ArchLens Report — ${data.architecture}\n`); lines.push(`**Security findings:** ${data.summary.security_count} `); lines.push(`**Cost findings:** ${data.summary.cost_count} `); if (data.summary.estimated_savings > 0) lines.push(`**Estimated savings:** $${Math.round(data.summary.estimated_savings)}/mo\n`); const sec = data.findings.filter(f => f.type === 'security'); const cost = data.findings.filter(f => f.type === 'cost'); if (sec.length) { lines.push(`\n## Security Findings\n`); sec.forEach(f => { lines.push(`### [${f.severity.toUpperCase()}] ${f.title}`); if (f.component) lines.push(`**Component:** ${f.component} `); lines.push(`\n${f.description}\n`); if (f.recommendation) lines.push(`**Fix:** ${f.recommendation}\n`); if (f.references && f.references.length) { lines.push(`**References:**`); f.references.forEach(ref => lines.push(`- ${ref}`)); lines.push(''); } }); } if (cost.length) { lines.push(`\n## Cost Optimizations\n`); cost.forEach(f => { lines.push(`### ${f.title}${f.estimated_savings > 0 ? ` (-$${Math.round(f.estimated_savings)}/mo)` : ''}`); lines.push(`\n${f.description}\n`); if (f.recommendation) lines.push(`**Fix:** ${f.recommendation}\n`); if (f.references && f.references.length) { lines.push(`**References:**`); f.references.forEach(ref => lines.push(`- ${ref}`)); lines.push(''); } }); } lines.push(`\n---\n_Generated by [ArchLens](https://knnarin-archlens.hf.space)_`); return lines.join('\n'); } // ===================== INTERACTIVE BUILDER ===================== const SERVICES = [ // AWS {id:'aws_ec2', name:'EC2', provider:'aws', cat:'aws', type:'COMPUTE', service:'ec2', icon:'EC2'}, {id:'aws_lambda', name:'Lambda', provider:'aws', cat:'aws', type:'SERVERLESS', service:'lambda', icon:'&lambda;'}, {id:'aws_ecs', name:'ECS', provider:'aws', cat:'aws', type:'CONTAINER', service:'ecs', icon:'ECS'}, {id:'aws_eks', name:'EKS', provider:'aws', cat:'aws', type:'CONTAINER', service:'eks', icon:'EKS'}, {id:'aws_fargate', name:'Fargate', provider:'aws', cat:'aws', type:'CONTAINER', service:'fargate', icon:'FG'}, {id:'aws_rds', name:'RDS', provider:'aws', cat:'aws', type:'DATABASE', service:'rds', icon:'RDS'}, {id:'aws_aurora', name:'Aurora', provider:'aws', cat:'aws', type:'DATABASE', service:'aurora', icon:'AUR'}, {id:'aws_dynamodb', name:'DynamoDB', provider:'aws', cat:'aws', type:'DATABASE', service:'dynamodb', icon:'DDB'}, {id:'aws_s3', name:'S3', provider:'aws', cat:'aws', type:'STORAGE', service:'s3', icon:'S3'}, {id:'aws_vpc', name:'VPC', provider:'aws', cat:'aws', type:'NETWORK', service:'vpc', icon:'VPC'}, {id:'aws_cloudfront',name:'CloudFront', provider:'aws', cat:'aws', type:'CDN', service:'cloudfront', icon:'CF'}, {id:'aws_apigw', name:'API Gateway', provider:'aws', cat:'aws', type:'GATEWAY', service:'apigateway', icon:'APIGW'}, {id:'aws_alb', name:'ALB', provider:'aws', cat:'aws', type:'GATEWAY', service:'alb', icon:'ALB'}, {id:'aws_nat', name:'NAT Gateway', provider:'aws', cat:'aws', type:'NETWORK', service:'nat_gateway', icon:'NAT'}, {id:'aws_elasticache',name:'ElastiCache', provider:'aws', cat:'aws', type:'CACHE', service:'elasticache', icon:'EC'}, {id:'aws_sqs', name:'SQS', provider:'aws', cat:'aws', type:'QUEUE', service:'sqs', icon:'SQS'}, {id:'aws_sns', name:'SNS', provider:'aws', cat:'aws', type:'QUEUE', service:'sns', icon:'SNS'}, {id:'aws_iam', name:'IAM', provider:'aws', cat:'aws', type:'IAM', service:'iam_role', icon:'IAM'}, {id:'aws_cognito', name:'Cognito', provider:'aws', cat:'aws', type:'IAM', service:'cognito', icon:'COG'}, {id:'aws_cloudwatch',name:'CloudWatch', provider:'aws', cat:'aws', type:'MONITORING', service:'cloudwatch', icon:'CW'}, {id:'aws_sg', name:'Security Group',provider:'aws', cat:'aws', type:'NETWORK', service:'security_group', icon:'SG'}, {id:'aws_secrets', name:'Secrets Mgr', provider:'aws', cat:'aws', type:'IAM', service:'secrets_manager', icon:'SM'}, {id:'aws_kms', name:'KMS', provider:'aws', cat:'aws', type:'IAM', service:'kms', icon:'KMS'}, {id:'aws_route53', name:'Route 53', provider:'aws', cat:'aws', type:'NETWORK', service:'route53', icon:'R53'}, {id:'aws_redshift', name:'Redshift', provider:'aws', cat:'aws', type:'DATABASE', service:'redshift', icon:'RSH'}, {id:'aws_efs', name:'EFS', provider:'aws', cat:'aws', type:'STORAGE', service:'efs', icon:'EFS'}, {id:'aws_ecr', name:'ECR', provider:'aws', cat:'aws', type:'CONTAINER', service:'ecr', icon:'ECR'}, {id:'aws_beanstalk', name:'Beanstalk', provider:'aws', cat:'aws', type:'COMPUTE', service:'elastic_beanstalk',icon:'EB'}, {id:'aws_apprunner', name:'App Runner', provider:'aws', cat:'aws', type:'SERVERLESS', service:'app_runner', icon:'APR'}, {id:'aws_stepfn', name:'Step Functions',provider:'aws', cat:'aws', type:'SERVERLESS', service:'step_functions', icon:'SFN'}, {id:'aws_eventbridge',name:'EventBridge', provider:'aws', cat:'aws', type:'QUEUE', service:'eventbridge', icon:'EVB'}, {id:'aws_kinesis', name:'Kinesis', provider:'aws', cat:'aws', type:'QUEUE', service:'kinesis', icon:'KIN'}, {id:'aws_cloudtrail',name:'CloudTrail', provider:'aws', cat:'aws', type:'MONITORING', service:'cloudtrail', icon:'CT'}, {id:'aws_nlb', name:'NLB', provider:'aws', cat:'aws', type:'GATEWAY', service:'nlb', icon:'NLB'}, {id:'aws_glue', name:'Glue', provider:'aws', cat:'aws', type:'SERVERLESS', service:'glue', icon:'GLU'}, {id:'aws_athena', name:'Athena', provider:'aws', cat:'aws', type:'SERVERLESS', service:'athena', icon:'ATH'}, {id:'aws_emr', name:'EMR', provider:'aws', cat:'aws', type:'COMPUTE', service:'emr', icon:'EMR'}, {id:'aws_batch', name:'AWS Batch', provider:'aws', cat:'aws', type:'COMPUTE', service:'aws_batch', icon:'BAT'}, {id:'aws_cfn', name:'CloudFormation',provider:'aws', cat:'aws', type:'OTHER', service:'cloudformation', icon:'CFN'}, {id:'aws_xray', name:'X-Ray', provider:'aws', cat:'aws', type:'MONITORING', service:'xray', icon:'XRY'}, {id:'aws_tgw', name:'Transit GW', provider:'aws', cat:'aws', type:'NETWORK', service:'transit_gateway', icon:'TGW'}, {id:'aws_ga', name:'Global Accel.', provider:'aws', cat:'aws', type:'NETWORK', service:'global_accelerator',icon:'GA'}, // GCP {id:'gcp_gce', name:'Compute Engine',provider:'gcp', cat:'gcp', type:'COMPUTE', service:'gce_instance', icon:'GCE'}, {id:'gcp_cloudrun', name:'Cloud Run', provider:'gcp', cat:'gcp', type:'SERVERLESS', service:'cloud_run', icon:'CR'}, {id:'gcp_gke', name:'GKE', provider:'gcp', cat:'gcp', type:'CONTAINER', service:'gke', icon:'GKE'}, {id:'gcp_cloudsql', name:'Cloud SQL', provider:'gcp', cat:'gcp', type:'DATABASE', service:'cloud_sql', icon:'SQL'}, {id:'gcp_spanner', name:'Spanner', provider:'gcp', cat:'gcp', type:'DATABASE', service:'spanner', icon:'SPN'}, {id:'gcp_firestore', name:'Firestore', provider:'gcp', cat:'gcp', type:'DATABASE', service:'firestore', icon:'FST'}, {id:'gcp_gcs', name:'Cloud Storage', provider:'gcp', cat:'gcp', type:'STORAGE', service:'gcs_bucket', icon:'GCS'}, {id:'gcp_pubsub', name:'Pub/Sub', provider:'gcp', cat:'gcp', type:'QUEUE', service:'pubsub', icon:'PS'}, {id:'gcp_memstore', name:'Memorystore', provider:'gcp', cat:'gcp', type:'CACHE', service:'memorystore', icon:'MEM'}, {id:'gcp_monitor', name:'Cloud Monitor', provider:'gcp', cat:'gcp', type:'MONITORING', service:'cloud_monitoring', icon:'MON'}, {id:'gcp_secrets', name:'Secret Manager',provider:'gcp', cat:'gcp', type:'IAM', service:'secret_manager', icon:'GSM'}, {id:'gcp_kms', name:'Cloud KMS', provider:'gcp', cat:'gcp', type:'IAM', service:'cloud_kms', icon:'KMS'}, {id:'gcp_functions', name:'Cloud Functions',provider:'gcp', cat:'gcp', type:'SERVERLESS', service:'cloud_functions', icon:'GCF'}, {id:'gcp_appengine', name:'App Engine', provider:'gcp', cat:'gcp', type:'SERVERLESS', service:'app_engine', icon:'GAE'}, {id:'gcp_bigquery', name:'BigQuery', provider:'gcp', cat:'gcp', type:'DATABASE', service:'bigquery', icon:'BQ'}, {id:'gcp_bigtable', name:'Bigtable', provider:'gcp', cat:'gcp', type:'DATABASE', service:'bigtable', icon:'BGT'}, {id:'gcp_cdn', name:'Cloud CDN', provider:'gcp', cat:'gcp', type:'CDN', service:'cloud_cdn', icon:'CDN'}, {id:'gcp_lb', name:'Cloud LB', provider:'gcp', cat:'gcp', type:'GATEWAY', service:'cloud_lb', icon:'CLB'}, {id:'gcp_armor', name:'Cloud Armor', provider:'gcp', cat:'gcp', type:'NETWORK', service:'cloud_armor', icon:'ARM'}, {id:'gcp_dns', name:'Cloud DNS', provider:'gcp', cat:'gcp', type:'NETWORK', service:'cloud_dns', icon:'DNS'}, {id:'gcp_artifactreg',name:'Artifact Reg.',provider:'gcp', cat:'gcp', type:'CONTAINER', service:'artifact_registry',icon:'GAR'}, {id:'gcp_tasks', name:'Cloud Tasks', provider:'gcp', cat:'gcp', type:'QUEUE', service:'cloud_tasks', icon:'CTQ'}, {id:'gcp_scheduler', name:'Cloud Scheduler',provider:'gcp', cat:'gcp', type:'OTHER', service:'cloud_scheduler', icon:'SCH'}, {id:'gcp_dataflow', name:'Dataflow', provider:'gcp', cat:'gcp', type:'COMPUTE', service:'dataflow', icon:'DF'}, {id:'gcp_dataproc', name:'Dataproc', provider:'gcp', cat:'gcp', type:'COMPUTE', service:'dataproc', icon:'DPR'}, {id:'gcp_filestore', name:'Filestore', provider:'gcp', cat:'gcp', type:'STORAGE', service:'filestore', icon:'FS'}, {id:'gcp_composer', name:'Cloud Composer',provider:'gcp', cat:'gcp', type:'OTHER', service:'cloud_composer', icon:'CMP'}, {id:'gcp_nat', name:'Cloud NAT', provider:'gcp', cat:'gcp', type:'NETWORK', service:'cloud_nat', icon:'NAT'}, {id:'gcp_vpc', name:'VPC Network', provider:'gcp', cat:'gcp', type:'NETWORK', service:'gcp_vpc', icon:'VPC'}, // Azure {id:'az_vm', name:'Azure VM', provider:'azure', cat:'azure', type:'COMPUTE', service:'azure_vm', icon:'VM'}, {id:'az_functions', name:'Functions', provider:'azure', cat:'azure', type:'SERVERLESS', service:'azure_functions', icon:'FN'}, {id:'az_aks', name:'AKS', provider:'azure', cat:'azure', type:'CONTAINER', service:'aks', icon:'AKS'}, {id:'az_sql', name:'Azure SQL', provider:'azure', cat:'azure', type:'DATABASE', service:'azure_sql', icon:'SQL'}, {id:'az_blob', name:'Blob Storage', provider:'azure', cat:'azure', type:'STORAGE', service:'blob_storage', icon:'BLOB'}, {id:'az_monitor', name:'Azure Monitor', provider:'azure', cat:'azure', type:'MONITORING', service:'azure_monitor', icon:'MON'}, {id:'az_iam', name:'Azure AD', provider:'azure', cat:'azure', type:'IAM', service:'azure_ad', icon:'AAD'}, {id:'az_keyvault', name:'Key Vault', provider:'azure', cat:'azure', type:'IAM', service:'key_vault', icon:'KV'}, {id:'az_appservice', name:'App Service', provider:'azure', cat:'azure', type:'COMPUTE', service:'app_service', icon:'APS'}, {id:'az_aci', name:'Container Inst.',provider:'azure', cat:'azure', type:'CONTAINER', service:'aci', icon:'ACI'}, {id:'az_acr', name:'Container Reg.', provider:'azure', cat:'azure', type:'CONTAINER', service:'acr', icon:'ACR'}, {id:'az_cosmos', name:'Cosmos DB', provider:'azure', cat:'azure', type:'DATABASE', service:'cosmos_db', icon:'COS'}, {id:'az_redis', name:'Cache (Redis)', provider:'azure', cat:'azure', type:'CACHE', service:'azure_redis', icon:'RDS'}, {id:'az_servicebus', name:'Service Bus', provider:'azure', cat:'azure', type:'QUEUE', service:'service_bus', icon:'SB'}, {id:'az_eventhubs', name:'Event Hubs', provider:'azure', cat:'azure', type:'QUEUE', service:'event_hubs', icon:'EH'}, {id:'az_frontdoor', name:'Front Door', provider:'azure', cat:'azure', type:'CDN', service:'front_door', icon:'FD'}, {id:'az_appgw', name:'App Gateway', provider:'azure', cat:'azure', type:'GATEWAY', service:'app_gateway', icon:'AGW'}, {id:'az_datafactory',name:'Data Factory', provider:'azure', cat:'azure', type:'OTHER', service:'data_factory', icon:'ADF'}, {id:'az_synapse', name:'Synapse', provider:'azure', cat:'azure', type:'DATABASE', service:'synapse', icon:'SYN'}, {id:'az_containerapps',name:'Container Apps',provider:'azure', cat:'azure', type:'CONTAINER', service:'container_apps', icon:'ACA'}, {id:'az_logicapps', name:'Logic Apps', provider:'azure', cat:'azure', type:'SERVERLESS', service:'logic_apps', icon:'LA'}, {id:'az_apim', name:'API Mgmt', provider:'azure', cat:'azure', type:'GATEWAY', service:'apim', icon:'APIM'}, {id:'az_lb', name:'Load Balancer', provider:'azure', cat:'azure', type:'GATEWAY', service:'azure_lb', icon:'ALB'}, {id:'az_trafficmgr', name:'Traffic Mgr', provider:'azure', cat:'azure', type:'NETWORK', service:'traffic_manager', icon:'TM'}, {id:'az_vmss', name:'VM Scale Set', provider:'azure', cat:'azure', type:'COMPUTE', service:'vmss', icon:'VMSS'}, {id:'az_bastion', name:'Bastion', provider:'azure', cat:'azure', type:'NETWORK', service:'azure_bastion', icon:'BAS'}, // Data stores & streaming (self-managed) {id:'d_postgres', name:'PostgreSQL', provider:'generic', cat:'data', type:'DATABASE', service:'postgresql', icon:'PG'}, {id:'d_mysql', name:'MySQL', provider:'generic', cat:'data', type:'DATABASE', service:'mysql', icon:'MYS'}, {id:'d_mariadb', name:'MariaDB', provider:'generic', cat:'data', type:'DATABASE', service:'mariadb', icon:'MDB'}, {id:'d_mongodb', name:'MongoDB', provider:'generic', cat:'data', type:'DATABASE', service:'mongodb', icon:'MGO'}, {id:'d_cassandra', name:'Cassandra', provider:'generic', cat:'data', type:'DATABASE', service:'cassandra', icon:'CAS'}, {id:'d_elasticsearch',name:'Elasticsearch',provider:'generic', cat:'data', type:'DATABASE', service:'elasticsearch', icon:'ES'}, {id:'d_clickhouse', name:'ClickHouse', provider:'generic', cat:'data', type:'DATABASE', service:'clickhouse', icon:'CH'}, {id:'d_influxdb', name:'InfluxDB', provider:'generic', cat:'data', type:'DATABASE', service:'influxdb', icon:'IDB'}, {id:'d_neo4j', name:'Neo4j', provider:'generic', cat:'data', type:'DATABASE', service:'neo4j', icon:'N4J'}, {id:'d_memcached', name:'Memcached', provider:'generic', cat:'data', type:'CACHE', service:'memcached', icon:'MC'}, {id:'d_kafka', name:'Kafka', provider:'generic', cat:'data', type:'QUEUE', service:'kafka', icon:'KFK'}, {id:'d_rabbitmq', name:'RabbitMQ', provider:'generic', cat:'data', type:'QUEUE', service:'rabbitmq', icon:'RMQ'}, // GPU / NVIDIA & LLM Serving {id:'nv_dgx', name:'DGX Cloud', provider:'nvidia', cat:'gpu', type:'COMPUTE', service:'nvidia_dgx', icon:'DGX'}, {id:'nv_nim', name:'NIM', provider:'nvidia', cat:'gpu', type:'GATEWAY', service:'nvidia_nim', icon:'NIM'}, {id:'nv_ngc', name:'NGC Catalog', provider:'nvidia', cat:'gpu', type:'CONTAINER', service:'nvidia_ngc', icon:'NGC'}, {id:'nv_aie', name:'AI Enterprise', provider:'nvidia', cat:'gpu', type:'OTHER', service:'nvidia_ai_enterprise',icon:'NVAI'}, {id:'nv_trtllm', name:'TensorRT-LLM', provider:'nvidia', cat:'gpu', type:'COMPUTE', service:'tensorrt_llm', icon:'TRT'}, {id:'nv_rapids', name:'RAPIDS', provider:'nvidia', cat:'gpu', type:'COMPUTE', service:'rapids', icon:'RAP'}, {id:'nv_nemo', name:'NeMo', provider:'nvidia', cat:'gpu', type:'COMPUTE', service:'nvidia_nemo', icon:'NMO'}, {id:'aws_gpu', name:'EC2 GPU (P5/P4)',provider:'aws', cat:'gpu', type:'COMPUTE', service:'ec2_gpu', icon:'P5'}, {id:'gcp_gpu', name:'GPU VM (A3/A2)',provider:'gcp', cat:'gpu', type:'COMPUTE', service:'gcp_gpu_vm', icon:'A3'}, {id:'az_gpu', name:'GPU VM (ND/NC)',provider:'azure', cat:'gpu', type:'COMPUTE', service:'azure_gpu_vm', icon:'ND'}, {id:'nv_vllm', name:'vLLM', provider:'generic', cat:'gpu', type:'COMPUTE', service:'vllm', icon:'VLM'}, {id:'nv_tgi', name:'TGI', provider:'generic', cat:'gpu', type:'COMPUTE', service:'tgi', icon:'TGI'}, {id:'nv_together', name:'Together AI', provider:'generic', cat:'gpu', type:'GATEWAY', service:'together_ai', icon:'TOG'}, {id:'nv_runpod', name:'RunPod', provider:'generic', cat:'gpu', type:'COMPUTE', service:'runpod', icon:'RUN'}, {id:'nv_modal', name:'Modal', provider:'generic', cat:'gpu', type:'SERVERLESS', service:'modal', icon:'MDL'}, // CI/CD & Tools {id:'t_jenkins', name:'Jenkins', provider:'generic', cat:'cicd', type:'OTHER', service:'jenkins', icon:'JNK'}, {id:'t_gha', name:'GitHub Actions',provider:'generic', cat:'cicd', type:'OTHER', service:'github_actions', icon:'GHA'}, {id:'t_gitlab', name:'GitLab CI', provider:'generic', cat:'cicd', type:'OTHER', service:'gitlab_ci', icon:'GL'}, {id:'t_terraform', name:'Terraform', provider:'generic', cat:'cicd', type:'OTHER', service:'terraform', icon:'TF'}, {id:'t_docker', name:'Docker', provider:'generic', cat:'cicd', type:'CONTAINER', service:'docker', icon:'DKR'}, {id:'t_k8s', name:'Kubernetes', provider:'generic', cat:'cicd', type:'CONTAINER', service:'kubernetes', icon:'K8S'}, {id:'t_ansible', name:'Ansible', provider:'generic', cat:'cicd', type:'OTHER', service:'ansible', icon:'ANS'}, {id:'t_redis', name:'Redis', provider:'generic', cat:'cicd', type:'CACHE', service:'redis', icon:'RDS'}, {id:'t_nginx', name:'Nginx', provider:'generic', cat:'cicd', type:'GATEWAY', service:'nginx', icon:'NGX'}, {id:'t_argocd', name:'Argo CD', provider:'generic', cat:'cicd', type:'OTHER', service:'argocd', icon:'ARGO'}, {id:'t_flux', name:'Flux CD', provider:'generic', cat:'cicd', type:'OTHER', service:'fluxcd', icon:'FLX'}, {id:'t_tekton', name:'Tekton', provider:'generic', cat:'cicd', type:'OTHER', service:'tekton', icon:'TKN'}, {id:'t_circleci', name:'CircleCI', provider:'generic', cat:'cicd', type:'OTHER', service:'circleci', icon:'CCI'}, {id:'t_spinnaker', name:'Spinnaker', provider:'generic', cat:'cicd', type:'OTHER', service:'spinnaker', icon:'SPK'}, {id:'t_azpipelines', name:'Azure Pipelines',provider:'azure', cat:'cicd', type:'OTHER', service:'azure_pipelines', icon:'AZP'}, {id:'gcp_build', name:'Cloud Build', provider:'gcp', cat:'cicd', type:'OTHER', service:'cloud_build', icon:'GCB'}, {id:'t_helm', name:'Helm', provider:'generic', cat:'cicd', type:'CONTAINER', service:'helm', icon:'HLM'}, {id:'t_drone', name:'Drone CI', provider:'generic', cat:'cicd', type:'OTHER', service:'drone_ci', icon:'DRN'}, {id:'t_gha_hosted', name:'GitHub-Hosted Runner', provider:'generic', cat:'cicd', type:'COMPUTE', service:'gha_hosted_runner', icon:'GHH'}, {id:'t_gha_larger', name:'GitHub Larger Runner', provider:'generic', cat:'cicd', type:'COMPUTE', service:'gha_larger_runner', icon:'GHX'}, {id:'t_gha_selfhosted', name:'GitHub Self-Hosted Runner', provider:'generic', cat:'cicd', type:'COMPUTE', service:'gha_self_hosted_runner', icon:'GHS'}, {id:'t_gha_arc', name:'Actions Runner Controller (ARC)', provider:'generic', cat:'cicd', type:'CONTAINER', service:'gha_arc', icon:'ARC'}, {id:'t_ado_mshosted', name:'Azure DevOps MS-Hosted Agent', provider:'azure', cat:'cicd', type:'COMPUTE', service:'ado_ms_hosted_agent', icon:'ADM'}, {id:'t_ado_selfhosted', name:'Azure DevOps Self-Hosted Agent',provider:'azure', cat:'cicd', type:'COMPUTE', service:'ado_self_hosted_agent', icon:'ADS'}, {id:'t_ado_scaleset', name:'Azure DevOps Scale Set Agent', provider:'azure', cat:'cicd', type:'COMPUTE', service:'ado_scale_set_agent', icon:'VMSS'}, {id:'t_jenkins_static', name:'Jenkins Static Agent', provider:'generic', cat:'cicd', type:'COMPUTE', service:'jenkins_static_agent', icon:'JST'}, {id:'t_jenkins_k8s', name:'Jenkins Kubernetes Agent', provider:'generic', cat:'cicd', type:'CONTAINER', service:'jenkins_k8s_agent', icon:'JK8'}, {id:'t_jenkins_cloud', name:'Jenkins Cloud Agent (EC2/VM Fleet)', provider:'generic', cat:'cicd', type:'COMPUTE', service:'jenkins_cloud_agent', icon:'JCL'}, // Monitoring {id:'m_datadog', name:'Datadog', provider:'generic', cat:'monitoring',type:'MONITORING', service:'datadog', icon:'DD'}, {id:'m_grafana', name:'Grafana', provider:'generic', cat:'monitoring',type:'MONITORING', service:'grafana', icon:'GF'}, {id:'m_prometheus', name:'Prometheus', provider:'generic', cat:'monitoring',type:'MONITORING', service:'prometheus', icon:'PRO'}, {id:'m_pagerduty', name:'PagerDuty', provider:'generic', cat:'monitoring',type:'MONITORING', service:'pagerduty', icon:'PD'}, {id:'m_sentry', name:'Sentry', provider:'generic', cat:'monitoring',type:'MONITORING', service:'sentry', icon:'SNT'}, {id:'m_newrelic', name:'New Relic', provider:'generic', cat:'monitoring',type:'MONITORING', service:'newrelic', icon:'NR'}, // Security {id:'s_vault', name:'Vault', provider:'generic', cat:'security', type:'IAM', service:'vault', icon:'VLT'}, {id:'s_snyk', name:'Snyk', provider:'generic', cat:'security', type:'MONITORING', service:'snyk', icon:'SNK'}, {id:'s_waf', name:'AWS WAF', provider:'aws', cat:'security', type:'NETWORK', service:'waf', icon:'WAF'}, {id:'s_sg', name:'Sec. Group', provider:'aws', cat:'security', type:'NETWORK', service:'security_group', icon:'SG'}, {id:'s_auth0', name:'Auth0', provider:'generic', cat:'security', type:'IAM', service:'auth0', icon:'AU0'}, {id:'s_okta', name:'Okta', provider:'generic', cat:'security', type:'IAM', service:'okta', icon:'OKT'}, {id:'s_keycloak', name:'Keycloak', provider:'generic', cat:'security', type:'IAM', service:'keycloak', icon:'KC'}, {id:'s_firebaseauth',name:'Firebase Auth', provider:'generic', cat:'security', type:'IAM', service:'firebase_auth', icon:'FBA'}, {id:'s_cloudflare', name:'Cloudflare', provider:'generic', cat:'security', type:'CDN', service:'cloudflare', icon:'CFL'}, {id:'s_trivy', name:'Trivy', provider:'generic', cat:'security', type:'MONITORING', service:'trivy', icon:'TRV'}, {id:'s_sonarqube', name:'SonarQube', provider:'generic', cat:'security', type:'MONITORING', service:'sonarqube', icon:'SNQ'}, {id:'s_wiz', name:'Wiz', provider:'generic', cat:'security', type:'MONITORING', service:'wiz', icon:'WIZ'}, {id:'s_prisma', name:'Prisma Cloud', provider:'generic', cat:'security', type:'MONITORING', service:'prisma_cloud', icon:'PRC'}, {id:'s_aqua', name:'Aqua Security', provider:'generic', cat:'security', type:'MONITORING', service:'aqua_security', icon:'AQA'}, {id:'s_opa', name:'OPA', provider:'generic', cat:'security', type:'IAM', service:'opa', icon:'OPA'}, {id:'s_falco', name:'Falco', provider:'generic', cat:'security', type:'MONITORING', service:'falco', icon:'FAL'}, {id:'s_crowdstrike', name:'CrowdStrike', provider:'generic', cat:'security', type:'MONITORING', service:'crowdstrike', icon:'CRWD'}, {id:'aws_guardduty', name:'GuardDuty', provider:'aws', cat:'security', type:'MONITORING', service:'guardduty', icon:'GD'}, {id:'aws_inspector', name:'Inspector', provider:'aws', cat:'security', type:'MONITORING', service:'inspector', icon:'INS'}, {id:'az_sentinel', name:'Sentinel', provider:'azure', cat:'security', type:'MONITORING', service:'sentinel', icon:'SEN'}, // AI / ML — AWS {id:'aws_sagemaker', name:'SageMaker', provider:'aws', cat:'ai', type:'COMPUTE', service:'sagemaker', icon:'SM'}, {id:'aws_bedrock', name:'Bedrock', provider:'aws', cat:'ai', type:'GATEWAY', service:'bedrock', icon:'BDR'}, {id:'aws_rekognition',name:'Rekognition', provider:'aws', cat:'ai', type:'SERVERLESS', service:'rekognition', icon:'RKG'}, {id:'aws_textract', name:'Textract', provider:'aws', cat:'ai', type:'SERVERLESS', service:'textract', icon:'TXT'}, {id:'aws_comprehend',name:'Comprehend', provider:'aws', cat:'ai', type:'SERVERLESS', service:'comprehend', icon:'NLP'}, {id:'aws_kendra', name:'Kendra', provider:'aws', cat:'ai', type:'GATEWAY', service:'kendra', icon:'KND'}, // AI / ML — GCP {id:'gcp_vertexai', name:'Vertex AI', provider:'gcp', cat:'ai', type:'COMPUTE', service:'vertex_ai', icon:'VAI'}, {id:'gcp_bqml', name:'BigQuery ML', provider:'gcp', cat:'ai', type:'DATABASE', service:'bigquery_ml', icon:'BQML'}, {id:'gcp_vision', name:'Vision API', provider:'gcp', cat:'ai', type:'SERVERLESS', service:'vision_api', icon:'VIS'}, {id:'gcp_nlp', name:'Natural Language',provider:'gcp', cat:'ai', type:'SERVERLESS', service:'cloud_nlp', icon:'NLP'}, // AI / ML — Azure {id:'az_openai', name:'Azure OpenAI', provider:'azure', cat:'ai', type:'GATEWAY', service:'azure_openai', icon:'AOAI'}, {id:'az_ml', name:'Azure ML', provider:'azure', cat:'ai', type:'COMPUTE', service:'azure_ml', icon:'AML'}, {id:'az_cognitive', name:'Cognitive Svcs',provider:'azure', cat:'ai', type:'SERVERLESS', service:'cognitive_services',icon:'COG'}, // LLM APIs (generic) {id:'ai_openai', name:'OpenAI API', provider:'generic', cat:'ai', type:'GATEWAY', service:'openai_api', icon:'OAI'}, {id:'ai_anthropic', name:'Anthropic API', provider:'generic', cat:'ai', type:'GATEWAY', service:'anthropic_api', icon:'ANT'}, {id:'ai_gemini', name:'Gemini API', provider:'generic', cat:'ai', type:'GATEWAY', service:'gemini_api', icon:'GEM'}, {id:'ai_ollama', name:'Ollama', provider:'generic', cat:'ai', type:'COMPUTE', service:'ollama', icon:'OLL'}, {id:'ai_hf', name:'Hugging Face', provider:'generic', cat:'ai', type:'GATEWAY', service:'huggingface', icon:'HF'}, // Vector Databases {id:'ai_pinecone', name:'Pinecone', provider:'generic', cat:'ai', type:'DATABASE', service:'pinecone', icon:'PCN'}, {id:'ai_weaviate', name:'Weaviate', provider:'generic', cat:'ai', type:'DATABASE', service:'weaviate', icon:'WVT'}, {id:'ai_chroma', name:'Chroma', provider:'generic', cat:'ai', type:'DATABASE', service:'chroma', icon:'CHR'}, {id:'ai_qdrant', name:'Qdrant', provider:'generic', cat:'ai', type:'DATABASE', service:'qdrant', icon:'QDR'}, {id:'ai_pgvector', name:'pgvector', provider:'generic', cat:'ai', type:'DATABASE', service:'pgvector', icon:'PGV'}, // MLOps / Frameworks {id:'ai_mlflow', name:'MLflow', provider:'generic', cat:'ai', type:'MONITORING', service:'mlflow', icon:'MLF'}, {id:'ai_wandb', name:'W&B', provider:'generic', cat:'ai', type:'MONITORING', service:'wandb', icon:'W&B'}, {id:'ai_langchain', name:'LangChain', provider:'generic', cat:'ai', type:'OTHER', service:'langchain', icon:'LC'}, {id:'ai_llamaindex', name:'LlamaIndex', provider:'generic', cat:'ai', type:'OTHER', service:'llamaindex', icon:'LLI'}, {id:'ai_ray', name:'Ray', provider:'generic', cat:'ai', type:'COMPUTE', service:'ray', icon:'RAY'}, {id:'ai_feast', name:'Feast', provider:'generic', cat:'ai', type:'DATABASE', service:'feast', icon:'FST'}, {id:'ai_triton', name:'Triton Server', provider:'generic', cat:'ai', type:'COMPUTE', service:'triton', icon:'TRI'}, {id:'ai_cohere', name:'Cohere API', provider:'generic', cat:'ai', type:'GATEWAY', service:'cohere_api', icon:'COH'}, {id:'ai_mistral', name:'Mistral API', provider:'generic', cat:'ai', type:'GATEWAY', service:'mistral_api', icon:'MST'}, {id:'ai_groq', name:'Groq', provider:'generic', cat:'ai', type:'GATEWAY', service:'groq_api', icon:'GRQ'}, {id:'ai_replicate', name:'Replicate', provider:'generic', cat:'ai', type:'GATEWAY', service:'replicate', icon:'RPL'}, {id:'ai_milvus', name:'Milvus', provider:'generic', cat:'ai', type:'DATABASE', service:'milvus', icon:'MLV'}, {id:'ai_langsmith', name:'LangSmith', provider:'generic', cat:'ai', type:'MONITORING', service:'langsmith', icon:'LS'}, {id:'ai_kubeflow', name:'Kubeflow', provider:'generic', cat:'ai', type:'CONTAINER', service:'kubeflow', icon:'KFL'}, {id:'ai_arize', name:'Arize', provider:'generic', cat:'ai', type:'MONITORING', service:'arize', icon:'ARZ'}, // Hardware / Embedded / IoT / EDA {id:'hw_cadence', name:'Cadence EDA', provider:'generic', cat:'embedded', type:'OTHER', service:'cadence', icon:'CDS'}, {id:'hw_synopsys', name:'Synopsys', provider:'generic', cat:'embedded', type:'OTHER', service:'synopsys', icon:'SNPS'}, {id:'hw_siemens', name:'Siemens EDA', provider:'generic', cat:'embedded', type:'OTHER', service:'siemens_eda', icon:'MENT'}, {id:'hw_fpga', name:'FPGA Instance', provider:'generic', cat:'embedded', type:'COMPUTE', service:'fpga', icon:'FPGA'}, {id:'aws_iotcore', name:'IoT Core', provider:'aws', cat:'embedded', type:'GATEWAY', service:'iot_core', icon:'IOT'}, {id:'aws_greengrass',name:'IoT Greengrass',provider:'aws', cat:'embedded', type:'COMPUTE', service:'iot_greengrass', icon:'GG'}, {id:'az_iothub', name:'IoT Hub', provider:'azure', cat:'embedded', type:'GATEWAY', service:'iot_hub', icon:'IOTH'}, {id:'az_iotedge', name:'IoT Edge', provider:'azure', cat:'embedded', type:'COMPUTE', service:'iot_edge', icon:'IOTE'}, {id:'hw_freertos', name:'FreeRTOS', provider:'generic', cat:'embedded', type:'OTHER', service:'freertos', icon:'RTOS'}, {id:'hw_mqtt', name:'MQTT Broker', provider:'generic', cat:'embedded', type:'QUEUE', service:'mqtt_broker', icon:'MQTT'}, {id:'hw_balena', name:'Balena Cloud', provider:'generic', cat:'embedded', type:'OTHER', service:'balena', icon:'BAL'}, ]; let selectedSvcs = new Map(); let currentCat = 'all'; function renderServiceGrid() { const grid = document.getElementById('serviceGrid'); if (!grid) return; const q = (document.getElementById('serviceSearch').value || '').toLowerCase(); const filtered = SERVICES.filter(s => { const matchCat = currentCat === 'all' || s.cat === currentCat; const matchQ = !q || s.name.toLowerCase().includes(q) || s.provider.includes(q) || s.service.includes(q); return matchCat && matchQ; }); grid.innerHTML = filtered.map(s => ` <div class="service-card ${selectedSvcs.has(s.id) ? 'selected' : ''}" onclick="toggleSvc('${s.id}')" title="${s.name} (${s.provider})"> <div><span class="svc-prov prov-${s.provider}">${s.provider.toUpperCase()}</span></div> <div class="svc-icon">${s.icon}</div> <div class="svc-name">${s.name}</div> </div> `).join(''); } function setCat(el) { currentCat = el.dataset.cat; document.querySelectorAll('.cat-tab').forEach(t => t.classList.toggle('active', t.dataset.cat === currentCat)); renderServiceGrid(); } function toggleSvc(id) { const svc = SERVICES.find(s => s.id === id); if (!svc) return; if (selectedSvcs.has(id)) selectedSvcs.delete(id); else selectedSvcs.set(id, svc); renderServiceGrid(); updateStack(); } function updateStack() { const chips = document.getElementById('stackChips'); const svcs = [...selectedSvcs.values()]; chips.innerHTML = svcs.length ? svcs.map(s => `<span class="stack-chip" onclick="toggleSvc('${s.id}')" title="Click to remove">${s.name} <span class="stack-chip-x">&#x2715;</span></span>`).join('') : '<span class="stack-empty">Click services above to add them</span>'; const btn = document.getElementById('builderAnalyzeBtn'); if (btn) btn.disabled = svcs.length === 0; const types = new Set(svcs.map(s => s.type)); const services = new Set(svcs.map(s => s.service)); renderSuggestions(types, [], 'suggList', services); } // --- Live suggestion rules (pure client-side) --- const _LLM_SERVICES = new Set(['openai_api','anthropic_api','gemini_api','bedrock','vertex_ai','azure_openai','huggingface','ollama','kendra','triton','vllm','tgi','nvidia_nim','together_ai','runpod','cohere_api','mistral_api','groq_api','replicate']); const _VECTOR_SERVICES = new Set(['pinecone','weaviate','chroma','qdrant','pgvector','milvus']); const _MLOPS_SERVICES = new Set(['mlflow','wandb']); const _FRAMEWORK_SVCS = new Set(['langchain','llamaindex']); const _ML_TRAIN_SVCS = new Set(['sagemaker','vertex_ai','azure_ml','ray','nvidia_dgx','rapids','nvidia_nemo','ec2_gpu','gcp_gpu_vm','azure_gpu_vm','kubeflow']); function computeSuggestions(types, edges, nodes, services) { services = services || new Set(); const has = t => types.has(t); const hasSvc = s => services.has(s); const hasAnyLLM = [..._LLM_SERVICES].some(s => hasSvc(s)); const hasVectorDb = [..._VECTOR_SERVICES].some(s => hasSvc(s)); const hasMLOps = [..._MLOPS_SERVICES].some(s => hasSvc(s)); const hasFramework = [..._FRAMEWORK_SVCS].some(s => hasSvc(s)); const hasMLTrain = [..._ML_TRAIN_SVCS].some(s => hasSvc(s)); const suggs = []; // --- General architecture rules --- if ((has('COMPUTE') || has('SERVERLESS') || has('CONTAINER')) && !has('MONITORING')) suggs.push({l:'crit', t:'No monitoring — critical gap. Add CloudWatch, Datadog, or Grafana'}); if (has('DATABASE') && !has('MONITORING')) suggs.push({l:'warn', t:'Database with no monitoring — query anomalies will go undetected'}); if (has('COMPUTE') && !has('GATEWAY') && !has('CDN') && !hasAnyLLM) suggs.push({l:'warn', t:'Compute exposed without a Gateway or CDN — add API Gateway or ALB'}); if (has('STORAGE') && !has('IAM')) suggs.push({l:'warn', t:'Storage without IAM — public access risk. Add access control'}); if ((has('COMPUTE') || has('DATABASE')) && !has('NETWORK') && !hasAnyLLM) suggs.push({l:'warn', t:'No VPC/Network isolation — resources may be publicly reachable'}); if (has('CONTAINER') && !has('IAM')) suggs.push({l:'warn', t:'Containers need service accounts/RBAC — add IAM'}); if (has('QUEUE') && !has('MONITORING')) suggs.push({l:'warn', t:'Queues should have dead-letter queue monitoring configured'}); if (has('IAM')) suggs.push({l:'info', t:'IAM present — verify least-privilege; avoid wildcard (*) actions'}); if (has('MONITORING') && (has('COMPUTE') || has('SERVERLESS'))) suggs.push({l:'good', t:'Monitoring + compute — solid observability foundation'}); if (has('GATEWAY') || has('CDN')) suggs.push({l:'good', t:'Gateway/CDN layer adds traffic control and DDoS protection'}); if (has('NETWORK')) suggs.push({l:'good', t:'Network isolation (VPC/Subnet) is a strong security boundary'}); // --- AI / ML specific rules --- if (hasAnyLLM && !has('MONITORING') && !hasMLOps) suggs.push({l:'crit', t:'LLM API with no monitoring — token costs can spike without warning. Add CloudWatch, Datadog, or W&B'}); if (hasAnyLLM && !has('CACHE')) suggs.push({l:'warn', t:'No cache layer — semantic caching (Redis) can cut LLM API costs by 40-60% on repeated queries'}); if (hasAnyLLM && !has('GATEWAY')) suggs.push({l:'warn', t:'LLM API without a Gateway — add API Gateway or rate limiting to control costs and prevent abuse'}); if (hasVectorDb && !has('IAM')) suggs.push({l:'warn', t:'Vector DB stores embeddings that may contain sensitive data — add access control (IAM)'}); if (hasVectorDb && !hasAnyLLM) suggs.push({l:'info', t:'Vector DB without an LLM — is this intentional? Usually paired with an LLM for RAG pipelines'}); if (hasAnyLLM && hasVectorDb) suggs.push({l:'good', t:'LLM + Vector DB — classic RAG setup. Consider adding a cache layer for performance'}); if (hasFramework && !has('IAM')) suggs.push({l:'warn', t:'LangChain/LlamaIndex detected — store API keys in Secrets Manager, never in code'}); if (hasMLTrain && !has('STORAGE')) suggs.push({l:'warn', t:'ML training without artifact storage — add S3 or GCS to save model checkpoints and datasets'}); if (hasMLTrain && !hasMLOps) suggs.push({l:'info', t:'ML training without experiment tracking — consider MLflow or W&B to track runs and compare models'}); if (hasMLOps) suggs.push({l:'good', t:'Experiment tracking configured — great for reproducibility and model comparison'}); if (hasAnyLLM && hasVectorDb && has('CACHE') && has('MONITORING')) suggs.push({l:'good', t:'Well-structured AI stack — LLM + Vector DB + caching + monitoring covers the essentials'}); if (suggs.length === 0) suggs.push({l:'info', t:'Architecture looks reasonable — run full analysis for detailed findings'}); return suggs; } function renderSuggestions(types, _unused, containerId, services) { const list = document.getElementById(containerId); if (!list) return; const items = computeSuggestions(types, [], [], services); list.innerHTML = items.map(s => `<div class="sugg-item ${s.l}"><div class="sugg-dot ${s.l}"></div><span>${s.t}</span></div>` ).join(''); } async function runBuilderAnalysis() { if (selectedSvcs.size === 0) return; const btn = document.getElementById('builderAnalyzeBtn'); const loader = document.getElementById('loader'); const errorBox = document.getElementById('errorBox'); errorBox.style.display = 'none'; document.getElementById('results').style.display = 'none'; loader.style.display = 'block'; btn.disabled = true; try { const svcs = [...selectedSvcs.values()]; const res = await fetch('/analyze-interactive', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ name: 'My Stack', components: svcs.map(s => ({id:s.id, name:s.name, type:s.type, provider:s.provider, service:s.service})), connections: [] }) }); const data = await res.json(); if (!res.ok) throw new Error(data.detail || 'Analysis failed'); renderResults(data); } catch (err) { errorBox.textContent = err.message; errorBox.style.display = 'block'; } finally { loader.style.display = 'none'; btn.disabled = false; } } // ===================== END BUILDER ===================== // ===================== RECOMMEND MY STACK ===================== const CAT_LABELS = {aws:'AWS', gcp:'GCP', azure:'Azure', data:'Data Stores', gpu:'GPU / NVIDIA', cicd:'CI/CD', monitoring:'Monitoring', security:'Security', ai:'AI / ML', embedded:'Hardware / IoT'}; function populateMustHaves() { const sel = document.getElementById('recMustHaves'); if (sel.options.length) return; const byCat = {}; SERVICES.forEach(s => { (byCat[s.cat] = byCat[s.cat] || []).push(s); }); sel.innerHTML = Object.keys(byCat).filter(c => c !== 'all').map(cat => `<optgroup label="${CAT_LABELS[cat] || cat}">${byCat[cat].map(s => `<option value="${s.id}">${s.name} (${s.provider})</option>`).join('')}</optgroup>` ).join(''); } let lastRecommendation = null; async function getRecommendation() { const btn = document.getElementById('recSubmitBtn'); const errorBox = document.getElementById('errorBox'); errorBox.style.display = 'none'; btn.disabled = true; btn.textContent = 'Thinking...'; try { const mustHaves = [...document.getElementById('recMustHaves').selectedOptions] .map(o => SERVICES.find(s => s.id === o.value)) .filter(Boolean) .map(s => ({id:s.id, name:s.name, type:s.type, provider:s.provider, service:s.service})); const req = { project_type: document.getElementById('recProjectType').value, scale: document.getElementById('recScale').value, cloud: document.getElementById('recCloud').value, priority: document.getElementById('recPriority').value, database: document.getElementById('recDatabase').value, ai_needs: document.getElementById('recAiNeeds').value, security_level: document.getElementById('recSecurityLevel').value, realtime: document.getElementById('recRealtime').checked, must_haves: mustHaves, }; const res = await fetch('/recommend', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(req) }); const data = await res.json(); if (!res.ok) throw new Error(data.detail || 'Could not generate a recommendation.'); lastRecommendation = data; renderRecommendation(data); } catch (err) { errorBox.textContent = err.message; errorBox.style.display = 'block'; } finally { btn.disabled = false; btn.textContent = 'Get My Recommendation →'; } } function renderRecommendation(data) { const result = document.getElementById('recResult'); document.getElementById('recSummary').textContent = data.ai_summary || 'Here is a starter stack based on your answers. Review the reasoning below, then use it to pre-fill the builder for a full security & cost analysis.'; document.getElementById('recList').innerHTML = data.recommended.map(r => ` <div class="rec-item"> <div class="rec-item-name"> <span class="svc-prov prov-${r.provider}">${r.provider.toUpperCase()}</span> ${r.name} <span class="rec-role">${r.role.replace(/_/g, ' ')}</span> </div> <div class="rec-item-why">${r.why}</div> </div> `).join(''); document.getElementById('recCostTips').innerHTML = data.cost_tips.map(t => `<li>${t}</li>`).join(''); document.getElementById('recSecurityTips').innerHTML = data.security_tips.map(t => `<li>${t}</li>`).join(''); result.style.display = 'block'; result.scrollIntoView({behavior:'smooth', block:'nearest'}); } function useRecommendation() { if (!lastRecommendation) return; lastRecommendation.recommended.forEach(r => { const svc = SERVICES.find(s => s.id === r.id); if (svc) selectedSvcs.set(svc.id, svc); }); switchTab('builder'); updateStack(); } // ===================== END RECOMMEND ===================== function findingCard(f) { const card = document.createElement('div'); card.className = 'finding-card ' + f.severity; const top = document.createElement('div'); top.className = 'finding-top'; const pill = document.createElement('span'); pill.className = 'severity-pill ' + f.severity; pill.textContent = f.severity; const title = document.createElement('div'); title.className = 'finding-title'; title.textContent = f.title; top.appendChild(pill); top.appendChild(title); if (f.estimated_savings > 0) { const badge = document.createElement('span'); badge.className = 'savings-badge'; badge.textContent = '-$' + Math.round(f.estimated_savings) + '/mo'; top.appendChild(badge); } card.appendChild(top); if (f.component) { const comp = document.createElement('div'); comp.className = 'finding-component'; comp.textContent = 'Component: ' + f.component; card.appendChild(comp); } const desc = document.createElement('div'); desc.className = 'finding-desc'; desc.textContent = f.description; card.appendChild(desc); if (f.recommendation) { const rec = document.createElement('div'); rec.className = 'finding-rec'; rec.textContent = f.recommendation; card.appendChild(rec); } if (f.references && f.references.length) { const refs = document.createElement('div'); refs.className = 'finding-refs'; f.references.forEach((ref, i) => { const link = document.createElement('a'); link.className = 'finding-ref-link'; link.href = ref; link.target = '_blank'; link.rel = 'noopener'; link.textContent = 'Reference' + (f.references.length > 1 ? ` ${i + 1}` : ''); refs.appendChild(link); }); card.appendChild(refs); } return card; } </script> </body> </html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ArchLens — Architecture Security & Cost Analyzer</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0d1224;
color: #e2e8f0;
min-height: 100vh;
}
/* NAV */
nav {
padding: 16px 40px;
display: flex;
align-items: center;
justify-content: space-between;
position: sticky;
top: 0;
background: rgba(13,18,36,0.92);
backdrop-filter: blur(12px);
border-bottom: 1px solid #1e2d4a;
z-index: 100;
}
.nav-logo { font-size: 22px; font-weight: 900; letter-spacing: -1px; }
.nav-logo .arch { color: #818cf8; }
.nav-logo .lens { color: #a78bfa; }
.nav-cta {
padding: 9px 22px;
background: linear-gradient(135deg, #3730a3, #5b21b6);
color: #c7d2fe;
border: none;
border-radius: 99px;
font-size: 14px;
font-weight: 700;
cursor: pointer;
text-decoration: none;
box-shadow: 0 4px 14px rgba(55,48,163,0.4);
transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(55,48,163,0.5); }
/* HERO */
.hero-wrap {
background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 40%, #1a0533 100%);
padding: 80px 24px 100px;
text-align: center;
position: relative;
overflow: hidden;
}
.hero-wrap::before {
content: '';
position: absolute;
inset: 0;
background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero { max-width: 780px; margin: 0 auto; position: relative; }
.hero-badge {
display: inline-block;
background: rgba(255,255,255,0.2);
color: #fff;
font-size: 12px;
font-weight: 700;
padding: 5px 16px;
border-radius: 99px;
margin-bottom: 24px;
letter-spacing: 1px;
text-transform: uppercase;
border: 1px solid rgba(255,255,255,0.3);
}
.hero h1 {
font-size: clamp(32px, 6vw, 58px);
font-weight: 900;
line-height: 1.1;
letter-spacing: -1.5px;
color: #fff;
margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: #c4b5fd; }
.hero p {
font-size: 18px;
color: rgba(255,255,255,0.85);
line-height: 1.7;
max-width: 560px;
margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-white {
padding: 13px 28px;
background: #ede9fe;
color: #3730a3;
border: none;
border-radius: 99px;