How mokshith-moksh/mokshith works
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: windowWrapper.tsx Window Wrapper · App.tsx App · Desktop.tsx Desktop · windowSlice.ts Window Slice
Components 23
Bootstrap
Vite entry and app composition
Shell UI
Persistent desktop chrome and shared window frame
- Window Wrapper · Shared window chrome and behavior wrapper
src/hoc/windowWrapper.tsx - Navbar · Persistent top-level desktop navigation
src/components/Navbar.tsx - Dock · Launcher for opening windows
src/components/Dock.tsx - Window Control · Shared close/minimize/zoom controls
src/components/WindowControl.tsx - Welcome · Intro or landing content in the desktop shell
src/components/Welcome.tsx
Window State
Global store and window layout/focus state
- Store · Global state container for window behavior
src/store/store.ts - Window Slice · Open/close, focus, and stacking state
src/store/windows/windowSlice.ts - Location Slice · Window position and layout state
src/store/windows/locationSlice.ts
Windows
Specialized in-app desktop windows
- Desktop · Desktop surface and background experience
src/windows/Desktop.tsx - Finder · File-browser style window
src/windows/Finder.tsx - Safari · Browser-style window
src/windows/Safari.tsx - Safari Home · Landing page for the browser window
src/windows/SafariHome.tsx - Terminal · Command-line styled personal/info window
src/windows/Terminal.tsx - Resume · Resume/document viewer
src/windows/Resume.tsx - Contact · Contact information window
src/windows/Contact.tsx - Photo · Photo/media viewing window
src/windows/Photo.tsx - Text Viewer · Plain text document viewer
src/windows/TextViewer.tsx - Image Viewer · Image preview window
src/windows/ImageViewer.tsx
Assets
Static files consumed by the UI
- Resume PDF · Downloadable resume document
public/files/resume.pdf - Icons · Desktop and app icon assets
public/icons - Images · Visual assets used by windows and desktop
public/images
Connections 28
- 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