TNTStack
Architecture

Core Package

Business logic, pages, stores, hooks, providers, and configuration.

The business logic layer. Pages, Zustand stores, hooks, providers, navigation config, and smart components live here. This package depends on packages/ui for design system primitives and packages/i18n for translations.

Directory Structure

Components

The app shell. These three components compose together to form the sidebar dashboard layout used by both apps.

ComponentWhat it renders
app-layout.tsxFull layout wrapper (sidebar + header + content)
app-header.tsxTop bar with breadcrumbs and mobile trigger
app-sidebar.tsxSidebar that mounts all navigation groups

Feature components used in app pages.

ComponentWhat it does
greet.tsxGreeting form with Tauri/API toggle
language-card.tsxLanguage picker card
language-toggle.tsxCompact language toggle button
mode-card.tsxLight/dark/system selector
mode-toggle.tsxCompact mode toggle button
theme-card.tsxSingle theme preview with selection
themes-list.tsxSearchable theme gallery grid
sidebar-variant-card.tsxSidebar style picker
settings-card-skeleton.tsxLoading skeleton for settings cards

Sidebar navigation sections. Mounted inside app-sidebar.tsx.

ComponentWhat it renders
main-nav.tsxPrimary links (Home, Dashboard)
projects-nav.tsxProject list with dropdown actions
secondary-nav.tsxSecondary links (Settings, Feedback)
user-nav.tsxUser avatar with account menu

Pages

Full page components consumed by both apps. The app routes are thin wrappers around these.

PageRoute
HomePage.tsx/home
DashboardPage.tsx/dashboard
SettingsPage.tsx/settings
OverviewPage.tsx/dashboard/overview
AnalyticsPage.tsx/dashboard/analytics

This is why both apps can share the same UI: the page logic lives here, not in the apps.

Hooks

HookWhat it does
use-mounted.tsReturns true after first client render
use-theme-transition.tsView Transition API wrapper for smooth theme switching
use-language-switcher.tsLocale change with theme re-application

Stores

Zustand stores with localStorage persistence where needed.

StoreState
greet-store.tsGreeting form input + response
sidebar-store.tsOpen/closed state, sidebar variant
theme-store.tsSelected color theme (data-theme attribute)

Providers

ProviderWhat it does
theme-provider.tsxInjects the custom theme system (wraps next-themes)

Configuration

FileWhat it defines
navigation.tsSidebar navigation structure and routes
themes.tsTheme registry (40+ color schemes)
theme-init.tsScript injected into <head> to prevent flash of wrong theme

Utilities

FileWhat it provides
utils.tsfetchLatestGithubVersion() — fetches latest release tag from GitHub API
storage-utils.tsType-safe localStorage helpers for store persistence

Exports

Wildcard exports in package.json. No barrel files.

package.json (exports)
{
  "./components/*": "./src/components/*.tsx",
  "./pages/*": "./src/pages/*.tsx",
  "./pages/subpages/*": "./src/pages/subpages/*.tsx",
  "./hooks/*": "./src/hooks/*.ts",
  "./stores/*": "./src/stores/*.ts",
  "./config/*": "./src/config/*.ts",
  "./providers/*": "./src/providers/*.tsx",
  "./lib/*": "./src/lib/*.ts",
  "./scripts/*": "./src/scripts/*.ts"
}
// Usage
import { AppLayout } from "@workspace/core/components/layout/app-layout";
import { useThemeStore } from "@workspace/core/stores/theme-store";
import { HomePage } from "@workspace/core/pages/HomePage";
import { ThemeProvider } from "@workspace/core/providers/theme-provider";

Direct path imports (no barrel index). Tree-shaking works out of the box and circular dependency issues are avoided.

Dependency Flow

core → ui  (design system primitives)
core → i18n (translations)

ui must never import from core. The dependency flow is strictly one-directional: core → ui. This prevents circular dependencies and keeps the design system independent.

On this page