deep-research-web-ui

repository·main·Indexed 24 days ago

https://github.com/anotiawang/deep-research-web-ui

A visual interface for the deep-research project featuring real-time AI response streaming, tree-structured search visualization, and research report exports to Markdown and PDF. It supports Client Mode for static deployments and Server Mode for SSR/Nitro runtimes, with integrations for multiple AI providers (including OpenAI-compatible, DeepSeek, and Ollama) and web search providers (Tavily, Firecrawl, CRW, and Google PSE).

Tokens
4.7K
Snippets
8
Records
28
Agent score
80%

What's inside deep-research-web-ui

  1. Understand Deployment Modes: Client vs Server

    main

    Deep Research Web UI supports two primary deployment modes depending on your hosting environment and how you want to manage API keys:

    1. Client Mode: Users enter their own API keys directly in the browser. This is ideal for static deployments (e.g., EdgeOne Pages, GitHub Pages) using pnpm generate. It is highly secure as configuration and requests stay local to the user's browser.
    2. Server Mode: API keys are configured via server-side environment variables. Users do not need to enter keys in the UI. This requires an SSR/Nitro runtime (e.g., a Docker container) and is not compatible with purely static deployments.
  2. Understand the two deployment modes

    main

    Deep Research Web supports two distinct deployment modes depending on your hosting environment and security requirements:

    1. Client Mode (Traditional): API keys are entered by the user directly in the browser. This is ideal for static hosting (e.g., EdgeOne Pages, GitHub Pages) or using pnpm generate. It is highly private as configuration and requests stay in the browser.
    2. Server Mode (Recommended): API keys are configured via server-side environment variables. Users do not need to enter keys in the UI. This requires an SSR/Nitro runtime (like Docker or a Nuxt server) and is not suitable for pure static deployment.
  3. Set up the development environment

    main

    To develop locally, ensure you have pnpm installed, then follow these steps:

    1. Install dependencies:
    pnpm install
    1. Start the development server:
    pnpm dev

    The server will be available at http://localhost:3000.

    1. To build for production:
    • For SSR (Server Side Rendering): pnpm build
    • For SSG (Static Site Generation): pnpm generate
    1. To preview a local production build:
    pnpm preview
    pnpm install
    pnpm dev
  4. Setup and development guide

    main

    To develop locally or build the project from source, follow these steps:

    1. Install dependencies

    pnpm install

    2. Run development server Starts a local server at http://localhost:3000.

    pnpm dev

    3. Build for production

    • SSR Mode (for Server Mode deployment):
      pnpm build
    - **SSG Mode** (for Client Mode/Static deployment):
      ```bash
    pnpm generate

    4. Preview production build

    pnpm preview
    pnpm install
    pnpm dev
    pnpm build
    pnpm generate
    pnpm preview
  5. Deploy in Client Mode using Docker

    main

    Client Mode is used for static deployments where users provide their own keys in the UI.

    Using a pre-built image:

    docker run -p 3000:3000 --name deep-research-web -d anotia/deep-research-web:latest

    Using a self-built image:

    git clone https://github.com/AnotiaWang/deep-research-web-ui
    cd deep-research-web-ui
    docker build -t deep-research-web .
    docker run -p 3000:3000 --name deep-research-web -d deep-research-web
  6. Build and Deploy for Production

    main

    Depending on your target deployment, use the appropriate build command:

    • SSR Application (Requires a Node.js/Nitro runtime, e.g., Docker):

      pnpm build
    • Static/SSG Application (For EdgeOne Pages, GitHub Pages, etc.):

      pnpm generate

    To test your production build locally:

    pnpm preview
  7. Deploy in Server Mode using Docker

    main

    To deploy in Server Mode where API keys are managed via environment variables, use Docker. This mode requires a Nuxt server environment.

    Option 1: Using environment variables directly in the command line

    docker run -p 3000:3000 \
      -e NUXT_PUBLIC_SERVER_MODE=true \
      -e NUXT_AI_API_KEY=your-ai-api-key \
      -e NUXT_WEB_SEARCH_API_KEY=your-search-api-key \
      -e NUXT_PUBLIC_AI_PROVIDER=openai-compatible \
      -e NUXT_PUBLIC_AI_MODEL=gpt-4o-mini \
      -e NUXT_PUBLIC_WEB_SEARCH_PROVIDER=tavily \
      anotia/deep-research-web:latest

    Option 2: Using an .env file

    1. Copy the example file: cp .env.example .env
    2. Fill in your configuration in the .env file.
    3. Run the container:
    docker run -p 3000:3000 --env-file .env anotia/deep-research-web:latest
    docker run -p 3000:3000 \
      -e NUXT_PUBLIC_SERVER_MODE=true \
      -e NUXT_AI_API_KEY=你的AI-API密钥 \
      -e NUXT_WEB_SEARCH_API_KEY=你的搜索API密钥 \
      -e NUXT_PUBLIC_AI_PROVIDER=openai-compatible \
      -e NUXT_PUBLIC_AI_MODEL=gpt-4o-mini \
      -e NUXT_PUBLIC_WEB_SEARCH_PROVIDER=tavily \
      anotia/deep-research-web:latest
  8. Configure the application UI theme

    main

    The application's visual theme can be customized using the defineAppConfig function in app/app.config.ts. Currently, you can specify the primary color for the UI components. The value should be a valid color name or theme identifier (e.g., 'violet').

    export default defineAppConfig({
      ui: {
        colors: {
          primary: 'violet',
        },
      },
    })
  9. Configure Web Search Providers

    main

    The searchWeb function and createWebSearch factory allow you to perform web searches using different providers. You must provide a WebSearchConfig object specifying the provider and necessary credentials.

    Supported providers and their specific configuration requirements:

    • firecrawl or crw: Requires apiKey. You can optionally provide an apiBase URL.
      • Default Firecrawl API: https://api.firecrawl.dev
      • Default CRW API: https://fastcrw.com/api
    • google-pse: Requires both apiKey and googlePseId. Supports a lang option in WebSearchOptions to filter results by language (e.g., en).
    • tavily: Requires apiKey. Supports advanced search settings via tavilyAdvancedSearch (boolean) and tavilySearchTopic ('general' | 'news' | 'finance').
  10. Configure i18n settings

    main

    The internationalization (i18n) configuration for the project is defined using defineI18nConfig. It specifies the available languages, the fallback language used when a translation is missing, and the message objects for each locale.

    Key configuration options:

    • legacy: Set to false to use the Composition API instead of the Options API.
    • fallbackLocale: The locale used when the requested translation is not found (currently set to 'zh').
    • availableLocales: An array of supported locale codes (e.g., ['en', 'zh', 'nl']).
    • messages: An object mapping locale codes to their respective translation JSON objects.
    export default defineI18nConfig(() => ({
      legacy: false,
      fallbackLocale: 'zh',
      availableLocales: ['en', 'zh', 'nl'],
      messages: {
        en,
        zh,
        nl,
      },
    }))
  11. Configure Prettier settings

    main

    The project uses Prettier for code formatting. The following configuration is applied to the repository to ensure consistent style across TypeScript, Vue, and HTML files:

    • semi: false: Omit semicolons.
    • vueIndentScriptAndStyle: true: Indent code inside <script> and <style> tags in Vue files.
    • singleQuote: true: Use single quotes instead of double quotes.
    • trailingComma: 'all': Print trailing commas wherever possible.
    • proseWrap: 'never': Do not wrap prose in markdown files.
    • htmlWhitespaceSensitivity: 'strict': Use strict whitespace sensitivity for HTML.
    • endOfLine: 'auto': Use the platform-specific line ending.
    • printWidth: 100: Set the line length limit to 100 characters.
    module.exports = {
      semi: false,
      vueIndentScriptAndStyle: true,
      singleQuote: true,
      trailingComma: 'all',
      proseWrap: 'never',
      htmlWhitespaceSensitivity: 'strict',
      endOfLine: 'auto',
      printWidth: 100,
    }
  12. Reference supported AI and Search providers

    main

    The following values are supported for provider configuration:

    AI Providers (NUXT_PUBLIC_AI_PROVIDER):

    • openai-compatible
    • siliconflow
    • 302-ai
    • infiniai
    • openrouter
    • deepseek
    • ollama

    Web Search Providers (NUXT_PUBLIC_WEB_SEARCH_PROVIDER):

    • tavily
    • firecrawl
    • crw (fastCRW)
    • google-pse