PeerPath is a full-stack learning partner platform where users join communities, add learning goals, get AI-based match suggestions, and chat with matched peers.
- GitHub: Arjunhg/peerpath
- Live: peerpath-mu.vercel.app
- Public landing page with marketing sections (
app/page.tsx). - Authentication via Clerk (
app/layout.tsx,proxy.ts, sign-in/sign-up routes). - Main authenticated app:
- Dashboard (
app/(main)/dashboard/page.tsx) - Communities (
app/(main)/communities/page.tsx,app/(main)/communities/all/page.tsx) - Chat (
app/(main)/chat/page.tsx,app/(main)/chat/[matchId]/page.tsx)
- Dashboard (
- AI partner matching from community goals (
lib/ai.ts,app/server/matches-routes.ts). - Conversation summaries + action items generated from chat history (
app/server/conversations-routes.ts,lib/ai.ts).
- Next.js App Router + React 19 + TypeScript.
- UI built with reusable components in
components/ui/*. - Motion/transitions via
framer-motion. - Client data state managed with React Query (
components/providers/query-provider.tsx). - API calls use a typed Hono client (
lib/api-client.ts).
- API entrypoint:
app/api/[[...route]]/route.ts. - Server framework: Hono running on Next.js route handlers.
- Route modules:
app/server/community-routes.tsapp/server/learning-goals-routes.tsapp/server/matches-routes.tsapp/server/conversations-routes.ts
- Most API routes require auth;
/api/communities/allis the main public API path.
- Clerk middleware in
proxy.tsprotects app/API paths. - API middleware reads Clerk session and sets
userId. authMiddlewareresolves app user records throughgetOrCreateUserByClerkId(lib/user-utils.ts).
- PostgreSQL + Drizzle ORM (
db/schema.ts,db/index.ts). - Core entities:
users,communities,community_members,learning_goalsmatches,conversations,messages,conversation_summaries
- Drizzle migrations/config:
drizzle.config.tsdrizzle/*
- Seed data script:
db/seed.ts.
- AI SDK + OpenAI model (
gpt-5-nano) is used inlib/ai.ts. - Two implemented AI flows:
- partner matching based on community goal similarity
- chat summary generation with
summary,keyPoints,actionItems,nextSteps
Tambo is integrated as an in-app copilot UI, not as a separate backend.
- Dashboard copilot panel (
app/(main)/dashboard/page.tsx) - Chat coach copilot panel (
components/chat/chat-interface.tsx)
- Provider/auth wrapper:
components/providers/tambo-provider.tsx- Uses Clerk
getToken({ template: "tambo" })foruserToken.
- Uses Clerk
- Copilot panel UI:
components/tambo/copilot-panel.tsx - Tool + component registry:
components/tambo/registry.tsx
- Calls local app APIs through Tambo tools:
get_dashboard_snapshotfind_partners_for_communityget_conversation_coaching
- Renders structured components in responses:
DashboardInsightsCardPartnerRecommendationsListConversationSummaryCardActionChecklist
- It does not replace your API routes or database layer.
- It depends on existing
/api/*routes for data and actions.
- Communities:
GET /api/communities/allGET /api/communitiesPOST /api/communities/:communityId/joinGET /api/communities/:communityId/goalsPOST /api/communities/goalsGET /api/communities/goals
- Matches:
POST /api/matches/:communityId/aimatchGET /api/matches/:communityId/matchesGET /api/matches/allmatchesPUT /api/matches/:matchId/acceptGET /api/matches/:matchId/conversation
- Conversations:
GET /api/conversations/:conversationId/messagesPOST /api/conversations/:conversationId/messagesPOST /api/conversations/:conversationId/summarizeGET /api/conversations/:conversationId/summary
Create .env.local for runtime values:
DATABASE_URL=
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
OPENAI_API_KEY=
TAMBO_API_KEY=Create .env with at least:
DATABASE_URL=drizzle.config.ts reads .env, while app runtime code reads .env.local.
In Clerk, create a JWT template named tambo because getToken({ template: "tambo" }) is used for Tambo auth.
- Install dependencies:
bun install- Push schema to your database:
bun run db:push- (Optional) Seed local data:
bun run db:seed- Start development server:
bun run dev- Open
http://localhost:3000.
bun run dev- start local dev serverbun run build- production buildbun run start- run production serverbun run lint- run ESLintbun run db:generate- generate drizzle migrationsbun run db:push- push schema to DBbun run db:studio- open drizzle studiobun run db:seed- seed sample data


