How archit80/pitchup works
Project type and purpose
• This is a full-stack Next.js application called Pitch-Up for startups to pitch themselves to investors.
• It uses Next.js App Router (the app folder), Tailwind CSS for styling, Sanity as a headless CMS, NextAuth for authentication, and Sentry for error-monitoring in client, server, and edge environments.
File structure
• app/ : Next.js App Router.
• (root)/layout.tsx & page.tsx – global UI layout and home page
• /startup and /user route groups with dynamic pages
• app/api/auth/[...nextauth]/route.ts – authentication API
• app/api/sentry-example-api/route.ts – example server API
• app/studio/… – embedded Sanity Studio in the app
• components/ : reusable React components and a ui/ subfolder for primitives
• lib/ : application business logic (actions, utils, validation)
• hooks/ : custom React hooks (e.g. use-toast)
• sanity/ : Sanity CMS configuration, schema definitions, and helper clients
• instrumentation*.ts : Sentry configuration for client, server, and edge
• next.config.ts, tailwind.config.ts, tsconfig.json : build and framework configs
• public/ : static assets
• dist/ : compiled plugin or build artifacts (likely for Sanity Studio)
README for additional insights
• Confirms Next.js, Tailwind CSS, Sanity stack.
Main components and their relationships
a. Frontend (Next.js React App)
• Server Components & Client Components under app/ and components/
• Layout, pages, UI library
b. Backend/API (Next.js serverless functions)
• app/api/auth → NextAuth route for signin/signup/session
• app/api/sentry-example-api → example REST endpoint
c. Headless CMS (Sanity)
• sanity/lib/client.ts & write-client.ts for data reads/writes
• sanity/schemaTypes define content models (author, playlist, startup)
• Embedded Studio at app/studio/…
d. Authentication (NextAuth)
• next-auth.d.ts for types
• app/api/auth/[...nextauth]/route.ts interacts with your DB or provider
e. Monitoring (Sentry)
• instrumentation-client.ts (browser)
• instrumentation.ts (server)
• sentry.*.config.ts for edge, client, server
f. Styling & Assets
• Tailwind via tailwind.config.ts & globals.css
• public/ and fonts/ for static files
Data flows:
• UI components call either the Sanity client directly (for fetching startup data) or call internal API routes (auth, custom APIs).
• API routes may in turn call Sanity write-client or NextAuth internals.
• Errors or performance data flow to Sentry via configured instrumentation.
Architectural patterns & design principles
• Separation of concerns: UI in components/, business logic in lib/, data models in sanity/schemaTypes.
• Next.js App Router with server vs. client components.
• Headless CMS pattern: Sanity as external content store.
• API layer for authentication and custom backend logic.
• Observability layer with Sentry.
Elements
• Frontend vs. Backend vs. External services