Mixedbread Starter

R
Renaudil y a 2 jours
0

Description

A starter template for integrating Mixedbread Search into ecommerce applications using Next.js, Vercel, and Mixedbread.

npx boilerapp mixedbread-starter

文档

Vercel Integration Ecommerce Demo

A starter template for integrating Mixedbread Search into ecommerce applications using Next.js, Vercel, and Mixedbread.

Note: This is a demo store that is currently not publicly accessible. We will add public stores in the future. Feel free to explore the code and use this as a starter template to build your own AI-powered search application.

Deploy with Vercel

See it in action:

https://github.com/user-attachments/assets/e57e6d13-10b0-40f7-9b3b-29e7d04c0de1

Getting Started

Prerequisites

  • Node.js 22+
  • Git

1. Clone the Repository

git clone <your-repo-url>
cd vercel-integration-ecommerce

2. Install Dependencies

npm install

3. Set Up Environment Variables

Create a .env file in the root directory:

cp .env.example .env

Add your Mixedbread API key to the .env file:

MXBAI_API_KEY=your-api-key-here
MXBAI_STORE_ID=your-store-id

To get your API key and store ID, you have two options:

  1. From Vercel Integration (Recommended if deploying to Vercel):

    • Go to your Vercel Dashboard
    • Navigate to your project's Integrations tab
    • Install or access the Mixedbread integration
    • Copy your API key and store ID from the integration settings
  2. From Mixedbread Platform (For standalone use):

    • Visit the Mixedbread Platform
    • Sign up or log in to your account
    • Navigate to API Keys and create a new key
    • Copy your API key and store ID from the platform

4. Update Code and Metadata

This template is pre-configured to work with the commerce dataset. If you're using your own dataset, you'll need to update the code to match your metadata structure and content URLs.

Key files to update:

  1. lib/types.ts - Update the ProductMetadata interface to match your dataset's metadata fields
  2. components/product-grid.tsx - Update references to metadata fields (e.g., metadata.name, metadata.description) and image_url.url
  3. app/api/search/route.ts - Adjust search parameters if needed (e.g., top_k, score_threshold)

Example metadata structure used in this template:

{
  name: string;
  description?: string;
  filename?: string;
  price?: number;
  category?: string;
  // ... other fields
}

The template also expects search results to include an image_url.url field for product images.

5. Run the Application

Start the development server:

npm run dev

Open http://localhost:3000 in your browser to see the application.

Learn More

Mixedbread Resources

License

MIT

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联络我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联络我们,我们将尽快回复。

Mixedbread Starter | BoilerApp