Skip to content

Commit 400a0cd

Browse files
committed
Add demo images, Docker setup, and update README with screenshots
1 parent 15872ee commit 400a0cd

File tree

10 files changed

+265
-8
lines changed

10 files changed

+265
-8
lines changed

.dockerignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Dependencies
2+
node_modules
3+
4+
# Build output
5+
dist
6+
build
7+
8+
# Development files
9+
.git
10+
.gitignore
11+
.env
12+
.env.local
13+
.env.*.local
14+
15+
# IDE and editor files
16+
.vscode
17+
.idea
18+
*.swp
19+
*.swo
20+
21+
# Logs
22+
*.log
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# OS files
28+
.DS_Store
29+
Thumbs.db
30+
31+
# Docker files
32+
Dockerfile
33+
DockerFile
34+
.dockerignore
35+
docker-compose*.yml
36+
37+
# Documentation
38+
README.md
39+
LICENSE
40+
41+
# Test files
42+
coverage
43+
*.test.ts
44+
*.test.tsx
45+
*.spec.ts
46+
*.spec.tsx
47+
48+
# Misc
49+
.eslintcache
50+
.npm
51+
.yarn

DockerFile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build stage
2+
FROM node:20-alpine AS builder
3+
4+
WORKDIR /app
5+
6+
# Copy package files
7+
COPY package*.json ./
8+
COPY bun.lockb ./
9+
10+
# Install dependencies
11+
RUN npm ci --legacy-peer-deps
12+
13+
# Copy source code
14+
COPY . .
15+
16+
# Build the application
17+
RUN npm run build
18+
19+
# Production stage
20+
FROM nginx:alpine AS production
21+
22+
# Copy custom nginx config
23+
COPY nginx.conf /etc/nginx/conf.d/default.conf
24+
25+
# Copy built assets from builder stage
26+
COPY --from=builder /app/dist /usr/share/nginx/html
27+
28+
# Expose port 80
29+
EXPOSE 80
30+
31+
# Start nginx
32+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 134 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[![Three.js](https://img.shields.io/badge/Three.js-3D-000000?style=for-the-badge&logo=three.js&logoColor=white)](https://threejs.org/)
1212
[![Vite](https://img.shields.io/badge/Vite-5+-646CFF?style=for-the-badge&logo=vite&logoColor=white)](https://vitejs.dev/)
1313
[![Tailwind CSS](https://img.shields.io/badge/Tailwind-3+-06B6D4?style=for-the-badge&logo=tailwindcss&logoColor=white)](https://tailwindcss.com/)
14+
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/)
1415

1516
[![Live Demo](https://img.shields.io/badge/🌐_Live_Demo-Click_Here-286EFF?style=for-the-badge)](https://bb84-simulation.vercel.app/)
1617
[![GitHub Stars](https://img.shields.io/github/stars/PRODHOSH/bb84_simulation?style=for-the-badge&color=AA50FF)](https://github.com/PRODHOSH/bb84_simulation/stargazers)
@@ -20,7 +21,54 @@
2021

2122
---
2223

23-
## � Overview
24+
## 🎬 Demo & Screenshots
25+
26+
<div align="center">
27+
28+
### 🌟 3D Quantum Simulation in Action
29+
30+
<img src="https://raw.githubusercontent.com/PRODHOSH/bb84_simulation/main/public/images/demo/simulation-demo.gif" alt="3D Simulation Demo" width="80%"/>
31+
32+
*Real-time photon transmission with polarization states*
33+
34+
</div>
35+
36+
<table>
37+
<tr>
38+
<td width="50%">
39+
<img src="https://raw.githubusercontent.com/PRODHOSH/bb84_simulation/main/public/images/demo/home-page.png" alt="Home Page"/>
40+
<p align="center"><b>Home Page</b> - Quantum-themed landing</p>
41+
</td>
42+
<td width="50%">
43+
<img src="https://raw.githubusercontent.com/PRODHOSH/bb84_simulation/main/public/images/demo/simulation-page.png" alt="Simulation Page"/>
44+
<p align="center"><b>3D Simulation</b> - Interactive photon visualization</p>
45+
</td>
46+
</tr>
47+
<tr>
48+
<td width="50%">
49+
<img src="https://raw.githubusercontent.com/PRODHOSH/bb84_simulation/main/public/images/demo/theory-page.png" alt="Theory Page"/>
50+
<p align="center"><b>Theory</b> - Educational content</p>
51+
</td>
52+
<td width="50%">
53+
<img src="https://raw.githubusercontent.com/PRODHOSH/bb84_simulation/main/public/images/demo/analytics-dashboard.png" alt="Analytics Dashboard"/>
54+
<p align="center"><b>Analytics</b> - Real-time charts & metrics</p>
55+
</td>
56+
</tr>
57+
</table>
58+
59+
<div align="center">
60+
61+
### 🔬 Photon Polarization States
62+
63+
<img src="https://raw.githubusercontent.com/PRODHOSH/bb84_simulation/main/public/images/demo/polarization-states.png" alt="Polarization States" width="60%"/>
64+
65+
*Four quantum polarization states: Vertical, Horizontal, Diagonal, Anti-diagonal*
66+
67+
</div>
68+
69+
---
70+
71+
## 🔭 Overview
2472

2573
> **Experience quantum cryptography like never before** - Watch individual photons travel through space in real-time 3D as they establish an unbreakable secret key!
2674
@@ -158,6 +206,78 @@ npm run preview
158206

159207
---
160208

209+
## 🐳 Docker Deployment
210+
211+
### Quick Start with Docker
212+
213+
```bash
214+
# Build the Docker image
215+
docker build -t bb84-simulation .
216+
217+
# Run the container
218+
docker run -p 3000:80 bb84-simulation
219+
220+
# Access at http://localhost:3000
221+
```
222+
223+
### Docker Compose (Optional)
224+
225+
Create a `docker-compose.yml`:
226+
227+
```yaml
228+
version: '3.8'
229+
services:
230+
bb84-simulator:
231+
build: .
232+
ports:
233+
- "3000:80"
234+
restart: unless-stopped
235+
```
236+
237+
Then run:
238+
239+
```bash
240+
docker-compose up -d
241+
```
242+
243+
### Docker Architecture
244+
245+
```
246+
┌─────────────────────────────────────────────────────────┐
247+
│ Docker Container │
248+
├─────────────────────────────────────────────────────────┤
249+
│ ┌─────────────────────────────────────────────────┐ │
250+
│ │ Nginx (Alpine) │ │
251+
│ │ - Serves static files from /dist │ │
252+
│ │ - Gzip compression enabled │ │
253+
│ │ - SPA routing (fallback to index.html) │ │
254+
│ │ - Asset caching (1 year for /assets/) │ │
255+
│ │ - Security headers configured │ │
256+
│ └─────────────────────────────────────────────────┘ │
257+
│ │ │
258+
│ ▼ │
259+
│ ┌─────────────────────────────────────────────────┐ │
260+
│ │ Built React App (/dist) │ │
261+
│ │ - Optimized production bundle │ │
262+
│ │ - Code-split chunks (react, three, ui) │ │
263+
│ │ - Minified JS/CSS │ │
264+
│ └─────────────────────────────────────────────────┘ │
265+
│ │
266+
│ Port 80 ──────────────────────────────► Host Port 3000 │
267+
└─────────────────────────────────────────────────────────┘
268+
```
269+
270+
### Multi-Stage Build Process
271+
272+
| Stage | Base Image | Purpose |
273+
|-------|------------|---------|
274+
| **Builder** | `node:20-alpine` | Install deps, build app |
275+
| **Production** | `nginx:alpine` | Serve static files |
276+
277+
**Final Image Size**: ~50MB (optimized Alpine images)
278+
279+
---
280+
161281
## 🎯 How to Use
162282

163283
<div align="center">
@@ -241,16 +361,22 @@ graph TB
241361
![Vite](https://img.shields.io/badge/-Vite-646CFF?style=flat-square&logo=vite&logoColor=white)
242362
![Tailwind CSS](https://img.shields.io/badge/-Tailwind-06B6D4?style=flat-square&logo=tailwindcss&logoColor=white)
243363
![Shadcn/ui](https://img.shields.io/badge/-Shadcn/ui-000000?style=flat-square&logo=shadcnui&logoColor=white)
364+
![Docker](https://img.shields.io/badge/-Docker-2496ED?style=flat-square&logo=docker&logoColor=white)
365+
![Nginx](https://img.shields.io/badge/-Nginx-009639?style=flat-square&logo=nginx&logoColor=white)
366+
![Supabase](https://img.shields.io/badge/-Supabase-3ECF8E?style=flat-square&logo=supabase&logoColor=white)
244367

245368
</div>
246369

247-
**Frontend Framework**: React 18 with TypeScript
248-
**3D Graphics**: Three.js + React Three Fiber
249-
**Build Tool**: Vite 5
250-
**Styling**: Tailwind CSS + Shadcn/ui components
251-
**State Management**: React Context API
252-
**Animations**: Framer Motion
253-
**Routing**: React Router v6
370+
| Category | Technologies |
371+
|----------|--------------|
372+
| **Frontend** | React 18, TypeScript 5, Vite 5 |
373+
| **3D Graphics** | Three.js, React Three Fiber, React Three Drei |
374+
| **Styling** | Tailwind CSS, Shadcn/ui, Radix UI |
375+
| **State** | React Context, TanStack Query |
376+
| **Backend** | Supabase (PostgreSQL, Auth) |
377+
| **Charts** | Recharts |
378+
| **Routing** | React Router v6 |
379+
| **Deployment** | Docker, Nginx, Vercel |
254380

255381
---
256382

nginx.conf

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
7+
# Gzip compression
8+
gzip on;
9+
gzip_vary on;
10+
gzip_min_length 1024;
11+
gzip_proxied expired no-cache no-store private auth;
12+
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript application/json;
13+
14+
# Cache static assets
15+
location /assets/ {
16+
expires 1y;
17+
add_header Cache-Control "public, immutable";
18+
}
19+
20+
# Cache images
21+
location /images/ {
22+
expires 1y;
23+
add_header Cache-Control "public, immutable";
24+
}
25+
26+
# Cache docs
27+
location /docs/ {
28+
expires 1d;
29+
add_header Cache-Control "public";
30+
}
31+
32+
# SPA fallback - redirect all requests to index.html
33+
location / {
34+
try_files $uri $uri/ /index.html;
35+
}
36+
37+
# Security headers
38+
add_header X-Frame-Options "SAMEORIGIN" always;
39+
add_header X-Content-Type-Options "nosniff" always;
40+
add_header X-XSS-Protection "1; mode=block" always;
41+
42+
# Error pages
43+
error_page 404 /index.html;
44+
error_page 500 502 503 504 /50x.html;
45+
location = /50x.html {
46+
root /usr/share/nginx/html;
47+
}
48+
}
90.9 KB
Loading

public/images/demo/home-page.png

203 KB
Loading
67.1 KB
Loading
8.64 MB
Loading
232 KB
Loading

public/images/demo/theory-page.png

264 KB
Loading

0 commit comments

Comments
 (0)