How curtainteddy/lspp-swipetank works
Project Type and Purpose
• This is a full-stack web application built on Next.js 15 with an App Router, TypeScript, and Tailwind CSS.
• It provides an AI-powered “Tinder for startups and investors” platform: entrepreneurs create and analyze projects, investors browse/swipe projects, and both parties communicate via real-time messaging.
File Structure
• Top-level “app/” directory uses Next.js App Router: nested folders for pages and route groups (e.g., (auth), api, browse, dashboard, etc.).
• Under “app/api/” you have REST-style serverless functions organized by domain (analysis, dashboard, investments, messages, projects).
• “components/” contains UI primitives (shadcn/ui) and feature modules (landing, browse, dashboard, analytics).
• “lib/” holds helpers (auth, Prisma client, utilities).
• “prisma/” defines your PostgreSQL schema, migrations, and seed script.
• “contexts/” and “hooks/” manage client-side state and utilities (user context, mobile detection, toast).
• Config files: middleware.ts for auth, next.config.mjs, Tailwind and PostCSS configs.
README for Additional Insights
• Frontend: Next.js, React 18, Radix UI, Framer Motion, Recharts, React Hook Form + Zod.
• Backend: Next.js API routes, Prisma ORM (PostgreSQL), Clerk for auth, Google Gemini for AI, Svix for webhooks.
• Design system: custom shadcn/ui, dark/light themes, responsive design.
a. Main Components
• Client (Browser/Mobile): React-based UI, App Router, Context Providers.
• Next.js Server: SSR/SSG, App Router, API Routes (analysis, projects, messages, investments, dashboard).
• Authentication Service: Clerk (external).
• AI Service: Google Gemini API.
• Database: PostgreSQL accessed via Prisma ORM.
• Webhooks: Svix for file handling or events.
• External Integrations: Vercel (hosting), optional SMS/email, analytics/monitoring.
b. Relationships and Data Flows
• User ↔ Browser UI ↔ Next.js (SSR/CSR)
• UI calls Next.js API routes → business logic in route handlers → Prisma client → PostgreSQL
• Certain API routes call Google Gemini for analysis
• Clerk handles sign-in/up flows and JWT/session management; Next.js middleware protects routes
• Real-time messaging is implemented via RESTful message endpoints (could be extended to WebSockets)
• Webhooks from external services (Svix) funnel into specific API routes
c. Architectural Patterns
• Modular Routing: Domain-based grouping of API routes.
• App Router Layouts: Shared layouts (app/layout.tsx) with providers and navigation.
• Context-based State: React Context for user/session.
• ORM Layer: Prisma as single DB access point.
• Separation of Concerns: UI components vs. API handlers vs. business logic vs. data layer.
d. Key Technologies & Frameworks
• Next.js 15, React 18, TypeScript 5
• Tailwind CSS, Framer Motion, Recharts
• Prisma 6 + PostgreSQL
• Clerk Authentication
• Google Gemini AI
• Svix Webhooks