# mokshith-moksh/mokshith architecture

> Architecture diagram of the GitHub repository mokshith-moksh/mokshith, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mokshith-moksh/mokshith
- Repository: https://github.com/mokshith-moksh/mokshith

## Overview

1. This is a client-side React + TypeScript app built with Vite. There is no backend, API layer, or database in the repository; the architecture is a single-page UI that assembles a desktop-like experience from static assets and local state.

2. The top-level application entry is `src/main.tsx`, which boots `App.tsx`. `App.tsx` is the composition point for the shell UI and likely decides which “windows” are visible on the desktop.

3. The main product concept is a macOS-style portfolio desktop. The app is split into a persistent shell and multiple app windows: `Desktop`, `Finder`, `Safari`, `Terminal`, `Resume`, `Contact`, `Photo`, `TextViewer`, `ImageViewer`, and `SafariHome`. These are not routes in the traditional sense; they behave like in-app panels/windows.

4. Window behavior is centralized through `src/store/store.ts` plus the two slices under `src/store/windows/`. `windowSlice.ts` likely governs open/close, focus, and stacking/activation, while `locationSlice.ts` likely tracks window position or layout state. This is the key state boundary for the whole UI.

5. `src/hoc/windowWrapper.tsx` is the main presentation boundary around individual windows. It likely adds shared chrome and behaviors such as drag positioning, focus handling, and controls, so each window component can focus on its content instead of its frame.

6. Shared UI chrome lives in `src/components/`: `Navbar`, `Dock`, `WindowControl`, and `Welcome`. These components form the persistent shell around the window system and are the primary entry points for user actions that dispatch store updates.

7. The `src/windows/` folder contains the actual content modules for each in-app experience. This is where the app’s functional areas live: a file-browser-like experience (`Finder`), a browser experience (`Safari`/`SafariHome`), document/media viewers (`Resume`, `TextViewer`, `ImageViewer`, `Photo`), and utility/personal-info windows (`Terminal`, `Contact`, `Desktop`).

8. `src/constants/` is the configuration layer. It likely holds window metadata, icon paths, labels, and layout defaults that the shell and window system use to render consistent controls and initial positions.

9. Static assets are part of the architecture. `public/files/resume.pdf` and `public/myresume.pdf` indicate downloadable document assets, while `public/images/` and `public/icons/` support the visual desktop metaphor. These files are consumed directly by UI windows rather than fetched from an external service.

10. The data flow is mostly user-driven and local: user clicks in the dock/navbar/window controls, those actions dispatch to the Redux-like store, store state changes determine which windows render and where they appear, and the shell re-renders accordingly. There is no server round-trip in the normal path.

11. From an architecture-diagram perspective, the important boundaries are: application bootstrap, global window state, shared shell chrome, reusable window frame HOC, and the collection of specialized window content modules. The app is best modeled as a state-driven desktop UI rather than a page-based website.

Main entry points: [`src/hoc/windowWrapper.tsx`](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/hoc/windowWrapper.tsx) (Window Wrapper), [`src/App.tsx`](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/App.tsx) (App), [`src/windows/Desktop.tsx`](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Desktop.tsx) (Desktop), [`src/store/windows/windowSlice.ts`](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/store/windows/windowSlice.ts) (Window Slice)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_bootstrap["Bootstrap"]
  node_node_main(("main<br/>entrypoint<br/>[main.tsx]"))
  node_node_app["App<br/>composition<br/>[App.tsx]"]
end

subgraph group_group_shell["Shell UI"]
  node_node_window_wrapper["Window Wrapper<br/>hoc<br/>[windowWrapper.tsx]"]
  node_node_navbar["Navbar<br/>shell component<br/>[Navbar.tsx]"]
  node_node_dock["Dock<br/>shell component<br/>[Dock.tsx]"]
  node_node_window_control["Window Control<br/>shell component<br/>[WindowControl.tsx]"]
  node_node_welcome["Welcome<br/>shell component<br/>[Welcome.tsx]"]
end

subgraph group_group_state["Window State"]
  node_node_store[("Store<br/>[store.ts]")]
  node_node_window_slice["Window Slice<br/>state slice<br/>[windowSlice.ts]"]
  node_node_location_slice["Location Slice<br/>state slice<br/>[locationSlice.ts]"]
end

