# InvokeAI Web UI - [InvokeAI Web UI](#invokeai-web-ui) - [Core Libraries](#core-libraries) - [Redux Toolkit](#redux-toolkit) - [Socket\.IO](#socketio) - [Chakra UI](#chakra-ui) - [KonvaJS](#konvajs) - [Vite](#vite) - [i18next & Weblate](#i18next--weblate) - [openapi-typescript](#openapi-typescript) - [Client Types Generation](#client-types-generation) - [Package Scripts](#package-scripts) - [Contributing](#contributing) - [Dev Environment](#dev-environment) - [VSCode Remote Dev](#vscode-remote-dev) - [Production builds](#production-builds) The UI is a fairly straightforward Typescript React app. ## Core Libraries The app makes heavy use of a handful of libraries. ### Redux Toolkit [Redux Toolkit](https://github.com/reduxjs/redux-toolkit) is used for state management and fetching/caching: - `RTK-Query` for data fetching and caching - `createAsyncThunk` for a couple other HTTP requests - `createEntityAdapter` to normalize things like images and models - `createListenerMiddleware` for async workflows We use [redux-remember](https://github.com/zewish/redux-remember) for persistence. ### Socket\.IO [Socket\.IO](https://github.com/socketio/socket.io) is used for server-to-client events, like generation process and queue state changes. ### Chakra UI [Chakra UI](https://github.com/chakra-ui/chakra-ui) is our primary UI library, but we also use a few components from [Mantine v6](https://v6.mantine.dev/). ### KonvaJS [KonvaJS](https://github.com/konvajs/react-konva) powers the canvas. In the future, we'd like to explore [PixiJS](https://github.com/pixijs/pixijs) or WebGPU. ### Vite [Vite](https://github.com/vitejs/vite) is our bundler. ### i18next & Weblate We use [i18next](https://github.com/i18next/react-i18next) for localisation, but translation to languages other than English happens on our [Weblate](https://hosted.weblate.org/engage/invokeai/) project. **Only the English source strings should be changed on this repo.** ### openapi-typescript [openapi-typescript](https://github.com/drwpow/openapi-typescript) is used to generate types from the server's OpenAPI schema. See TYPES_CODEGEN.md. ## Client Types Generation We use [`openapi-typescript`](https://github.com/drwpow/openapi-typescript) to generate types from the app's OpenAPI schema. The generated types are written to `invokeai/frontend/web/src/services/api/schema.d.ts`. This file is committed to the repo. The server must be started and available at . ```sh # from the repo root, start the server python scripts/invokeai-web.py # from invokeai/frontend/web/, run the script yarn typegen ``` ## Package Scripts See `package.json` for all scripts. Run with `yarn