Skip to content

dancancer/p-studio

Repository files navigation

Pomegranate Studio

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.

✨ Features

  • 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.

ቴክ Stack

📂 Project Structure

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

🚀 Getting Started

Follow these instructions to set up and run the project locally.

1. Prerequisites

2. Installation

Clone the repository and install the dependencies:

git clone <repository-url>
cd pomegranate-studio
pnpm install

3. Environment Setup

Create a .env.local file in the root directory by copying the example file:

cp .env.local.example .env.local

Update the .env.local file with your specific environment variables, such as API keys for the AI models.

Google Search API Configuration

To enable Google Search functionality, you need to configure the following environment variables:

  • GOOGLE_API_KEY: Your Google Custom Search JSON API key
  • GOOGLE_SEARCH_ENGINE_ID: Your Google Custom Search Engine ID

Steps to obtain these credentials:

  1. 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
  2. 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_here

Note: These credentials are required for the Google Search MCP service to function properly. Without them, any features relying on Google Search will not work.

4. Database Migration

Generate and apply the database migrations to set up the SQLite database:

pnpm run db:generate
pnpm run db:migrate

5. Running the Development Server

Start the development server:

pnpm run dev

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

📜 Available Scripts

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.

About

A multi-platform AI client in browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published