How naufaladityaakbar/ghbc_web_app works
This is a Next.js social/community app with authentication, a post feed, comments, profiles, saved posts, notifications, search, events, and messaging. Its principal workflow is session-aware use of the feed and related social features through API routes and server-side domain helpers. The graph includes the main visible domain branches and the shared database layer. Several page and API implementations were not sampled, so some UI-to-API links are omitted rather than inferred.
Main entry points: prisma.ts Prisma client · auth.ts Token and passwords · comment Comment endpoints · notification Notification endpoints
Components 25
Web experience
- Main pages
src/app/(main) - Auth pages
src/app/(auth) - Session state
src/context/AuthContext.tsx - Post card
src/components/Posts/PostCard.tsx - Author display
src/components/UI/AuthorAndDate.tsx - External sharing
src/components/UI/ShareExternal.tsx
API routes
- Post endpoints
src/app/api/post - Comment endpoints
src/app/api/comment - Profile endpoint
src/app/api/profile/route.ts - Saved endpoint
src/app/api/saved/route.ts - Notification endpoints
src/app/api/notification - Messaging endpoints
src/app/api/pesan - Search endpoint
src/app/api/search/route.ts - Authentication endpoints
src/app/api/auth
Domain services
- Post operations
src/lib/post.ts - Comment operations
src/lib/comment.ts - User operations
src/lib/user.ts - Saved posts
src/lib/savedPosts.ts - Notifications
src/lib/notification.ts - Messaging
src/lib/pesan.ts - Search
src/lib/search.ts - Token and passwords
src/lib/auth.ts
Persistence
- Prisma client
src/lib/prisma.ts - Database
Other components
- Visitor
Connections 29
- Session state → Authentication endpoints: checks session
src/context/AuthContext.tsx - Session state → Notification endpoints: fetches alerts
src/context/AuthContext.tsx - Post card → Author display: renders
src/components/Posts/PostCard.tsx - Post card → External sharing: uses
src/components/Posts/PostCard.tsx - Auth pages → Session state: uses session
- Post endpoints → Post operations: calls
src/app/api/post/route.ts - Post endpoints → Token and passwords: verifies request
src/app/api/post/route.ts - Comment endpoints → Comment operations: calls
src/app/api/comment/route.ts - Comment endpoints → Post operations: loads post
src/app/api/comment/route.ts - Comment endpoints → Notifications: creates alert
src/app/api/comment/route.ts - Comment endpoints → Token and passwords: verifies request
src/app/api/comment/route.ts - Profile endpoint → User operations: calls
src/app/api/profile/route.ts - Profile endpoint → Token and passwords: verifies request
src/app/api/profile/route.ts - Saved endpoint → Saved posts: calls
src/app/api/saved/route.ts - Saved endpoint → Token and passwords: verifies request
src/app/api/saved/route.ts - Notification endpoints → Notifications: calls
src/app/api/notification/route.ts - Notification endpoints → Token and passwords: verifies request
src/app/api/notification/route.ts - Messaging endpoints → Messaging: calls
src/app/api/pesan/conversations/route.ts - Messaging endpoints → Token and passwords: verifies request
src/app/api/pesan/conversations/route.ts - Search endpoint → Search: calls
src/app/api/search/route.ts - Authentication endpoints → Token and passwords: uses
src/app/api/auth/login/route.ts - Post operations → Prisma client: queries
src/lib/post.ts - Comment operations → Prisma client: queries
src/lib/comment.ts - User operations → Prisma client: queries
src/lib/user.ts - Saved posts → Prisma client: queries
src/lib/savedPosts.ts - Notifications → Prisma client: queries
src/lib/notification.ts - Messaging → Prisma client: queries
src/lib/pesan.ts - Search → Prisma client: queries
src/lib/search.ts - Prisma client → Database: persists data