# Wall Construction API - GUI Technical Specification ## Philosophy: Minimal Dependencies, Maximum Standards This specification defines a **production-ready React GUI** with an absolute minimal dependency footprint while adhering to 2025 industry best practices. **Core Principle**: Every dependency must justify its existence. No bloat, no convenience libraries that add marginal value. --- ## Technology Stack ### Framework & Build Tools - **React 19.2.0** (October 2025 release) - Latest stable with React Compiler - Actions API for async operations - Enhanced form handling - Improved hydration and error reporting - **Vite 7.0** (2025 release) - Requires Node.js 20.19+ or 22.12+ - ESM-only distribution - Native `require(esm)` support - 5x faster builds than Vite 6 - Instant HMR (Hot Module Replacement) ### Styling & UI - **Tailwind CSS v4.0** (January 2025) - Zero configuration setup - Single CSS import: `@import "tailwindcss"` - Built-in Vite plugin - 5x faster full builds, 100x faster incremental builds - Modern CSS features (cascade layers, @property, color-mix) - P3 color palette for vibrant displays - Container queries support ### Data Visualization - **Recharts 2.x** (latest) - 24.8k GitHub stars - React-native component API - SVG-based rendering - Responsive by default - Composable chart primitives - Built on D3.js submodules ### HTTP & State - **Native Fetch API** (no axios, no external HTTP libs) - **React useState/useReducer** (no Redux, no Zustand, no external state libs) --- ## Dependencies ### Production Dependencies (3 total) ```json { "react": "^19.2.0", "react-dom": "^19.2.0", "recharts": "^2.15.0" } ``` ### Development Dependencies (2 total) ```json { "vite": "^7.0.0", "@tailwindcss/vite": "^4.0.0" } ``` **Total: 5 dependencies** --- ## Project Structure ``` wall-construction-gui/ ├── public/ │ └── favicon.ico ├── src/ │ ├── components/ # Reusable UI components │ │ ├── Button.jsx │ │ ├── Card.jsx │ │ ├── Input.jsx │ │ ├── Select.jsx │ │ ├── DatePicker.jsx │ │ ├── Spinner.jsx │ │ ├── ErrorBoundary.jsx │ │ └── charts/ │ │ ├── LineChart.jsx │ │ ├── BarChart.jsx │ │ └── AreaChart.jsx │ ├── pages/ # Page-level components │ │ ├── Dashboard.jsx │ │ ├── ProfileDetail.jsx │ │ ├── SimulationForm.jsx │ │ ├── SimulationResults.jsx │ │ ├── DailyIceUsage.jsx │ │ └── CostAnalytics.jsx │ ├── hooks/ # Custom React hooks │ │ ├── useApi.js │ │ ├── useFetch.js │ │ └── useDebounce.js │ ├── utils/ # Helper functions │ │ ├── api.js # Fetch wrapper │ │ ├── formatters.js # Number/date formatting │ │ └── constants.js # App constants │ ├── App.jsx # Root component │ ├── main.jsx # Entry point │ └── index.css # Global styles ├── index.html ├── vite.config.js └── package.json ``` --- ## Setup Instructions ### 1. Initialize Project ```bash # Create Vite project npm create vite@latest wall-construction-gui -- --template react cd wall-construction-gui ``` ### 2. Install Dependencies ```bash # Install production dependencies npm install react@19.2.0 react-dom@19.2.0 recharts # Install dev dependencies npm install -D vite@7 @tailwindcss/vite@4 ``` ### 3. Configure Vite **vite.config.js** ```javascript import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' export default defineConfig({ plugins: [ react(), tailwindcss() ], server: { port: 5173, proxy: { '/api': { target: 'http://localhost:8000', changeOrigin: true } } } }) ``` ### 4. Setup Tailwind CSS **src/index.css** ```css @import "tailwindcss"; /* CSS Custom Properties for Theme */ :root { --color-primary: #3b82f6; --color-secondary: #64748b; --color-success: #10b981; --color-danger: #ef4444; --color-warning: #f59e0b; --color-ice: #93c5fd; --color-gold: #fbbf24; } /* Global Styles */ body { @apply bg-gray-50 text-gray-900; } ``` ### 5. Run Development Server ```bash npm run dev ``` Server starts at `http://localhost:5173` --- ## Component Architecture ### Base Components #### Button Component ```jsx // src/components/Button.jsx export default function Button({ children, variant = 'primary', onClick, disabled = false, type = 'button' }) { const variants = { primary: 'bg-blue-600 hover:bg-blue-700 text-white', secondary: 'bg-gray-200 hover:bg-gray-300 text-gray-900', danger: 'bg-red-600 hover:bg-red-700 text-white' } return ( ) } ``` #### Card Component ```jsx // src/components/Card.jsx export default function Card({ children, className = '' }) { return (
{error}
)}{this.state.error?.message || 'An unexpected error occurred'}
{getMessage()}
{profile.team_lead}