Registration Pipeline Architecture

Interactive data lifecycle mapping from client request to secure persistence.

CLIENT TIER VALIDATION TIER CORE SERVICES TIER SUBMIT PASS VALID UPLOAD CRYPT STORED ASYNC REJECT REJECT REJECT BROWSER FORM CAPTCHA CHECK PASSWORD MATCH MULTIPART FILE ENCRYPTION JDBC INSERT JSP RESPONSE ADMIN NOTIF
` }, 'node-8': { title: 'Admin Notification Engine', role: 'Asynchronous Event Handler', desc: 'A decoupled, non-blocking asynchronous event listener that triggers system event handlers to notify administrators of new registrants via email queues.', code: `@Async @EventListener public void handleUserRegistration(UserEvent ev) { mailService.sendSystemAlert( "admin@system.io", "New registration: " + ev.getUserName() ); }` } }; const directConnections = { 'node-1': ['path-1-2', 'path-fail-2', 'path-fail-3', 'path-fail-4'], 'node-2': ['path-1-2', 'path-2-3', 'path-fail-2'], 'node-3': ['path-2-3', 'path-3-4', 'path-fail-3'], 'node-4': ['path-3-4', 'path-4-5', 'path-fail-4'], 'node-5': ['path-4-5', 'path-5-6'], 'node-6': ['path-5-6', 'path-6-7', 'path-6-8'], 'node-7': ['path-6-7'], 'node-8': ['path-6-8'] }; const modeSteps = { success: [ { paths: ['path-1-2'], label: 'lbl-1-2', pauseAfter: 300 }, { paths: ['path-2-3'], label: 'lbl-2-3', pauseAfter: 300 }, { paths: ['path-3-4'], label: 'lbl-3-4', pauseAfter: 300 }, { paths: ['path-4-5'], label: 'lbl-4-5', pauseAfter: 300 }, { paths: ['path-5-6'], label: 'lbl-5-6', pauseAfter: 300 }, { paths: ['path-6-7', 'path-6-8'], label: ['lbl-6-7', 'lbl-6-8'], pauseAfter: 1200 } ], fail_captcha: [ { paths: ['path-1-2'], label: 'lbl-1-2', pauseAfter: 300 }, { paths: ['path-fail-2'], label: 'lbl-fail-2', pauseAfter: 1000 } ], fail_password: [ { paths: ['path-1-2'], label: 'lbl-1-2', pauseAfter: 300 }, { paths: ['path-2-3'], label: 'lbl-2-3', pauseAfter: 300 }, { paths: ['path-fail-3'], label: 'lbl-fail-3', pauseAfter: 1000 } ], fail_multipart: [ { paths: ['path-1-2'], label: 'lbl-1-2', pauseAfter: 300 }, { paths: ['path-2-3'], label: 'lbl-2-3', pauseAfter: 300 }, { paths: ['path-3-4'], label: 'lbl-3-4', pauseAfter: 300 }, { paths: ['path-fail-4'], label: 'lbl-fail-4', pauseAfter: 1000 } ] }; // --- Animation State --- let isPaused = false; let currentMode = 'success'; let currentStepIndex = 0; let stepProgress = 0; // 0 to 1 let isStepPausing = false; let stepPauseTimeLeft = 0; let lastTime = 0; let activePackets = []; let animationFrameId = null; // --- Initialization & Staggered Entrance --- window.addEventListener('DOMContentLoaded', () => { // Trigger staggered fade-in animations const elementsToFade = document.querySelectorAll('.stagger-fade'); elementsToFade.forEach((el, idx) => { setTimeout(() => { el.style.opacity = '1'; }, idx * 60); }); // Initialize animation resetAnimation(); setupEventListeners(); }); // --- Event Listeners and Handlers --- function setupEventListeners() { // Node Hover & Click Handlers const nodes = document.querySelectorAll('.node'); const tooltip = document.getElementById('diagram-tooltip'); const container = document.querySelector('.diagram-container'); nodes.forEach(node => { node.addEventListener('mouseenter', () => { const id = node.id; const keeps = [id, ...directConnections[id]]; // Also keep connection labels const keepLabels = keeps.map(k => k.replace('path-', 'lbl-')); document.querySelectorAll('.node, .connection-path, .conn-label, .layer-line, .layer-label').forEach(el => { const isKeep = keeps.includes(el.id) || keepLabels.includes(el.id) || el.contains(node); if (!isKeep) { el.classList.add('dimmed'); } }); }); node.addEventListener('mouseleave', () => { document.querySelectorAll('.node, .connection-path, .conn-label, .layer-line, .layer-label').forEach(el => { el.classList.remove('dimmed'); }); tooltip.classList.remove('visible'); }); node.addEventListener('click', (e) => { // Highlight node selection nodes.forEach(n => n.classList.remove('selected')); node.classList.add('selected'); // Display Code Inspector content const details = nodeDetails[node.id]; if (details) { document.getElementById('inspector-placeholder').style.display = 'none'; const content = document.getElementById('inspector-content'); content.classList.add('active'); document.getElementById('insp-title').innerText = details.title; document.getElementById('insp-role').innerText = details.role; document.getElementById('insp-desc').innerText = details.desc; document.getElementById('insp-code').textContent = details.code; } // Position and show dynamic tooltip const rect = node.getBoundingClientRect(); const containerRect = container.getBoundingClientRect(); tooltip.style.left = `${rect.left - containerRect.left + rect.width / 2 - 110}px`; tooltip.style.top = `${rect.bottom - containerRect.top + 10}px`; tooltip.innerHTML = `${details.title}
${details.role}`; tooltip.classList.add('visible'); }); }); // Control Panel Buttons const btnPlay = document.getElementById('btn-toggle-play'); const btnReset = document.getElementById('btn-reset'); const btnSuccess = document.getElementById('btn-path-success'); const btnFailCaptcha = document.getElementById('btn-path-fail-captcha'); const btnFailPassword = document.getElementById('btn-path-fail-password'); const btnFailMultipart = document.getElementById('btn-path-fail-multipart'); btnPlay.addEventListener('click', () => { isPaused = !isPaused; btnPlay.innerText = isPaused ? 'Resume' : 'Pause'; if (isPaused) { btnPlay.classList.remove('active'); } else { btnPlay.classList.add('active'); } }); btnReset.addEventListener('click', () => { resetAnimation(); }); const setPathMode = (mode, activeBtn) => { currentMode = mode; [btnSuccess, btnFailCaptcha, btnFailPassword, btnFailMultipart].forEach(b => { b.classList.remove('active'); }); activeBtn.classList.add('active'); resetAnimation(); }; btnSuccess.addEventListener('click', () => setPathMode('success', btnSuccess)); btnFailCaptcha.addEventListener('click', () => setPathMode('fail_captcha', btnFailCaptcha)); btnFailPassword.addEventListener('click', () => setPathMode('fail_password', btnFailPassword)); btnFailMultipart.addEventListener('click', () => setPathMode('fail_multipart', btnFailMultipart)); } // --- Core Animation Engine --- function resetAnimation() { if (animationFrameId) { cancelAnimationFrame(animationFrameId); } // Reset path styles completely document.querySelectorAll('.connection-path').forEach(p => { p.classList.remove('active-path'); p.style.stroke = ''; p.style.strokeWidth = ''; p.setAttribute('marker-end', 'url(#arrow)'); }); const container = document.getElementById('packets-container'); if (container) container.innerHTML = ''; currentStepIndex = 0; stepProgress = 0; isStepPausing = false; stepPauseTimeLeft = 0; lastTime = performance.now(); startStep(); animationFrameId = requestAnimationFrame(tick); } function startStep() { stepProgress = 0; isStepPausing = false; const step = modeSteps[currentMode][currentStepIndex]; const container = document.getElementById('packets-container'); container.innerHTML = ''; activePackets = []; step.paths.forEach(pathId => { const pathEl = document.getElementById(pathId); if (!pathEl) return; // Spawn a packet circle const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle'); circle.setAttribute('r', '5'); circle.setAttribute('fill', '#242424'); container.appendChild(circle); // Highlight active path segment pathEl.style.stroke = '#242424'; pathEl.style.strokeWidth = '2px'; pathEl.setAttribute('marker-end', 'url(#arrow-active)'); activePackets.push({ circle, pathEl, length: pathEl.getTotalLength() }); }); } function endStep() { const step = modeSteps[currentMode][currentStepIndex]; isStepPausing = true; stepPauseTimeLeft = step.pauseAfter; // Revert previous path visual styles activePackets.forEach(p => { p.pathEl.style.stroke = ''; p.style = ''; p.pathEl.style.strokeWidth = ''; p.pathEl.setAttribute('marker-end', 'url(#arrow)'); }); } function tick(timestamp) { if (!lastTime) lastTime = timestamp; const deltaTime = timestamp - lastTime; lastTime = timestamp; if (!isPaused) { const steps = modeSteps[currentMode]; const step = steps[currentStepIndex]; if (isStepPausing) { stepPauseTimeLeft -= deltaTime; if (stepPauseTimeLeft <= 0) { isStepPausing = false; currentStepIndex++; if (currentStepIndex >= steps.length) { currentStepIndex = 0; } startStep(); } } else { // Progress speed: complete segment in 800ms stepProgress += deltaTime / 800; if (stepProgress >= 1) { stepProgress = 1; drawPackets(1); endStep(); } else { drawPackets(easeInOutQuad(stepProgress)); } } } animationFrameId = requestAnimationFrame(tick); } function drawPackets(progress) { activePackets.forEach(p => { const pt = p.pathEl.getPointAtLength(progress * p.length); p.circle.setAttribute('cx', pt.x); p.circle.setAttribute('cy', pt.y); }); } function easeInOutQuad(t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; }