How sebastianfdz/jira_clone works
Project Type and Purpose
• This is a full-stack, single-page application (SPA) clone of Jira, built with Next.js 13’s new app directory.
• It provides user authentication, project/issue/sprint management, and uses React Server Components (RSC) alongside client components.
• Key 3rd-party systems: Clerk (auth), Upstash (rate-limiting/Redis), and a relational database (via Prisma ORM).
File Structure
• Top-level “app” directory: Next.js routes (server components, client components, page.tsx).
• “app/api” subtree: REST-style API routes for issues, projects, sprints, and nested resources (comments, members).
• “components” and “ui”: reusable React components (RSC + client UI).
• “server”: database client initialization (server/db.ts) and shared functions.
• “prisma”: schema.prisma and seed scripts—defines DB model and migrations.
• “utils” and “hooks”: client utilities and React-Query hooks for data fetching.
• “middleware.ts”: global middleware for auth or rate-limiting.
• Config files: Clerk, Tailwind, ESLint, Next.js, TypeScript.
README for Additional Insights
• Auth lifecycle managed by Clerk.
• Rate limiting via Upstash.
• Data fetching with React-Query (end-to-end type safety with Zod).
• Styling with Radix UI + Tailwind.
• ORM: Prisma + MySQL (or other provider).
Main Components & Their Relationships
a. Client Browser (React + Next.js App)
– Renders pages and UI components (app/layout.tsx, components/**).
– Uses React-Query hooks to call internal API routes.
b. Next.js Server
– Handles route rendering (RSC, SSR, client).
– Exposes /api/* endpoints (app/api/**/route.ts).
– Applies middleware for auth & rate limiting.
c. Internal API Layer
– Business logic lives in server/functions.ts and server/db.ts.
– API routes call Prisma client to query/update the relational DB.
d. Database
– MySQL (or chosen provider) via Prisma ORM.
– Seed data via prisma/seed.ts.
e. Third-Party Services
– Clerk: user sign-up, sign-in, session management.
– Upstash Redis: rate limiting on API calls.
f. Client-Side State & Data Fetching
– React Query + Zod for type-safe fetch/mutate.
– Local React state (contexts/hooks) for filters, selected issue, modals.
Architectural Patterns & Design Principles
• Component-based UI (Atomic design: ui, form, modals, issue, backlog, board, roadmap).
• Directory-based routing & filesystem API in Next.js 13.
• React Server Components coexisting with client components.
• Single codebase for frontend and backend (monorepo style).
• Clear separation: UI ←→ data fetching hooks ←→ API routes ←→ server logic ←→ DB.
– Callouts for critical cross-cutting concerns (auth, rate limit, type safety).