subgraph group_group_windows["Windows"]
  node_node_desktop["Desktop<br/>window<br/>[Desktop.tsx]"]
  node_node_finder["Finder<br/>window<br/>[Finder.tsx]"]
  node_node_safari["Safari<br/>window<br/>[Safari.tsx]"]
  node_node_safari_home["Safari Home<br/>window content<br/>[SafariHome.tsx]"]
  node_node_terminal["Terminal<br/>window<br/>[Terminal.tsx]"]
  node_node_resume["Resume<br/>window<br/>[Resume.tsx]"]
  node_node_contact["Contact<br/>window<br/>[Contact.tsx]"]
  node_node_photo["Photo<br/>window<br/>[Photo.tsx]"]
  node_node_text_viewer["Text Viewer<br/>window<br/>[TextViewer.tsx]"]
  node_node_image_viewer["Image Viewer<br/>window<br/>[ImageViewer.tsx]"]
end

subgraph group_group_assets["Assets"]
  node_node_resume_pdf["Resume PDF<br/>static asset<br/>[resume.pdf]"]
  node_node_icons(("Icons<br/>static assets"))
  node_node_images(("Images<br/>static assets"))
end

node_node_main -->|"renders"| node_node_app
node_node_app -->|"uses"| node_node_store
node_node_store -->|"includes"| node_node_window_slice
node_node_store -->|"includes"| node_node_location_slice
node_node_app -->|"composes"| node_node_navbar
node_node_app -->|"composes"| node_node_dock
node_node_app -->|"composes"| node_node_welcome
node_node_app -->|"composes"| node_node_desktop
node_node_app -->|"wraps"| node_node_window_wrapper
node_node_window_wrapper -->|"contains"| node_node_window_control
node_node_dock -->|"dispatches"| node_node_window_slice
node_node_navbar -->|"dispatches"| node_node_window_slice
node_node_desktop -->|"reads"| node_node_window_slice
node_node_desktop -->|"reads"| node_node_location_slice
node_node_finder -->|"wrapped by"| node_node_window_wrapper
node_node_safari -->|"wrapped by"| node_node_window_wrapper
node_node_terminal -->|"wrapped by"| node_node_window_wrapper
node_node_resume -->|"wrapped by"| node_node_window_wrapper
node_node_contact -->|"wrapped by"| node_node_window_wrapper
node_node_photo -->|"wrapped by"| node_node_window_wrapper
node_node_text_viewer -->|"wrapped by"| node_node_window_wrapper
node_node_image_viewer -->|"wrapped by"| node_node_window_wrapper
node_node_safari -->|"shows"| node_node_safari_home
node_node_resume -->|"loads"| node_node_resume_pdf
node_node_desktop -->|"uses"| node_node_icons
node_node_photo -->|"uses"| node_node_images
node_node_image_viewer -->|"uses"| node_node_images
node_node_finder -->|"uses"| node_node_images

