Skip to content

Pratyush150/Kairo_studio_website

Repository files navigation

Cerebral Machine

Interactive 3D Brain Visualization with Micro-Scenes

Vite React Three.js TypeScript


🧠 Overview

Cerebral Machine is a cutting-edge single-page web application featuring an interactive 3D brain visualization. Built with Three.js and React Three Fiber, it showcases three core business modules (SaaS, Automation, Integration) through immersive micro-scenes with GPU-accelerated particles, custom GLSL shaders, and scroll-driven animations.

Live Demo: http://152.67.2.20:3000


✨ Features

🎨 3D Visualization

  • Brain Core Model - Progressive LOD loading (lod0 β†’ lod1 β†’ lod2)
  • Emissive Fiber Shaders - Custom GLSL with animated displacement
  • GPU Particle Streams - InstancedBufferGeometry with thousands of particles
  • Interactive Modules - Clickable hotspots for SaaS, Automation, Integration

⚑ Performance

  • Adaptive Quality - Automatic adjustment based on device capabilities
  • Progressive Loading - Low-res first, high-res streaming
  • Asset Optimization - Draco compression, KTX2 textures
  • Target: 30-60 FPS on mid-range devices, <200MB peak memory

🎬 Animations

  • GSAP + ScrollTrigger - Scroll-driven state changes
  • Micro-Scene Timelines - Smooth transitions for module details
  • Camera Paths - Pre-baked rigs with cubic easing

β™Ώ Accessibility

  • Keyboard Navigation - Full Tab/Enter support
  • Screen Reader Compatible - ARIA attributes
  • Static Fallback - SVG/CSS hero for low-end devices
  • Skip 3D Toggle - Respect prefers-reduced-motion

πŸš€ Postprocessing

  • Bloom - Thresholded emissive glow
  • God-rays - Depth/occlusion-based
  • Temporal AA - Smooth anti-aliasing

πŸ› οΈ Tech Stack

Core

  • Vite - Build tool & dev server
  • React 18 - UI framework
  • TypeScript - Type safety

3D

  • Three.js - WebGL rendering engine
  • @react-three/fiber - React renderer for Three.js
  • @react-three/drei - Useful helpers (OrbitControls, Html, etc.)
  • @react-three/postprocessing - Effect composer

Animation

  • GSAP - Animation library
  • ScrollTrigger - Scroll-driven animations

Development

  • Leva - GUI controls for dev/debugging
  • ESLint - Code linting

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm 9+

Installation

# Clone repository
git clone https://github.com/Pratyush150/Kairo_studio_website.git cerebral-machine
cd cerebral-machine

# Install dependencies
npm install

# Start development server
npm run dev

Visit http://localhost:3000 to see the application.

Build for Production

# Create production build
npm run build

# Preview production build
npm run preview

πŸ“¦ Project Structure

cerebral-machine/
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ IMPLEMENTATION_SPEC.md    # Complete technical specification
β”‚   └── PHASES.md                  # 14-phase development roadmap
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ draco/                     # Draco decoder files
β”‚   └── basis/                     # KTX2 transcoder files
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ models/                # GLTF models (brain core, modules)
β”‚   β”‚   └── textures/              # KTX2 compressed textures
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ CanvasRoot.jsx         # r3f Canvas wrapper
β”‚   β”‚   β”œβ”€β”€ BrainScene.jsx         # Main 3D scene
β”‚   β”‚   β”œβ”€β”€ BrainCore.jsx          # Brain core with LOD (TODO)
β”‚   β”‚   β”œβ”€β”€ ModuleMicroScene.jsx   # Module detail views (TODO)
β”‚   β”‚   β”œβ”€β”€ HUDOverlay.jsx         # HTML overlay (TODO)
β”‚   β”‚   └── FallbackHero.jsx       # Static fallback (TODO)
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ loaders.js             # DRACO, KTX2, GLTF loaders (TODO)
β”‚   β”‚   └── shaders/
β”‚   β”‚       β”œβ”€β”€ fiberShader.glsl   # Emissive fiber shader (TODO)
β”‚   β”‚       └── particleShader.glsl # GPU particle shader (TODO)
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ perf.js                # Adaptive quality manager (TODO)
β”‚   β”‚   └── analytics.js           # Analytics tracking (TODO)
β”‚   β”œβ”€β”€ App.jsx                    # Root component
β”‚   β”œβ”€β”€ main.jsx                   # Entry point
β”‚   └── index.css                  # Global styles
β”œβ”€β”€ scripts/
β”‚   └── optimize-assets.js         # Asset compression pipeline (TODO)
β”œβ”€β”€ index.html                     # HTML entry point
β”œβ”€β”€ vite.config.js                 # Vite configuration
β”œβ”€β”€ tsconfig.json                  # TypeScript config
└── package.json                   # Dependencies

