# moksha-hub/atlassian-issue-tracker-clone architecture

> Architecture diagram of the GitHub repository moksha-hub/atlassian-issue-tracker-clone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moksha-hub/atlassian-issue-tracker-clone
- Repository: https://github.com/moksha-hub/atlassian-issue-tracker-clone

## Overview

##### Project type and purpose
- This is a full-stack web application—an “Atlassian Issue-Tracker Clone”—built on Next.js 14 (App Router), React, TypeScript, TailwindCSS and Shadcn UI on the frontend, Hono-powered serverless routes on the backend, and Appwrite as a BaaS for authentication, database, and file storage.

##### File structure
- src/app
– (auth), (dashboard), and (standalone) folders represent nested layouts and page groupings in the Next.js App Router.
– src/app/api/[[...route]]/route.ts and src/app/oauth/route.ts define serverless API endpoints (using Hono).
- src/components + src/features
– UI components (Shadcn/Tailwind) and feature folders (auth, workspaces, projects, tasks, members) each contain client hooks, server route handlers, schemas, and utility modules—indicating a feature-driven, domain-centric design.
- src/lib
– Bootstraps the Appwrite SDK, OAuth integration, RPC utilities, session middleware, and generic utilities.
- Configuration files
– next.config.mjs, tailwind.config.ts, postcss.config.mjs, tsconfig.json + .env.local for Appwrite endpoints and credentials.

##### README for additional insights
- Confirms technology stack (Next.js, React, TypeScript, Tailwind, Appwrite, Hono, Shadcn UI).
- Features: workspace & team management, project/task CRUD, multiple task views (table, Kanban, calendar), responsive UI.