click node_node_main "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/main.tsx"
click node_node_app "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/App.tsx"
click node_node_store "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/store/store.ts"
click node_node_window_slice "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/store/windows/windowSlice.ts"
click node_node_location_slice "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/store/windows/locationSlice.ts"
click node_node_window_wrapper "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/hoc/windowWrapper.tsx"
click node_node_navbar "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/Navbar.tsx"
click node_node_dock "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/Dock.tsx"
click node_node_window_control "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/WindowControl.tsx"
click node_node_welcome "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/Welcome.tsx"
click node_node_desktop "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Desktop.tsx"
click node_node_finder "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Finder.tsx"
click node_node_safari "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Safari.tsx"
click node_node_safari_home "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/SafariHome.tsx"
click node_node_terminal "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Terminal.tsx"
click node_node_resume "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Resume.tsx"
click node_node_contact "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Contact.tsx"
click node_node_photo "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Photo.tsx"
click node_node_text_viewer "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/TextViewer.tsx"
click node_node_image_viewer "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/ImageViewer.tsx"
click node_node_resume_pdf "https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/public/files/resume.pdf"
click node_node_icons "https://github.com/mokshith-moksh/mokshith/tree/https/github.com/mokshith-moksh/README.md/public/icons"
click node_node_images "https://github.com/mokshith-moksh/mokshith/tree/https/github.com/mokshith-moksh/README.md/public/images"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_main,node_node_app toneBlue
class node_node_window_wrapper,node_node_navbar,node_node_dock,node_node_window_control,node_node_welcome toneAmber
class node_node_store,node_node_window_slice,node_node_location_slice toneMint
class node_node_desktop,node_node_finder,node_node_safari,node_node_safari_home,node_node_terminal,node_node_resume,node_node_contact,node_node_photo,node_node_text_viewer,node_node_image_viewer toneRose
class node_node_resume_pdf,node_node_icons,node_node_images toneIndigo
```

## Components

### Bootstrap

Vite entry and app composition

- [main](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/main.tsx): entrypoint · Bootstraps the React app · `src/main.tsx`
- [App](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/App.tsx): composition · Top-level UI composition and visibility orchestration · `src/App.tsx`

### Shell UI

Persistent desktop chrome and shared window frame

- [Window Wrapper](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/hoc/windowWrapper.tsx): hoc · Shared window chrome and behavior wrapper · `src/hoc/windowWrapper.tsx`
- [Navbar](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/Navbar.tsx): shell component · Persistent top-level desktop navigation · `src/components/Navbar.tsx`
- [Dock](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/Dock.tsx): shell component · Launcher for opening windows · `src/components/Dock.tsx`
- [Window Control](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/WindowControl.tsx): shell component · Shared close/minimize/zoom controls · `src/components/WindowControl.tsx`
- [Welcome](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/components/Welcome.tsx): shell component · Intro or landing content in the desktop shell · `src/components/Welcome.tsx`

### Window State

Global store and window layout/focus state

- [Store](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/store/store.ts): redux store · Global state container for window behavior · `src/store/store.ts`
- [Window Slice](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/store/windows/windowSlice.ts): state slice · Open/close, focus, and stacking state · `src/store/windows/windowSlice.ts`
- [Location Slice](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/store/windows/locationSlice.ts): state slice · Window position and layout state · `src/store/windows/locationSlice.ts`

### Windows

Specialized in-app desktop windows

- [Desktop](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Desktop.tsx): window · Desktop surface and background experience · `src/windows/Desktop.tsx`
- [Finder](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Finder.tsx): window · File-browser style window · `src/windows/Finder.tsx`
- [Safari](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Safari.tsx): window · Browser-style window · `src/windows/Safari.tsx`
- [Safari Home](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/SafariHome.tsx): window content · Landing page for the browser window · `src/windows/SafariHome.tsx`
- [Terminal](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Terminal.tsx): window · Command-line styled personal/info window · `src/windows/Terminal.tsx`
- [Resume](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Resume.tsx): window · Resume/document viewer · `src/windows/Resume.tsx`
- [Contact](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Contact.tsx): window · Contact information window · `src/windows/Contact.tsx`
- [Photo](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/Photo.tsx): window · Photo/media viewing window · `src/windows/Photo.tsx`
- [Text Viewer](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/TextViewer.tsx): window · Plain text document viewer · `src/windows/TextViewer.tsx`
- [Image Viewer](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/src/windows/ImageViewer.tsx): window · Image preview window · `src/windows/ImageViewer.tsx`

### Assets

Static files consumed by the UI

- [Resume PDF](https://github.com/mokshith-moksh/mokshith/blob/https/github.com/mokshith-moksh/README.md/public/files/resume.pdf): static asset · Downloadable resume document · `public/files/resume.pdf`
- [Icons](https://github.com/mokshith-moksh/mokshith/tree/https/github.com/mokshith-moksh/README.md/public/icons): static assets · Desktop and app icon assets · `public/icons`
- [Images](https://github.com/mokshith-moksh/mokshith/tree/https/github.com/mokshith-moksh/README.md/public/images): static assets · Visual assets used by windows and desktop · `public/images`

## Connections

- main → App: renders · Entry point mounts the top-level app
- App → Store: uses · App reads and updates global UI state
- Store → Window Slice: includes · Store combines window visibility and focus state
- Store → Location Slice: includes · Store combines window placement state
- App → Navbar: composes · Persistent shell navigation
- App → Dock: composes · Launcher for desktop windows
- App → Welcome: composes · Landing content inside the shell
- App → Desktop: composes · Desktop surface is part of the main composition
- App → Window Wrapper: wraps · Window instances share the same frame boundary
- Window Wrapper → Window Control: contains · Provides common window controls
- Dock → Window Slice: dispatches · Dock actions open or activate windows
- Navbar → Window Slice: dispatches · Navbar actions affect window state
- Desktop → Window Slice: reads · Desktop reflects open windows and focus
- Desktop → Location Slice: reads · Desktop uses stored placement data
- Finder → Window Wrapper: wrapped by · Finder uses the shared window frame
- Safari → Window Wrapper: wrapped by · Safari uses the shared window frame
- Terminal → Window Wrapper: wrapped by · Terminal uses the shared window frame
- Resume → Window Wrapper: wrapped by · Resume uses the shared window frame
- Contact → Window Wrapper: wrapped by · Contact uses the shared window frame
- Photo → Window Wrapper: wrapped by · Photo uses the shared window frame
- Text Viewer → Window Wrapper: wrapped by · Text viewer uses the shared window frame
- Image Viewer → Window Wrapper: wrapped by · Image viewer uses the shared window frame
- Safari → Safari Home: shows · Safari includes a home/landing view
- Resume → Resume PDF: loads · Resume window serves the PDF asset
- Desktop → Icons: uses · Desktop uses icon assets
- Photo → Images: uses · Photo window depends on image assets
- Image Viewer → Images: uses · Image viewer depends on image assets
- Finder → Images: uses · Finder likely previews local images
