How rohitsinghten/code-craft works
Project type and purpose
• This is a full-stack web application built on Next.js (React) with a serverless backend using Convex.
• Purpose: users can write, run, share, and comment on code snippets, manage profiles, and purchase pro features via LemonSqueezy.
File structure
• Top-level “src/app” and “src/components” → Next.js app router, React UI components, feature-based folders (root, pricing, profile, snippets).
• “convex/” folder → serverless business logic and data schema:
• schema.ts defines data models (snippets, users, comments, etc.).
• auth.config.ts configures authentication roles.
• codeExecutions.ts calls out to a code-runner API.
• lemonSqueezy.ts integrates with the payment gateway.
• http.ts exposes custom HTTP endpoints.
• Configuration files: next.config.ts, tsconfig.json, tailwind.config.ts, ESLint, PostCSS.
• State management: src/store (Zustand).
• Hooks, providers (ConvexClientProvider), middleware, public assets, global CSS.
(empty) README for additional insights
• No explicit architecture doc, but folder names and filenames reveal:
• External services: code execution engine, LemonSqueezy.
• Core features: snippets CRUD, comments, user profiles, payments.
Elements
• UI (e.g., blue rectangles)
• Application servers/functions (e.g., green)
Detail level
• Essential interactions: user login, snippet CRUD, code execution cycle, payment checkout.
• Non-obvious flows (e.g., webhooks from LemonSqueezy into http.ts).