a. Main components
– Client (Browser) running the Next.js React SPA/SSR app
– Next.js Server
- App Router rendering layouts/pages
- Serverless API layer (Hono) handling domain routes under src/app/api and src/features/*/server/route.ts
- Session middleware (lib/session-middleware.ts)
– Appwrite Backend
- Auth service (users, tokens)
- Database service (collections: workspaces, members, projects, tasks)
- Storage service (images bucket)
– External OAuth Provider (if OAuth flow is configured)

b. Relationships & data flow
1. Browser → Next.js SSR/SSG pages (HTML/CSS/JS)
2. Browser → Next.js API endpoints (fetch via feature hooks use-* API)
3. Next.js API → Appwrite SDK (reads/writes to collections)
4. Next.js Session Middleware ↔ Appwrite Auth (validate sessions/tokens)
5. (Optional) Browser ↔ External OAuth → Next.js OAuth route → Appwrite Auth

c. Architectural patterns & design principles
– Feature-based folder structure (domain-driven design)
– Next.js App Router with nested layouts for cross-cutting concerns (auth guard, dashboard wrapper, standalone pages)
– BaaS backend (Appwrite) for rapid development, decoupling persistence & auth from application logic
– Serverless functions (Hono) as the API layer, promoting microservice-like separation per feature

d. Key technologies/frameworks
– Next.js 14 (App Router)
– React + Shadcn UI + Tailwind CSS (UI layer)
– Hono (lightweight serverless router)
– Appwrite SDK (database, auth, storage)
– Zod schemas for validation in features
– hello-pangea/dnd, react-big-calendar, date-fns, etc., for rich task interactions

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef frontend fill:#cfe2ff,stroke:#1f4e79,color:#1f4e79
    classDef server fill:#d9ead3,stroke:#38761d,color:#38761d
    classDef external fill:#fce5cd,stroke:#b45f06,color:#b45f06

    subgraph "External Services"
        Appwrite_Auth["Appwrite Auth Service"]:::external
        Appwrite_DB["Appwrite Database Service"]:::external
        Appwrite_Storage["Appwrite Storage Service"]:::external
        OAuth_Provider["External OAuth Provider"]:::external
    end

    subgraph "API/Server (Next.js + Hono)" 
        API_CatchAll["Serverless API Layer<br/>(Hono Catch-All Route)"]:::server
        OAuth_Route["OAuth Callback Route"]:::server
        Session_MW["Session Middleware"]:::server
        Appwrite_Init["Appwrite SDK Initialization"]:::server
        OAuth_SDK["OAuth SDK Integration"]:::server
        RPC_Util["RPC Utilities"]:::server
        Utils["Generic Utilities"]:::server

        subgraph "Features"
            Auth_Feature["Authentication Feature"]:::server
            WS_Feature["Workspaces Feature"]:::server
            Projects_Feature["Projects Feature"]:::server
            Tasks_Feature["Tasks Feature"]:::server
            Members_Feature["Members Feature"]:::server
        end
    end

    subgraph "Frontend (Next.js App Router)" 
        Node_AppRouter["Next.js App Router<br/>(Layouts & Pages)"]:::frontend
        UI_Components["Shared UI Components"]:::frontend
        Reusable_Components["General Reusable Components"]:::frontend
    end

    Browser["Browser (Client)"]:::frontend

    Browser --> Node_AppRouter
    Browser --> API_CatchAll
    Browser -->|"OAuth flow"| OAuth_Provider
    OAuth_Provider --> OAuth_Route

    Node_AppRouter -->|renders/pages & fetch| API_CatchAll
    API_CatchAll --> Appwrite_Init
    OAuth_Route --> Session_MW
    Session_MW --> Appwrite_Auth

    Appwrite_Init --> Appwrite_Auth
    Appwrite_Init --> Appwrite_DB
    Appwrite_Init --> Appwrite_Storage

    Auth_Feature --> API_CatchAll
    WS_Feature --> API_CatchAll
    Projects_Feature --> API_CatchAll
    Tasks_Feature --> API_CatchAll
    Members_Feature --> API_CatchAll

    class Browser,Node_AppRouter,UI_Components,Reusable_Components frontend
    class API_CatchAll,OAuth_Route,Session_MW,Appwrite_Init,OAuth_SDK,RPC_Util,Utils,Auth_Feature,WS_Feature,Projects_Feature,Tasks_Feature,Members_Feature server
    class Appwrite_Auth,Appwrite_DB,Appwrite_Storage,OAuth_Provider external

    click Node_AppRouter "https://github.com/moksha-hub/atlassian-issue-tracker-clone/tree/main/src/app"
    click API_CatchAll "https://github.com/moksha-hub/atlassian-issue-tracker-clone/blob/main/src/app/api/[[...route]]/route.ts"
    click OAuth_Route "https://github.com/moksha-hub/atlassian-issue-tracker-clone/blob/main/src/app/oauth/route.ts"
    click Session_MW "https://github.com/moksha-hub/atlassian-issue-tracker-clone/blob/main/src/lib/session-middleware.ts"
    click Appwrite_Init "https://github.com/moksha-hub/atlassian-issue-tracker-clone/blob/main/src/lib/appwrite.ts"
    click OAuth_SDK "https://github.com/moksha-hub/atlassian-issue-tracker-clone/blob/main/src/lib/oauth.ts"
    click RPC_Util "https://github.com/moksha-hub/atlassian-issue-tracker-clone/blob/main/src/lib/rpc.ts"
    click Utils "https://github.com/moksha-hub/atlassian-issue-tracker-clone/blob/main/src/lib/utils.ts"
    click Auth_Feature "https://github.com/moksha-hub/atlassian-issue-tracker-clone/tree/main/src/features/auth"
    click WS_Feature "https://github.com/moksha-hub/atlassian-issue-tracker-clone/tree/main/src/features/workspaces"
    click Projects_Feature "https://github.com/moksha-hub/atlassian-issue-tracker-clone/tree/main/src/features/projects"
    click Tasks_Feature "https://github.com/moksha-hub/atlassian-issue-tracker-clone/tree/main/src/features/tasks"
    click Members_Feature "https://github.com/moksha-hub/atlassian-issue-tracker-clone/tree/main/src/features/members"
```