πŸ“Š Development Roadmap

Current Phase: Phase 1 - Foundation & Setup βœ… COMPLETED

Completed

  • βœ… Phase 1: Foundation & Setup (100%)
    • Clean project structure
    • Vite + React + TypeScript configured
    • All core dependencies installed
    • Basic canvas rendering working
    • Project documentation in place

Next Steps

  • ⏳ Phase 2: Loaders & Asset Pipeline
  • ⏳ Phase 3: Brain Core & LOD System
  • ⏳ Phase 4: Shaders & Materials
  • ⏳ Phase 5: Module Hotspots & Interaction
  • ⏳ Phase 6: Micro-Scenes
  • ⏳ Phase 7: GSAP & Scroll Integration
  • ⏳ Phase 8: Postprocessing & Effects
  • ⏳ Phase 9: Performance & Optimization
  • ⏳ Phase 10: Accessibility & Fallbacks
  • ⏳ Phase 11: Analytics & Monitoring
  • ⏳ Phase 12: CI/CD & Deployment
  • ⏳ Phase 13: Testing & QA
  • ⏳ Phase 14: Polish & Launch

Overall Progress: 7% (1/14 phases complete)

See docs/PHASES.md for detailed roadmap.


πŸ“š Documentation

Main Documentation

Key Sections

  • High-level architecture
  • Loader strategy & code patterns
  • Shader architecture (GLSL examples)
  • Micro-scenes implementation
  • Performance budgets & targets
  • Progressive enhancement strategy
  • CI/CD pipeline
  • Testing checklist

🎯 Performance Targets

Metric Target
Initial JS Bundle ≀ 150 KB gzipped
First Meaningful Paint < 1.5 MB total
First 3D Interactive < 2.5 MB assets
Peak Memory (Mobile) < 200 MB
FPS (Mid-range) 30-60 FPS
FPS (Desktop) 50-60 FPS

Enforcement: CI with Lighthouse thresholds


πŸ”§ Development

Available Scripts

npm run dev      # Start development server (port 3000)
npm run build    # Build for production
npm run preview  # Preview production build
npm run lint     # Run ESLint

Environment

The dev server runs on:

Key Technologies

3D Rendering:

  • Three.js (WebGL engine)
  • react-three-fiber (React renderer)
  • @react-three/drei (helpers)

Animation:

  • GSAP (core animations)
  • ScrollTrigger (scroll-driven)

Performance:

  • Draco compression (models)
  • KTX2/Basis textures
  • LOD (Level of Detail)
  • InstancedBufferGeometry

🀝 Contributing

This project follows a phased development approach. See docs/PHASES.md for the current phase and tasks.

Development Guidelines

  • Follow TypeScript strict mode
  • Use functional React components
  • Optimize for performance (draw calls, memory)
  • Test on target devices (mid-range Android, iPhone)
  • Document complex shaders and algorithms

πŸ“„ License

MIT License - See LICENSE file for details


πŸ™ Acknowledgments

  • Three.js Team - Powerful WebGL engine
  • Poimandres - React Three Fiber & Drei
  • GreenSock - GSAP animation platform
  • Vite - Lightning-fast build tool

πŸ“ž Support

For questions or support:

  • πŸ“– Documentation: See /docs folder
  • πŸ› Issues: GitHub Issues

🌟 Project Status

Status: βœ… Phase 1 Complete - Foundation Ready Next: Phase 2 - Loaders & Asset Pipeline Live: http://152.67.2.20:3000

Built with ❀️ using React Three Fiber


Last Updated: November 2025 Version: 1.0.0 (Phase 1) Framework: Vite + React + Three.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors