Creative GLSL Shader Gallery — Write, preview, and share real-time fragment shaders.
A full-stack web application demonstrating modern software engineering practices, real-time WebGL rendering, and production deployment patterns.
docker compose upThen open http://localhost:5173 for the frontend, or http://localhost:3001/api/health for the API health check.
The database seeds automatically on first run with 10 beautiful pre-made shaders.
┌─────────────┐ ┌──────────────┐ ┌────────────┐
│ React SPA │────▶│ Express API │────▶│ SQLite │
│ (Vite) │ │ (Node.js) │ │ (Prisma) │
│ Port 5173 │ │ Port 3001 │ │ │
└─────────────┘ └──────────────┘ └────────────┘
- Frontend: React 18 + TypeScript + Vite + React Router
- Backend: Node.js + Express + TypeScript + Prisma ORM
- Database: SQLite (via Prisma, zero-config)
- Rendering: Raw WebGL fragment shader pipeline (no Three.js or frameworks)
- Containerization: Docker + docker compose (dev + prod configs)
| Layer | Technology |
|---|---|
| Frontend | React 18, TypeScript, Vite |
| Routing | React Router v6 |
| Backend | Express 4, TypeScript |
| ORM | Prisma (SQLite provider) |
| Rendering | WebGL 1.0 (native canvas) |
| Styling | CSS custom properties, DM Sans, JetBrains Mono |
| Dev Tools | ESLint, tsx (TypeScript runner) |
| CI/CD | GitHub Actions |
| Deployment | Docker, docker compose, Nginx |
shaderlab/
├── frontend/ # React + TypeScript + Vite
│ ├── src/
│ │ ├── components/ # Navbar, Footer, WebGLPreview, ShaderCard, etc.
│ │ ├── pages/ # Gallery, ShaderView, ShaderEditor
│ │ ├── hooks/ # useShaders (data fetching)
│ │ ├── lib/ # API client
│ │ ├── App.tsx # Router setup
│ │ └── main.tsx # Entry point
│ ├── Dockerfile # Dev Dockerfile
│ ├── Dockerfile.prod # Production Dockerfile (Nginx + static build)
│ └── nginx.conf # Nginx config for production
├── backend/ # Node.js + Express + TypeScript
│ ├── src/
│ │ ├── routes/ # REST API routes (shaders CRUD)
│ │ ├── lib/ # Prisma client singleton
│ │ └── index.ts # Express server entry
│ ├── prisma/
│ │ ├── schema.prisma # Data model
│ │ └── seed.ts # Seed data (10 shaders)
│ ├── Dockerfile # Dev Dockerfile
│ └── Dockerfile.prod # Production Dockerfile
├── docker-compose.yml # Development setup
├── docker-compose.prod.yml # Production-like setup
├── .github/workflows/ci.yml # CI pipeline
└── README.md
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/shaders |
List shaders (paginated, searchable) |
| GET | /api/shaders/:id |
Get single shader |
| POST | /api/shaders |
Create new shader |
| PUT | /api/shaders/:id |
Update shader |
| DELETE | /api/shaders/:id |
Delete shader |
| GET | /api/health |
Health check |
Query parameters for GET /api/shaders:
page— page number (default: 1)limit— items per page (default: 12, max: 50)search— full-text search across title, description, and tagscategory— filter by exact category matchtag— filter by tag substring
Backend:
cd backend
npm install
npx prisma generate
npx prisma migrate dev --name init
npx tsx prisma/seed.ts
npm run devFrontend:
cd frontend
npm install
npm run dev# Backend
cd backend && npm run typecheck && npm run lint
# Frontend
cd frontend && npm run typecheck && npm run lintThe app ships with 10 pre-made GLSL fragment shaders:
- Cosmic Bloom — Fractal noise with shifting color harmonies
- Raymarch Primitives — Real-time ray marching with soft shadows
- Voronoi Cells — Animated cellular noise patterns
- Ocean Depths — Layered sine waves with caustic highlights
- Neon Tunnel — Retro-futuristic synthwave tunnel
- Plasma Flow — Classic demo-scene plasma effect
- Geometric Dance — Rotating geometric shapes
- Fire Nebula — FBM noise fire simulation
- Kaleidoscope Dreams — Symmetric kaleidoscopic patterns
- Electric Storm — Procedural lightning arcs
docker compose -f docker-compose.prod.yml up --buildThe production setup uses:
- Frontend: Nginx serving static files, proxying
/api/to backend - Backend: Compiled TypeScript running on Node.js
- Database: SQLite with volume-mounted data directory
MIT
