Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,724 changes: 2,144 additions & 1,580 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"alasql": "^4.19.1",
"JSCPP": "^2.0.9",
"lucide-react": "^0.469.0",
"mathjs": "^15.2.0",
"react": "^19.0.0",
Expand All @@ -23,6 +24,7 @@
"playwright": "^1.63.0",
"puppeteer": "^25.4.0",
"tailwindcss": "^4.0.0",
"vite": "^6.0.0"
"vite": "^6.0.0",
"vite-plugin-node-polyfills": "^0.28.0"
}
}
30 changes: 16 additions & 14 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ const ContactPage = lazy(() => import('./components/docs/ContactPage'));
const CpuSchedulerView = lazy(() => import('./components/os/CpuSchedulerView'));
const MemoryAllocatorView = lazy(() => import('./components/os/MemoryAllocatorView'));
const DBMSPlayground = lazy(() => import('./components/dbms/DBMSPlayground'));
const CodeCompiler = lazy(() => import('./components/compiler/CodeCompiler'));

// ═══════════════════════════════════════════════════════════
// Hash-based routing maps (for deep-linking & SEO)
// ═══════════════════════════════════════════════════════════
const VIEW_TO_HASH = {
Home: '', DBMS: '#dbms', CPU: '#cpu', Memory: '#memory', Disk: '#disk',
Home: '', DBMS: '#dbms', Compiler: '#compiler', CPU: '#cpu', Memory: '#memory', Disk: '#disk',
Page: '#page', Deadlock: '#deadlock', BinaryTree: '#binary-tree',
GraphVisualizer: '#graph', Terminal: '#terminal', Regex: '#regex',
ApiPlayground: '#api-playground', Networking: '#networking',
Expand Down Expand Up @@ -121,27 +122,27 @@ export default function App() {
<div className="min-h-screen bg-slate-50 text-slate-900 font-sans selection:bg-slate-300">
{/* === GLOBAL TOPBAR === */}
{currentView !== 'Home' && (
<TopBar
<TopBar
currentView={currentView}
currentTime={currentTime}
onFormatOS={handleGlobalReset}
onToggleSidebar={() => setIsSidebarOpen(prev => !prev)}
currentTime={currentTime}
onFormatOS={handleGlobalReset}
onToggleSidebar={() => setIsSidebarOpen(prev => !prev)}
/>
)}

{/* === SIDEBAR === */}
<Sidebar
currentView={currentView}
setView={navigateTo}
isOpen={isSidebarOpen}
setIsOpen={setIsSidebarOpen}
<Sidebar
currentView={currentView}
setView={navigateTo}
isOpen={isSidebarOpen}
setIsOpen={setIsSidebarOpen}
/>

{/* === MAIN CONTENT AREA === */}
<div className={`${currentView === 'Home' ? 'pt-0 md:pt-4' : 'pt-14'} min-h-screen flex flex-col transition-all duration-300 ${isSidebarOpen ? 'md:ml-64' : 'ml-0'}`}>
<main className={`flex-1 w-full mx-auto transition-all duration-300 ${currentView === 'DBMS' ? 'p-2 md:p-4 max-w-[1600px]' : 'p-4 md:p-6 lg:p-10 max-w-7xl'}`}>
<div key={currentView} className={`animate-in fade-in slide-in-from-bottom-4 duration-500 ${currentView === 'DBMS' ? 'h-[calc(100vh-6rem)]' : 'min-h-[500px]'}`}>
<main className={`flex-1 w-full mx-auto transition-all duration-300 ${currentView === 'DBMS' || currentView === 'Compiler' ? 'p-2 md:p-4 max-w-[1600px]' : 'p-4 md:p-6 lg:p-10 max-w-7xl'}`}>

<div key={currentView} className={`animate-in fade-in slide-in-from-bottom-4 duration-500 ${currentView === 'DBMS' || currentView === 'Compiler' ? 'h-[calc(100vh-6rem)]' : 'min-h-[500px]'}`}>
<ErrorBoundary viewName={currentView}>
<Suspense fallback={<PageSkeleton />}>
{/* === HOME & META === */}
Expand All @@ -168,6 +169,7 @@ export default function App() {
{currentView === 'GraphVisualizer' && <GraphVisualizer />}

{/* === DEVELOPER TOOLS === */}
{currentView === 'Compiler' && <CodeCompiler />}
{currentView === 'Terminal' && (
<div className="w-full max-w-4xl mx-auto">
<LinuxTerminal />
Expand All @@ -192,7 +194,7 @@ export default function App() {
{/* === OPERATING SYSTEMS === */}
{currentView === 'CPU' && <CpuSchedulerView globalResetTick={globalResetTick} />}
{currentView === 'Memory' && <MemoryAllocatorView globalResetTick={globalResetTick} />}

{currentView === 'Disk' && (
<div className="overflow-x-auto w-full">
<DiskScheduling />
Expand Down
65 changes: 31 additions & 34 deletions src/components/Sidebar.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React from 'react';
import {
Monitor,
Cpu,
X,
Rocket,
ChevronRight,
ChevronLeft,
Hash,
Layers,
HardDrive,
ShieldAlert,
Brain,
Boxes,
Database,
import {
Monitor,
Cpu,
X,
Rocket,
ChevronRight,
ChevronLeft,
Hash,
Layers,
HardDrive,
ShieldAlert,
Brain,
Boxes,
Database,
CircuitBoard,
Home,
Users,
Expand Down Expand Up @@ -41,6 +41,7 @@ export default function Sidebar({ currentView, setView, isOpen, setIsOpen }) {
group: "Developer Tools",
icon: <Terminal size={18} />,
items: [
{ id: 'Compiler', label: "In-Browser Codespace", icon: <Code2 size={14} /> },
{ id: 'Terminal', label: "Linux Terminal Simulator", icon: <Terminal size={14} /> },
{ id: 'Regex', label: "Regex Playground", icon: <Regex size={14} /> },
{ id: 'ApiPlayground', label: "REST API Playground", icon: <Globe size={14} /> },
Expand Down Expand Up @@ -125,7 +126,7 @@ export default function Sidebar({ currentView, setView, isOpen, setIsOpen }) {
<>
{/* Mobile Overlay */}
{isOpen && (
<div
<div
className="fixed inset-0 bg-slate-900/40 backdrop-blur-[2px] z-40 md:hidden transition-opacity duration-300"
onClick={() => setIsOpen(false)}
/>
Expand All @@ -138,23 +139,22 @@ export default function Sidebar({ currentView, setView, isOpen, setIsOpen }) {
${isOpen ? 'translate-x-0' : '-translate-x-full'}
md:pt-14
`}>

{/* Desktop Toggle Tab */}
<button
onClick={() => setIsOpen(!isOpen)}
className={`hidden md:flex absolute -right-5 top-1/2 -translate-y-1/2 w-5 h-16 border-l-0 rounded-r-md items-center justify-center transition-all shadow-sm cursor-pointer z-50 ${
currentView === 'Home'
? 'bg-white/60 backdrop-blur-md border border-white/60 text-slate-600 hover:bg-white/80 hover:text-slate-900 shadow-[2px_0_10px_rgba(0,0,0,0.08)]'
: 'bg-white border border-slate-200 text-slate-400 hover:text-slate-900 hover:bg-slate-50'
}`}
className={`hidden md:flex absolute -right-5 top-1/2 -translate-y-1/2 w-5 h-16 border-l-0 rounded-r-md items-center justify-center transition-all shadow-sm cursor-pointer z-50 ${currentView === 'Home'
? 'bg-white/60 backdrop-blur-md border border-white/60 text-slate-600 hover:bg-white/80 hover:text-slate-900 shadow-[2px_0_10px_rgba(0,0,0,0.08)]'
: 'bg-white border border-slate-200 text-slate-400 hover:text-slate-900 hover:bg-slate-50'
}`}
aria-label="Toggle Sidebar"
>
{isOpen ? <ChevronLeft size={14} /> : <ChevronRight size={14} />}
</button>

{/* Header / Logo */}
<div className="h-14 flex items-center justify-between px-5 border-b border-slate-100">
<button
<button
onClick={() => { setView('Home'); setIsOpen(false); }}
className="flex items-center gap-2.5 group cursor-pointer"
>
Expand All @@ -168,9 +168,9 @@ export default function Sidebar({ currentView, setView, isOpen, setIsOpen }) {
<span className="text-[9px] font-bold text-slate-400 uppercase tracking-widest mt-0.5">HUB_v3.0</span>
</div>
</button>

{/* Mobile Close Button (X) */}
<button
<button
onClick={() => setIsOpen(false)}
className="md:hidden p-1.5 text-slate-400 hover:text-slate-900 transition-colors cursor-pointer"
aria-label="Close sidebar"
Expand All @@ -183,22 +183,20 @@ export default function Sidebar({ currentView, setView, isOpen, setIsOpen }) {
<div className="px-3 pt-3 pb-2 space-y-0.5">
<button
onClick={() => { setView('Home'); setIsOpen(false); }}
className={`w-full flex items-center gap-3 px-3 py-2 text-xs font-bold transition-all group cursor-pointer ${
currentView === 'Home'
className={`w-full flex items-center gap-3 px-3 py-2 text-xs font-bold transition-all group cursor-pointer ${currentView === 'Home'
? 'bg-zinc-100 border-l-4 border-zinc-900 text-zinc-900'
: 'text-slate-500 hover:bg-slate-50 border-l-4 border-transparent'
}`}
}`}
>
<Home size={14} className={currentView === 'Home' ? 'text-zinc-900' : 'text-slate-400 group-hover:text-slate-600'} />
<span className="tracking-tight">Home</span>
</button>
<button
onClick={() => { setView('Contributors'); setIsOpen(false); }}
className={`w-full flex items-center gap-3 px-3 py-2 text-xs font-bold transition-all group cursor-pointer ${
currentView === 'Contributors'
className={`w-full flex items-center gap-3 px-3 py-2 text-xs font-bold transition-all group cursor-pointer ${currentView === 'Contributors'
? 'bg-zinc-100 border-l-4 border-zinc-900 text-zinc-900'
: 'text-slate-500 hover:bg-slate-50 border-l-4 border-transparent'
}`}
}`}
>
<Users size={14} className={currentView === 'Contributors' ? 'text-zinc-900' : 'text-slate-400 group-hover:text-slate-600'} />
<span className="tracking-tight">Contributors</span>
Expand All @@ -218,7 +216,7 @@ export default function Sidebar({ currentView, setView, isOpen, setIsOpen }) {
{subject.group}
</h2>
</div>

<div className="space-y-0.5">
{subject.items.map((item) => (
<button
Expand All @@ -228,11 +226,10 @@ export default function Sidebar({ currentView, setView, isOpen, setIsOpen }) {
setView(item.id);
setIsOpen(false);
}}
className={`w-full flex items-center justify-between px-3 py-2 text-xs font-bold transition-all group ${
currentView === item.id
className={`w-full flex items-center justify-between px-3 py-2 text-xs font-bold transition-all group ${currentView === item.id
? 'bg-zinc-100 border-l-4 border-zinc-900 text-zinc-900'
: 'text-slate-500 hover:bg-slate-50 border-l-4 border-transparent'
} ${item.comingSoon ? 'opacity-40 cursor-not-allowed' : 'cursor-pointer'}`}
} ${item.comingSoon ? 'opacity-40 cursor-not-allowed' : 'cursor-pointer'}`}
>
<div className="flex items-center gap-2.5">
<span className={`${currentView === item.id ? 'text-zinc-900' : 'text-slate-400 group-hover:text-slate-600'}`}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TopBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Menu, Clock, Trash2, Cpu } from 'lucide-react';
export default function TopBar({ currentView, currentTime, onFormatOS, onToggleSidebar }) {
return (
<header className="fixed top-0 left-0 right-0 z-50 h-14 bg-white/80 backdrop-blur-md border-b border-zinc-200 flex items-center justify-between px-4 md:px-6">

{/* Left Side */}
<div className="flex items-center gap-3">
{/* Hamburger */}
Expand Down
Loading
Loading