A Puzzle game made from your own photos.
  • TypeScript 97.1%
  • Shell 1.4%
  • Dockerfile 1.2%
  • JavaScript 0.2%
  • CSS 0.1%
Find a file
Brian McGonagill 6ce5342cf0 Move puzzle controls to top nav bar and add Tray All Unlocked button
- Moved background settings, hint buttons to top navigation bar for better accessibility
- Added 'Tray All Unlocked' button to return all unlocked pieces to the tray
- Implemented trayAllUnlocked function in PuzzleEngine using imperative handle
- Exposed useHint function via imperative handle for parent component control
- Removed absolute positioned buttons from PuzzleEngine canvas
- Improved responsive layout with better button spacing on mobile
2026-07-25 09:59:20 -05:00
backend Add upload progress tracking, tray repositioning, background customization, and fix cluster locking 2026-07-25 09:51:11 -05:00
docker Add Docker production deployment and improve E2E tests 2026-07-22 19:56:17 -05:00
docs Add upload progress tracking, tray repositioning, background customization, and fix cluster locking 2026-07-25 09:51:11 -05:00
frontend Move puzzle controls to top nav bar and add Tray All Unlocked button 2026-07-25 09:59:20 -05:00
.dockerignore Add Docker production deployment and improve E2E tests 2026-07-22 19:56:17 -05:00
.env.example Complete privacy-first jigsaw puzzle platform 2026-07-18 06:40:27 -05:00
.env.production.example Add Docker production deployment and improve E2E tests 2026-07-22 19:56:17 -05:00
.gitignore Complete privacy-first jigsaw puzzle platform 2026-07-18 06:40:27 -05:00
AGENTS.md Complete privacy-first jigsaw puzzle platform 2026-07-18 06:40:27 -05:00
docker-compose.prod.yml Add Docker production deployment and improve E2E tests 2026-07-22 19:56:17 -05:00
docker-compose.yml Add photo thumbnails, improve puzzle state persistence, and fix frontend Dockerfile 2026-07-24 07:17:19 -05:00
Dockerfile Add upload progress tracking, tray repositioning, background customization, and fix cluster locking 2026-07-25 09:51:11 -05:00
init.sql Add Docker production deployment and improve E2E tests 2026-07-22 19:56:17 -05:00
LICENSE Initial commit 2026-07-17 20:49:22 +00:00
product_requirements.md Complete privacy-first jigsaw puzzle platform 2026-07-18 06:40:27 -05:00
README.md Add upload progress tracking, tray repositioning, background customization, and fix cluster locking 2026-07-25 09:51:11 -05:00
start.sh Add Docker production deployment and improve E2E tests 2026-07-22 19:56:17 -05:00

Privacy-First Custom Jigsaw Puzzle Platform

A privacy-focused web application that lets you create custom jigsaw puzzles from your own photos. Built with zero-knowledge encryption to ensure your photos remain private.

Features

  • Custom Puzzles: Create jigsaw puzzles from your own photos with adjustable difficulty (4-1000 pieces)
  • Zero-Knowledge Encryption: Optional client-side encryption ensures only you can view your encrypted photos
  • Progress Saving: Auto-saves puzzle progress every 15 seconds
  • Upload Progress Tracking: Real-time progress feedback with speed and ETA during photo uploads
  • Customizable Puzzle Background: Change puzzle area background color and opacity for better piece visibility
  • Responsive Design: Works seamlessly on desktop and mobile devices with automatic tray repositioning on orientation change
  • Dark Mode: Full dark mode support
  • Admin Dashboard: User management, site settings, and IP blocking
  • Wall of Glory: Showcase completed puzzles in a customizable gallery
  • Audit Logging: Track all user and admin actions

Tech Stack

Frontend

  • Next.js 16 (App Router)
  • TypeScript
  • Tailwind CSS
  • PixiJS (puzzle canvas rendering)

Backend

  • Node.js + Express
  • TypeScript
  • Lucia Auth (authentication)
  • PostgreSQL (database)
  • MinIO (S3-compatible object storage)
  • ClamAV (virus scanning)

Infrastructure

  • Docker Compose
  • Zero-knowledge encryption (Web Crypto API)

Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 20+ (for development)
  • npm or yarn (for development)

Option 1: Docker Hub Image (Easiest)

Pull and run the pre-built image with only the infrastructure services:

  1. Create a project directory and add the production compose file:
