Pomegranate Studio is a modern, feature-rich chat application designed for seamless interaction with various AI models. It supports multi-session conversations, real-time AI responses, and a flexible architecture for future enhancements.
- Multi-Session Management: Easily create, switch between, and delete multiple conversation sessions.
- AI Model Integration: Supports a variety of AI models through the AI SDK.
- Rich UI Components: A beautiful and intuitive user interface built with Next.js, React, and antd-style.
- Scalable Architecture: Built with a modular structure, making it easy to extend and maintain.
- Data Persistence: Uses SQLite for storing conversation history, managed by Drizzle ORM.
- Framework: Next.js 15
- UI Library: React 19
- Styling: Tailwind CSS 4, antd-style
- API Routes: Hono
- State Management: Zustand
- Database ORM: Drizzle ORM
- Database: SQLite (via
libSQL) - AI Integration: Vercel AI SDK
The repository is structured to be modular and scalable:
/
├───.env.local # Local environment variables
├───drizzle/ # Drizzle ORM migration files
├───public/ # Static assets
├───src/
│ ├───app/ # Next.js application routes and API endpoints
│ ├───components/ # Reusable React components
│ ├───config/ # Application configuration (models, prompts, etc.)
│ ├───lib/ # Utility functions and libraries (db, utils)
│ ├───mcp/ # MCP (Model Context Protocol) services
│ ├───services/ # Business logic and services
│ ├───store/ # Zustand state management stores
│ └───types/ # TypeScript type definitions
├───package.json # Project dependencies and scripts
└───README.md # This file
Follow these instructions to set up and run the project locally.
Clone the repository and install the dependencies:
git clone <repository-url>
cd pomegranate-studio
pnpm installCreate a .env.local file in the root directory by copying the example file:
cp .env.local.example .env.localUpdate the .env.local file with your specific environment variables, such as API keys for the AI models.
To enable Google Search functionality, you need to configure the following environment variables:
GOOGLE_API_KEY: Your Google Custom Search JSON API keyGOOGLE_SEARCH_ENGINE_ID: Your Google Custom Search Engine ID
Steps to obtain these credentials:
-
Google API Key:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the "Custom Search JSON API" for your project
- Create credentials (API key) in the "Credentials" section
-
Search Engine ID:
- Go to Google Custom Search Engine
- Click "Create a custom search engine" or use an existing one
- In the search engine settings, find the "Search engine ID" (cx parameter)
Example configuration in .env.local:
GOOGLE_API_KEY=your_actual_api_key_here
GOOGLE_SEARCH_ENGINE_ID=your_actual_search_engine_id_hereNote: These credentials are required for the Google Search MCP service to function properly. Without them, any features relying on Google Search will not work.
Generate and apply the database migrations to set up the SQLite database:
pnpm run db:generate
pnpm run db:migrateStart the development server:
pnpm run devThe application will be available at http://localhost:3000.
The following scripts are available in the package.json:
dev: Starts the development server with Turbopack.build: Builds the application for production.start: Starts the production server.lint: Lints the codebase using Next.js's built-in ESLint configuration.preflight: Runs linting and a production build to check for errors.db:generate: Generates Drizzle ORM migration files based on schema changes.db:migrate: Applies the generated migrations to the database.