How arjunhg/peerpath works
Project type and purpose
• This is a full-stack Next.js application that provides an AI-powered chat and community matching experience. Users can sign up, join communities, set learning goals, and chat with AI or matched partners. The codebase leverages:
• Next.js App Router (“app/…” directory) for both frontend and server actions
• Drizzle ORM (db/schema.ts + db/index.ts) for the SQL database
• A custom “app/server” layer to expose domain-specific routes (community, matches, conversations, learning goals)
• Tambo (via NEXT_PUBLIC_TAMBO_API_KEY) as an external AI service
File structure
• Top-level “app” directory:
• app/page.tsx, app/layout.tsx – root layout and entry point
• app/(main)/… – main authenticated area with nested routes (dashboard, communities, chat)
• app/api/[[...route]]/route.ts – catch-all API proxy endpoint
• app/server/*.ts – server-only route implementations and auth middleware
• app/sign-in, app/sign-up – authentication pages
• “components” directory: reusable UI pieces, grouped by feature (chat, communities, dashboard, landing, layout, providers, tambo integration, UI primitives)
• “hooks”: custom React hooks (use-conversations, use-communities, etc.) that encapsulate API interactions
• “lib”: client- and server-side utilities (API client, DB helpers, AI helpers, user-utils)
• “db”: schema, seed script, Drizzle config
• “proxy.ts”: local development proxy for the Tambo API
• Configuration files: next.config.ts, tsconfig.json, bun.lock, etc.
README for additional insights
• Boilerplate from create-next-app, configured for Next.js font optimization and environment variable for Tambo