mkdir puzzle && cd puzzle
curl -sO https://raw.githubusercontent.com/<repo>/main/docker-compose.prod.yml
curl -sO https://raw.githubusercontent.com/<repo>/main/.env.production.example
cp .env.production.example .env
# Edit .env with your secure passwords
  1. Start everything:
docker compose -f docker-compose.prod.yml up -d
  1. Open http://localhost:8080 and register your first user (becomes admin automatically).

Services:

Option 2: Build from Source

  1. Clone the repository:
git clone <repository-url>
cd get_puzzles
  1. Copy and configure environment:
cp .env.production.example .env
# Edit .env with your secure passwords
  1. Build and start all services:
docker compose -f docker-compose.prod.yml up -d --build
  1. Open http://localhost:8080 in your browser

  2. Register your first user - they will automatically become an admin

Option 3: Development Setup

For local development with hot reload:

  1. Clone the repository:
git clone <repository-url>
cd get_puzzles
  1. Copy environment files:
cp .env.example backend/.env
cp .env.example frontend/.env.local
  1. Update environment variables in both .env files as needed.

  2. Start infrastructure services:

docker compose up -d postgres minio clamav
  1. Install and start the backend:
cd backend
npm install
npm run dev
  1. Install and start the frontend (in a new terminal):
cd frontend
npm install
npm run dev
  1. Open http://localhost:3002 in your browser

  2. Register your first user - they will automatically become an admin

View logs (production):

docker compose -f docker-compose.prod.yml logs -f

Stop all services:

docker compose -f docker-compose.prod.yml down

Stop and remove volumes:

docker compose -f docker-compose.prod.yml down -v

Option 2: Development Setup

For local development with hot reload:

  1. Clone the repository:
git clone <repository-url>
cd get_puzzles
  1. Copy environment files:
cp .env.example backend/.env
cp .env.example frontend/.env.local
  1. Update environment variables in both .env files as needed.

  2. Start infrastructure services:

docker compose up -d postgres minio clamav
  1. Install backend dependencies:
cd backend
npm install
  1. Install frontend dependencies:
cd ../frontend
npm install
  1. Start the backend:
cd backend
npm run dev
  1. Start the frontend (in a new terminal):
cd frontend
npm run dev
  1. Open http://localhost:3000 in your browser

  2. Register your first user - they will automatically become an admin

Documentation

Testing

Unit tests (81 tests):

cd backend
npm test

E2E tests (21 tests — requires running dev stack):

cd backend
npx playwright test

The project includes:

  • Unit tests covering auth, uploads, puzzle creation, hints, admin, user settings, and gallery
  • E2E tests covering registration, login, admin settings, photo upload, puzzle creation, and user settings

Security Features

  • Zero-Knowledge Encryption: Photos can be encrypted client-side before upload
  • Virus Scanning: All uploads scanned with ClamAV
  • Audit Logging: All actions logged for security review
  • IP Blocking: Admin can block suspicious IP addresses
  • Password Hashing: Argon2id password hashing
  • Session Management: Secure session handling with Lucia Auth

Project Structure

get_puzzles/
├── backend/              # Express API server
│   ├── src/
│   │   ├── controllers/  # Request handlers
│   │   ├── services/     # Business logic
│   │   ├── middleware/   # Express middleware
│   │   └── config/       # Configuration
│   └── e2e/              # Playwright E2E tests
├── frontend/             # Next.js application
│   ├── app/              # App router pages
│   ├── components/       # React components
│   └── lib/              # Utilities and API client
├── docker/               # Docker support files
│   ├── nginx.conf        # Reverse proxy config
│   └── entrypoint.sh     # Container startup script
├── docs/                 # Documentation
├── Dockerfile            # Multi-stage production build
├── docker-compose.yml    # Development compose
├── docker-compose.prod.yml # Production compose
├── init.sql              # Database schema
└── .env.production.example

Development Phases

  • Phase 1: Authentication (Login/Registration)
  • Phase 2: Photo Upload (with virus scanning)
  • Phase 3: Puzzle Creation (jigsaw cut algorithm)
  • Phase 4: Puzzle Solving (drag-and-drop, hints)
  • Phase 5: Admin Dashboard (user management, settings)
  • Phase 6: User Settings (profile, password, encryption)
  • Phase 7: Wall of Glory (gallery showcase)

Contributing

Contributions are welcome! Please ensure:

  • All tests pass (npm test)
  • Code follows existing patterns
  • New features include tests
  • Documentation is updated

License

MIT License - see LICENSE file for details

Support

For issues and feature requests, please use the GitHub issue tracker.