How prime-02/linkedin-clone works
Purpose and Runtime
This is a frontend-only LinkedIn-style social/professional network built with Next.js App Router, React, TypeScript, Tailwind CSS, and Zustand. It has no backend, database, API integration, authentication provider, or persistence: all interactions mutate in-memory client state and reset on refresh.
Primary application shell and global styles are defined in app/layout.tsx, app/globals.css, and app/(main)/layout.tsx.
Route Entry Points
The root route likely directs users into the sign-in flow via app/page.tsx; app/login/page.tsx accepts arbitrary credentials. Auth state is managed locally in store/useAuthStore.ts.
Authenticated/main-area routes are organized under the (main) route group:
• Feed: app/(main)/feed/page.tsx
• Network: app/(main)/network/page.tsx
• Messaging: app/(main)/messaging/page.tsx
• Jobs: app/(main)/jobs/page.tsx
• Notifications: app/(main)/notifications/page.tsx
• Dynamic member profile: app/(main)/profile/[id]/page.tsx
Main-Shell Composition
app/(main)/layout.tsx provides the shared logged-in experience, composed from navigation and rail components:
• components/layout/Navbar.tsx
• components/layout/Sidebar.tsx
• components/layout/RightRail.tsx
This is the main visual/control boundary: feature pages render within a persistent professional-network layout, while login is outside it.
Feed Lifecycle
The feed renders mock posts, supports post creation, six reaction types, comments, and incremental loading. Its central state boundary is store/useFeedStore.ts, initialized from data/posts.ts and shaped by types/index.ts.
Feature composition is centered on:
• components/feed/CreatePostBox.tsx
• components/feed/PostCard.tsx
• components/feed/CommentSection.tsx
User actions update Zustand state directly; there is no request, server validation, or durable write path.
Social Graph and Profiles
Profiles are dynamic routes keyed by user ID, reading from the shared user dataset in data/users.ts. Profile presentation is decomposed into domain sections rather than a single document:
• components/profile/ProfileHeader.tsx
• components/profile/ExperienceSection.tsx
• components/profile/SkillsSection.tsx
Network workflows—invitation acceptance/ignore, suggested-person connections, and connection search—are maintained in store/useNetworkStore.ts, using data/connections.ts and components such as components/network/InvitationCard.tsx and components/network/PeopleYouMayKnow.tsx.
Messaging, Jobs, and Notifications
Messaging uses conversation/thread mock data from data/messages.ts and state from store/useMessagesStore.ts. components/messaging/ConversationList.tsx selects context, while components/messaging/ChatWindow.tsx performs optimistic local message insertion.
Jobs are a mostly page-local browsing flow over data/jobs.ts, with filtering and details represented by components/jobs/JobFilters.tsx and components/jobs/JobDetailsPanel.tsx; applying produces a mock success outcome only.
Notifications are sourced from data/notifications.ts and managed by store/useNotificationsStore.ts. components/notifications/NotificationItem.tsx renders grouped/read-state items, and state changes drive notification badge counts in shared navigation.
Shared Model and UI Boundaries
types/index.ts is the common contract across mock datasets, stores, routes, and feature components. data/*.ts files are the initial-state source of truth; Zustand stores are the mutable runtime source of truth.
Reusable interface primitives—including avatar, modal, dropdown, button, and tooltip—are concentrated in components/shared/Avatar.tsx, components/shared/Modal.tsx, and components/shared/Button.tsx. They standardize interaction and presentation without introducing a separate design-system runtime.
Main entry points: layout.tsx Main layout · index.ts Shared models · PostCard.tsx Post interaction UI · page.tsx Member profiles
Components 24
Entry & Shell
Public sign-in and persistent authenticated layout.
- Root entry · Directs users into the sign-in flow.
app/page.tsx - Login · Accepts arbitrary credentials locally.
app/login/page.tsx - Main layout · Persistent logged-in visual and control boundary.
app/(main)/layout.tsx - Navbar · Shared navigation and notification badge surface.
components/layout/Navbar.tsx - Side rails · Persistent sidebar and right-rail content.
Social Features
Feed, profiles, and network interactions.
- Feed · Renders the post lifecycle.
app/(main)/feed/page.tsx - Post interaction UI · Creation, cards, reactions, comments, and incremental loading.
components/feed/PostCard.tsx - Member profiles · User-ID profile pages.
app/(main)/profile/[id]/page.tsx - Profile sections · Header, experience, and skills presentation.
components/profile/ProfileHeader.tsx - Network · Invitations, suggestions, connections, and search.
app/(main)/network/page.tsx
Workspace Features
Messaging, jobs, and notifications.
- Messaging · Conversation selection and optimistic local message insertion.
app/(main)/messaging/page.tsx - Jobs · Local filtering, details, and mock application outcome.
app/(main)/jobs/page.tsx - Notifications · Grouped notification and read-state display.
app/(main)/notifications/page.tsx
Client Foundation
Shared in-memory state, models, and UI primitives.
- Auth state · Local authenticated-state boundary.
store/useAuthStore.ts - Feed state · Mutable posts, reactions, and comments.
store/useFeedStore.ts - Post seed data · Initial feed state.
data/posts.ts - User data · Shared profile dataset.
data/users.ts - Network state · Mutable invitation and connection workflows.
store/useNetworkStore.ts - Connection data · Initial network relationships.
data/connections.ts - Message state · Conversation and thread runtime state.
store/useMessagesStore.ts - Message data · Initial conversations and threads.
data/messages.ts - Notification state · Mutable read state drives navigation badges.
store/useNotificationsStore.ts - Shared models · Common contracts for data, stores, routes, and components.
types/index.ts - Shared UI primitives · Avatar, modal, dropdown, button, and tooltip primitives.
components/shared/Button.tsx
Connections 27
- Root entry → Login: directs to
- Login → Auth state: updates
- Auth state → Main layout: enables
- Main layout → Navbar: composes
- Main layout → Side rails: composes
- Main layout → Feed: renders
- Main layout → Member profiles: renders
- Main layout → Network: renders
- Main layout → Messaging: renders
- Main layout → Jobs: renders
- Main layout → Notifications: renders
- Feed → Post interaction UI: composes
- Post interaction UI → Feed state: reads and mutates
- Post seed data → Feed state: initializes
- Member profiles → Profile sections: composes
- User data → Member profiles: supplies user by ID
- Network → Network state: reads and mutates
- Connection data → Network state: initializes
- Messaging → Message state: reads and mutates
- Message data → Message state: initializes
- Notifications → Notification state: reads and mutates
- Notification state → Navbar: updates badge count
- Shared models → Feed state: types
- Shared models → Network state: types
- Shared models → Message state: types
- Shared UI primitives → Post interaction UI: standardizes interactions
- Shared UI primitives → Profile sections: standardizes presentation