How orebenson/pixel_patches works
Pixel Patches is a web app for creating and sharing unique 8×8 pixel-art patches, with user accounts and password-reset flows. Users create or browse patches in the frontend; its API services issue HTTP requests to the Express backend, which routes and validates requests, applies authentication, and delegates to patch or user services backed by MongoDB. Account management also includes reset tokens and email delivery. Frontend-to-backend HTTP links are shown as unverified because the excerpts show matching endpoint paths but not deployment or client/server wiring; unsampled page behavior is not inferred.
Main entry points: patch-router.ts Patch routes · user-router.ts User routes · auth.ts Authentication and reset flows · app.ts Express app and sessions
Components 30
Frontend
- Patch editor and gallery
frontend/src/js/scripts/canvas-scripts.js - Patch list UI
frontend/src/js/scripts/patches-scripts.js - Login and registration UI
frontend/src/js/scripts/login-scripts.js - Account UI
frontend/src/js/scripts/account-scripts.js - Password reset UI
frontend/src/js/scripts/newpassword-scripts.js - Navbar state
frontend/src/js/utils/navbar-utils.js - Pixel conversion
frontend/src/js/utils/conversion-utils.js - Patch API client
frontend/src/js/api/patches-service.js - Account API client
frontend/src/js/api/login-service.js - HTTP transport
frontend/src/js/api/api.js
Backend routing
- API route mounting
backend/src/api/routes/routes.ts - Patch routes
backend/src/api/routes/patch-router.ts - User routes
backend/src/api/routes/user-router.ts - Hello route
backend/src/api/routes/hello-router.ts - Request and response helpers
backend/src/api/utils/api-utils.ts - Request validation
backend/src/api/middleware/validation.ts - Express app and sessions
backend/src/app.ts - Logger
backend/src/api/utils/log-utils.ts
Accounts and security
- Authentication and reset flows
backend/src/api/middleware/auth.ts - User operations
backend/src/api/services/user-service.ts - Reset-token operations
backend/src/api/services/token-service.ts - Reset email delivery
backend/src/api/utils/email-utils.ts - User model
backend/src/api/schemas/user-schema.ts - Token model
backend/src/api/schemas/token-schema.ts
Patch domain and storage
- Patch operations
backend/src/api/services/patch-service.ts - Patch model
backend/src/api/schemas/patch-schema.ts - Database utilities
backend/src/api/utils/db-utils.ts
Other components
- Visitor
- MongoDB
- Email service
Connections 39
- Visitor → Patch editor and gallery: creates or browses
README.md - Visitor → Login and registration UI: manages account
README.md - Patch editor and gallery → Patch API client: requests patches
frontend/src/js/scripts/canvas-scripts.js - Patch list UI → Patch API client: requests patches
frontend/src/js/scripts/patches-scripts.js - Patch editor and gallery → Pixel conversion: converts pixels
frontend/src/js/scripts/canvas-scripts.js - Login and registration UI → Account API client: sends account requests
frontend/src/js/scripts/login-scripts.js - Account UI → Account API client: sends account requests
frontend/src/js/scripts/account-scripts.js - Password reset UI → Account API client: sends reset request
- Login and registration UI → Navbar state: updates navigation
frontend/src/js/scripts/login-scripts.js - Account UI → Navbar state: updates navigation
frontend/src/js/scripts/account-scripts.js - Patch editor and gallery → Navbar state: updates navigation
frontend/src/js/scripts/canvas-scripts.js - Patch list UI → Navbar state: updates navigation
frontend/src/js/scripts/patches-scripts.js - Patch API client → HTTP transport: uses HTTP
frontend/src/js/api/patches-service.js - Account API client → HTTP transport: uses HTTP
frontend/src/js/api/login-service.js - HTTP transport → Patch routes: calls patch endpoints
- HTTP transport → User routes: calls user endpoints
- Express app and sessions → API route mounting: mounts routes
backend/src/app.ts - API route mounting → Patch routes: mounts router
backend/src/api/routes/routes.ts - API route mounting → User routes: mounts router
backend/src/api/routes/routes.ts - API route mounting → Hello route: mounts router
backend/src/api/routes/routes.ts - Patch routes → Authentication and reset flows: checks session
backend/src/api/routes/patch-router.ts - Patch routes → Request validation: validates input
backend/src/api/routes/patch-router.ts - Patch routes → Patch operations: dispatches operations
backend/src/api/routes/patch-router.ts - Patch routes → Request and response helpers: wraps service requests
backend/src/api/routes/patch-router.ts - User routes → Authentication and reset flows: handles account flows
backend/src/api/routes/user-router.ts - User routes → Request validation: validates input
backend/src/api/routes/user-router.ts - User routes → User operations: registers users
backend/src/api/routes/user-router.ts - User routes → Request and response helpers: wraps service requests
backend/src/api/routes/user-router.ts - Authentication and reset flows → User operations: reads and updates users
backend/src/api/middleware/auth.ts - Authentication and reset flows → Reset-token operations: manages reset tokens
backend/src/api/middleware/auth.ts - Authentication and reset flows → Reset email delivery: sends reset email
backend/src/api/middleware/auth.ts - User operations → User model: reads and writes
backend/src/api/services/user-service.ts - Reset-token operations → Token model: reads and writes
backend/src/api/services/token-service.ts - Patch operations → Patch model: reads and writes
backend/src/api/services/patch-service.ts - Reset email delivery → Email service: delivers email
- Express app and sessions → MongoDB: connects and stores sessions
backend/src/app.ts - Express app and sessions → Database utilities: cleans collections
backend/src/app.ts - Database utilities → MongoDB: operates on database
- Express app and sessions → Logger: logs requests
backend/src/app.ts