How byte-hunting/puzzle_net works
Project type and purpose
• From the file tree, this is a full-stack web application with:
• A Python “backend” (app.py, embeddings.py, search_similar.py, generate_embedding.py, utils, notebooks).
• A React “frontend” in the client/ directory (Vite + JSX components under client/src).
• Purpose: host and display chess puzzles, generate and store embeddings for similarity search, serve puzzles via a REST API, and allow users to browse/search puzzles in a grid UI.
File structure
Top-level:
• app.py – entry point for the web server/API.
• embeddings.py, generate_embedding.py, search_similar.py – scripts and modules for generating puzzle embeddings and searching by similarity.
• utils/fen_to_image.py – utility to render FEN strings as images.
• notebooks/parse_puzzles.ipynb – Jupyter notebook to parse raw puzzle data.
• requirements.txt – Python dependencies (Flask/FastAPI, embedding/vector libraries).
• build_index.py, clean_script.py – build and cleanup scripts for preprocessing or indexing.
client/:
• package.json, vite.config.js, eslint.config.js – React build/config.
• public/index.html – single-page app host.
• src/ – React components:
– PuzzlesGrid, PuzzleCard, PuzzleModal, MiniBoard (UI for displaying puzzles)
– api.js (client-side wrappers around backend HTTP calls)
– App.jsx – root React component.
(empty) README
• No additional architecture notes, so we infer from filenames and directory conventions.