How aldenhallak/fishes works
Project type and purpose
• DrawAFish.com is a browser‐based, client‐heavy interactive drawing application. It uses an ONNX neural network in the browser for real-time fish drawing validation, Firebase for real-time data sync, and a serverless backend (fish-be) for image processing, persistence, and moderation endpoints.
File structure
• Root HTML pages (index.html, tank.html, rank.html, login.html, moderation.html, etc.) form distinct UI “views.”
• src/js/ contains page controllers and shared utilities:
• app.js drives the drawing canvas and ONNX inference.
• tank.js, rank.js, login.js, moderation.js, etc., each handle a specific view’s logic.
• firebase-init.js and fish-utils.js initialize Firebase and encapsulate all API/Firestore calls.
• src/css/ holds style definitions scoped by page or component.
• fish_doodle_classifier.onnx is the client-side ML model.
• No monolithic backend code here: it’s a static site that calls out to a separate serverless backend (fish-be).
Key insights from the README
• The ONNX model runs entirely in the browser (ONNX Runtime Web).
• Firebase/Firestore is used for real-time updates (community tank, votes, profiles).
• A serverless backend (Cloud Run or equivalent) handles uploads, moderation endpoints, and persists canonical images.
• Static assets are deployed to a CDN or static hosting service (e.g., Netlify, Vercel, Firebase Hosting).