How ashar766/social-app works
This is a Next.js social app for account creation and login, sharing and browsing posts, and connecting with other users. The main workflow is authenticate, browse a filtered post feed, then create or interact with posts; profiles, follow requests, and user search provide separate social features. Prisma is the database-access layer, and the custom server also initializes Socket.IO. Several action and client modules were not sampled, so their edges are limited to relationships supported by the tree, module names, or sampled source.
Main entry points: prisma.ts PostgreSQL · page.tsx Post feed · auth.ts Auth service · route.ts Feed API
Components 24
Identity
- Login
app/(auth)/login/page.tsx - Signup form
app/(auth)/signup/page.tsx - Signup action
app/(auth)/signup/action.ts - Auth service
lib/auth.ts - Auth routes
app/api/auth/[...nextauth]/route.ts
Posts
- Post feed
app/(app)/posts/page.tsx - Feed API
app/api/posts/route.ts - Infinite posts
app/(app)/components/InfinitePosts.tsx - Create post
app/(app)/create-post/action.ts - Post detail
app/(app)/post/[id]/page.tsx - Post actions
app/(app)/post/[id]/post-action.ts - Edit post
app/(app)/post/[id]/edit-action.ts
Social graph
- Profile
app/(app)/profile/[user]/page.tsx - Follow actions
app/(app)/profile/[user]/action.ts - Request actions
app/(app)/profile/[user]/request-action.ts - User search
app/(app)/search/users/page.tsx - Search form
app/(app)/components/UserSearchForm.tsx
App runtime
- Home
app/page.tsx - PostgreSQL
lib/prisma.ts - App layout
app/(app)/layout.tsx - Socket provider
app/(app)/components/SocketProvider.tsx - Socket server
server.ts - Socket registry
lib/socket.ts
Other components
- User
Connections 30
- User → Home: opens
- Home → Login: links to
- Home → Signup form: links to
- User → Login: submits credentials
- Login → Auth service: signs in
- User → Signup form: submits details
- Signup form → Signup action: submits to
- Signup action → PostgreSQL: writes account
- Auth routes → Auth service: exports handlers
- Auth service → PostgreSQL: looks up user
- User → Post feed: browses
- Post feed → PostgreSQL: reads posts
- Post feed → PostgreSQL: reads follows
- Post feed → Infinite posts: renders
- Infinite posts → Feed API: loads pages
- Feed API → Auth service: checks session
- Feed API → PostgreSQL: reads feed
- User → Create post: creates post
- User → Post detail: opens post
- User → Post actions: interacts with
- User → Edit post: edits post
- User → Profile: views profile
- Profile → PostgreSQL: reads profile
- User → Follow actions: follows user
- User → Request actions: handles requests
- User → Search form: searches users
- Search form → User search: navigates to
- App layout → Socket provider: wraps app
- Socket server → Socket registry: registers socket server
- Socket provider → Socket server: connects