How mr-rahul-paul/quantum-sim-hackiiitv works
Project Type and Purpose
• This is a full-stack web application built with Next.js and TypeScript. Its purpose is to provide an interactive quantum chemistry simulation (Variational Quantum Eigensolver) by combining a rich React-based UI, serverless API routes, and a standalone TypeScript backend that orchestrates calls to IBM Quantum APIs, an AI prediction model, and a MongoDB database.
File Structure
• app/
• “Project-Overview”, “curated-list”, “details”, “simulation” pages under the Next.js 13 “app” router
• serverless API routes in app/api/predict/route.ts and app/api/simulate/route.ts
• layout.tsx, globals.css – global layout and styling
• backend/
• main.ts – standalone TypeScript backend (likely Express or similar) listening on port 8000
• interfaces with IBM Quantum API, AI model, and MongoDB
• assets/ and public/ – static assets & video content
• Configuration & tooling
• next.config.ts, tsconfig.json – Next.js and TypeScript config
• package.json, package-lock.json – dependencies, scripts
• eslint.config.mjs, postcss.config.mjs – linting and CSS tooling
README
• Tech Stack confirms: Next.js front-end, TypeScript, Framer Motion, IBM Quantum APIs, AI model, MongoDB
• There’s a backend TypeScript API server for quantum calculations
• Environment variables: NEXT_PUBLIC_API_URL, MONGODB_ATLAS_URI, IBMQ_API_TOKEN
• Deployment: Frontend on Vercel, backend on a separate Node host or serverless function
Components & Interactions
a. Main Components
– Client Browser (React UI)
– Next.js Frontend (Pages & SSR)
– Next.js Serverless API Routes (“/api/predict”, “/api/simulate”)
– Standalone Backend Service (Node/Express in backend/main.ts)
– AI Prediction Model (internal to backend)
– IBM Quantum Cloud Service
– MongoDB Atlas Database
– Static Asset Store (Vercel or CDN)
b. Relationships & Data Flow
– Client → Next.js Pages (SSR or CSR)
– Pages → Serverless API Routes (fetch)
– API Routes ↔ Backend Service (HTTP POST to NEXT_PUBLIC_API_URL)
– Backend → IBM Quantum API (POST quantum circuits & retrieve results)
– Backend → AI Model (local inference or separate microservice)
– Backend ↔ MongoDB Atlas (read/write user data or simulation history)
– Static assets served from CDN/public
c. Architectural Patterns & Principles
– Separation of Concerns: UI vs. API vs. Quantum compute
– Serverless functions (Next.js app/api) for low-latency endpoints
– Dedicated long-running backend for compute-intensive tasks
– Environment-driven configuration for stage-wise deployment
d. Key Technologies & Frameworks
– Next.js 13 (app router, React 18)
– TypeScript end-to-end
– Framer Motion for animations
– Node/Express-style backend
– IBMQ REST APIs
– AI model (TensorFlow/PyTorch?) embedded in backend
– MongoDB Atlas