How waynesutton/promptstack works
Main Components
• Frontend Client:
– Located in the “src” directory, this houses React components (e.g., App.tsx, Header.tsx, Footer.tsx) and routing logic (using TanStack Router).
– It includes UI elements, style files (Tailwind CSS), and static assets (the “public” folder).
• Backend & API Layer (Convex):
– The “convex” folder contains configuration and generated API files (e.g., api.d.ts, server.js) representing the Convex.dev backend which acts as a serverless database and business logic layer.
– This layer handles real‑time updates and data management for prompts and user interactions.
• Infrastructure & Deployment Components:
– Files like “netlify.toml” and deployment badges in the README show that Netlify is used for hosting.
– There is also a mix of configuration files (.npmrc, bun.lockb, package.json, vite.config.ts) indicating choices like Bun as a runtime and Vite as a build tool.
• External Services & Integrations:
– Authentication is handled via Clerk (as mentioned in the README).
– Other integrations include GitHub for linking profiles and potentially third‑party APIs or services for AI assistants.
Relationships and Interactions
• The Frontend communicates with the Convex backend to fetch and update prompt data.
• The routing layer (TanStack Router) manages client‑side navigation between pages (defined in “src/routes”).
• Static assets from the “public” folder complement the UI, while Convex’s auto‑generated API provides a clear contract between client and server.
• Authentication (via Clerk) and third‑party integrations (GitHub, AI APIs) interact with the frontend and sometimes the backend to secure and enrich the user experience.
Architectural Patterns & Design Principles
• Separation of Concerns:
– The clear division between “src” (frontend), “convex” (backend), and “public” assets supports modularity.
• Component‑Based UI (React):
– The UI is built in small, reusable, and well‑labeled components.
• API Contract Generation:
– The use of Convex’s auto‑generated API files helps ensure a robust communication layer between the frontend and backend.
• Serverless & Reactive Design:
– Convex.dev simplifies backend operations with real‑time updates, making the architecture both reactive and scalable.