How ln-dev7/circle works
Project type and purpose
• This is a full-stack (primarily frontend) web application built on Next.js.
• It provides a modern, responsive UI for tracking issues, projects, teams, and members.
• Currently it uses in-memory/mock data; no external backend services are integrated yet.
Main components
a. Client Browser
• Renders the app, issues HTTP requests, executes client-side React code after hydration.
b. Next.js Server Runtime
• Handles file-based routing, server-side rendering (SSR), static generation (SSG), and serves assets.
• Entry points: /app directory pages (e.g., app/page.tsx, app/[orgId]/…).
c. React Pages & Layout
• Pages folder: domain routes for organizations, projects, issues, teams, settings.
• components/layout: global layout, sidebar, headers, theme provider.
d. UI Component Library
• components/ui: primitive UI building blocks (buttons, dialogs, tables, etc.) from shadcn/ui + Tailwind.
• components/common: domain-specific components (issues grid, project badges, member lists, etc.).
e. State Management Layer
• store/*-store.ts: Zustand or similar stores (issuesStore, filterStore, createIssueStore, viewStore, searchStore).
• Provides a single source of truth for client-side state, supports both SSR hydration & client updates.
f. Data Layer
• mock-data/*.ts(x): static JSON/TS modules that simulate API responses (issues, projects, teams, users).
• lib/utils.ts: helper functions for data manipulation (e.g., date formatting).
g. Static Assets
• Global CSS: app/globals.css, Tailwind config in postcss.config.mjs.
Relationships and data flows
• User initiates HTTP(S) request → Next.js Server → selects matching page in /app → executes its getServerSideProps or uses SSG → fetches mock-data via stores or custom hooks → renders React to HTML → sends to client.
• On hydration, client-side React takes over: pages/components call stores/hooks → read/write state → update UI.
• UI components dispatch actions to stores → stores read/write mock-data (in real-world this layer stands in for API calls).
Architectural patterns & design principles
• File-based routing (Next.js App Router) for domain pages.
• Separation of concerns:
– Layout vs. feature pages vs. UI primitives vs. domain components.
– Centralized client state (Zustand stores) separate from UI logic.
• Atomic design in UI library: primitives → composed common components → pages.
• Mock-data layer easily switchable to real API integration in future.
Final checklist
– [ ] Clear labels on every component, folder, and file group.
– [ ] Grouping containers matching the on-disk directory structure.
– [ ] Notes on SSR vs. CSR boundaries and hydrations.