How charlesclapshaw/charlesclapshaw_dev2test works
Purpose and Runtime
A Node.js/Firebase-backed artwork commerce site, serving a largely static Webflow-generated frontend and exposing server-rendered artwork routes. Root entry points are app.js and server.js; deployment is defined by firebase.json and containerized via Dockerfile.
Static Web Client
Firebase Hosting likely serves public/, containing the primary landing page, artwork pages, styles, and browser scripts. The public UI has several artwork-page iterations, with the active architecture centered on:
• public/index.html
• public/artwork-node.html
• public/app.js
• public/firebase.js
• public/stripe.js
Browser code is responsible for Firebase client integration, artwork-page behavior, and initiating Stripe-related checkout interactions.
Dynamic Artwork Routing
The backend separates route wiring from artwork lookup and HTML/page assembly:
• src/routes/artwork.js
• src/endpoints/artworkBySlug.js
• src/services/artworkSlug.js
• src/services/artworkPage.js
The expected request flow is an artwork slug request → route/endpoint → slug resolution → page/content generation or response. This is the boundary between static Webflow assets and dynamic catalog presentation.
Firestore Artwork Access
Firestore-specific artwork data access is isolated in:
• lib/firestoreArtwork.js
• firestore.rules
• firestore.indexes.json
This layer is the persistence boundary used to retrieve artwork records. Firestore rules control client/server data authorization; indexes support catalog query patterns. A Firestore export exists under firebase/, indicating local/exported project data rather than application source.
Checkout and Stripe Boundary
Stripe handling is split between client-facing scripts and server middleware:
• public/stripe.js
• public/checkout-confirmation.js
• src/middleware/stripe.js
• public/server/endpoints/checkout-confirmation.html
Frontend code initiates or confirms checkout UX; backend middleware should own secret-key-dependent Stripe operations. Keep payment session creation, verification, and trusted transaction state out of public scripts.
Firebase Infrastructure
Firebase is the principal platform: Hosting for public/, Firestore for artwork data, and likely server/function-style routing for Node handlers. Core infrastructure artifacts are:
• firebase.json
• .firebaserc
• storage.rules
• firestore.rules
Cloud Storage rules indicate an asset-upload/storage boundary, likely for artwork media. The repository contains Firebase-oriented agent documentation, but these files are development guidance rather than runtime code.
Operational Boundaries
package.json and package-lock.json define the Node dependency/runtime contract. Dockerfile provides a deployable server image, making server.js/app.js potentially usable outside Firebase Hosting as well. The architecture should preserve a strict split: public static assets and browser Firebase SDK usage in public/; trusted routing, Firestore server access, and Stripe secrets in root/server-side src/ and lib/.
Main entry points: app.js Artwork behavior · stripe.js Checkout client · artworkBySlug.js Artwork-by-slug endpoint · firebase.json Firebase Hosting
Components 21
Browser client
- Webflow static UI
- Landing page
public/index.html - Artwork page UI
public/artwork-node.html - Artwork behavior
public/app.js - Firebase client SDK
public/firebase.js - Checkout client
public/stripe.js - Checkout confirmation UI
public/server/endpoints/checkout-confirmation.html
Trusted Node backend
- Server bootstrap
server.js - Application setup
app.js - Artwork route
src/routes/artwork.js - Artwork-by-slug endpoint
src/endpoints/artworkBySlug.js - Slug resolution
src/services/artworkSlug.js - Artwork page assembly
src/services/artworkPage.js - Trusted Stripe middleware · Owns secret-key Stripe operations.
src/middleware/stripe.js - Firestore artwork access
lib/firestoreArtwork.js - Container deployment
Dockerfile
Firebase platform
- Firebase Hosting · Serves public assets and routes requests to backend handling.
firebase.json - Firestore artwork catalog
- Firestore authorization rules
firestore.rules - Firestore catalog indexes
firestore.indexes.json - Cloud Storage access rules · Controls artwork media access.
storage.rules
Connections 21
- Firebase Hosting → Webflow static UI: serves
- Webflow static UI → Landing page: contains
- Webflow static UI → Artwork page UI: contains
- Artwork page UI → Artwork behavior: loads
- Artwork behavior → Firebase client SDK: uses
- Artwork behavior → Checkout client: initiates checkout
- Checkout client → Trusted Stripe middleware: payment request
- Checkout client → Checkout confirmation UI: confirms checkout
- Firebase Hosting → Server bootstrap: forwards dynamic requests
- Server bootstrap → Application setup: starts
- Application setup → Artwork route: registers
- Artwork route → Artwork-by-slug endpoint: dispatches slug request
- Artwork-by-slug endpoint → Slug resolution: resolves slug
- Artwork-by-slug endpoint → Artwork page assembly: assembles response
- Slug resolution → Firestore artwork access: looks up artwork
- Artwork page assembly → Firestore artwork access: loads artwork content
- Firestore artwork access → Firestore artwork catalog: reads records
- Firestore authorization rules → Firestore artwork catalog: authorizes access
- Firestore catalog indexes → Firestore artwork catalog: supports catalog queries
- Cloud Storage access rules → Firebase Hosting: protects media access
- Container deployment → Server bootstrap: packages