React + Vite

Instant-boot single page application template powered by Vite and shared UI components.

React + Vite in Morax

The Vite workspace (located at apps/desktop or custom client apps) provides an instant-boot, single-page application template powered by Rollup, ESBuild, and React 19.

SPA Architecture

Vite apps are ideal for client-heavy portals, admin dashboards, or Electron/Tauri desktop wrappers that don't require full server-side rendering:

apps/desktop Layout
apps/desktop/
├── src/
│   ├── main.tsx            # Application entrypoint
│   ├── App.tsx             # Root dashboard layout
│   └── index.css           # Tailwind CSS imports
├── index.html              # HTML shell
├── vite.config.ts          # Vite configuration with workspace resolver
└── package.json            # Desktop package dependencies

Shared Component Styling

Both Next.js and Vite applications consume the exact same UI components from @workspace/ui. When you modify a button or card, changes reflect across both applications instantly:

apps/desktop/src/App.tsx
// apps/desktop/src/App.tsx
import { useState } from 'react';
import { Button } from '@workspace/ui/components/button';

export function App() {
  const [count, setCount] = useState(0);

  return (
    <div className="flex flex-col items-center justify-center min-h-screen bg-black text-white p-6">
      <h1 className="text-3xl font-bold tracking-tight mb-4">Desktop App</h1>
      <Button onClick={() => setCount((c) => c + 1)}>
        Count is: {count}
      </Button>
    </div>
  );
}

Vite & TypeScript Configuration

Morax automatically configures Vite’s module resolution so symlinked monorepo packages are watched during development:

apps/desktop/vite.config.ts
// apps/desktop/vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
});