Skip to main content

Prerequisites

Before you begin, make sure you have the following installed:
  • Node.js (version 18 or higher)
  • npm or yarn package manager
  • Git for version control

Installation Methods

The easiest way to create a new project is using npx:
npx moorcheh-chat-boilerplate
This will:
  • Prompt you for a project name
  • Create a new directory with all boilerplate files
  • Set up the basic project structure

Option 2: Global Installation

You can also install the boilerplate globally:
npm install -g moorcheh-chat-boilerplate
Then create new projects with:
moorcheh-chat-boilerplate

Project Setup

1. Install Dependencies

Navigate to your project directory and install dependencies:
cd your-project-name
npm install

2. Get Your Moorcheh API Key

You’ll need an API key to connect to Moorcheh AI services:
1

Visit Console

2

Sign Up/Login

Create an account or log in to your existing account
3

Get API Key

Navigate to API Keys and create a new key
4

Copy Key

Copy your API key for the next step
Keep your API key secure and never share it publicly. Store it as an environment variable.

3. Create Text Namespace

Set up a namespace to store your documents for AI chat:
1

Visit Namespaces

2

Create Namespace

Click “Create Namespace” and choose “Text” as the type
3

Name Your Namespace

Enter a descriptive name (e.g., “my-chat-docs”)
4

Upload Documents

Upload your documents to the namespace
Supported file formats: PDF, DOCX, CSV, JSON, TXT, MD, Excel files

4. Set Environment Variables

Create a .env.local file in your project root:
NEXT_PUBLIC_MOORCHEH_API_KEY=your_api_key_here

5. Configure API Settings

Set up your API configuration using the Moorcheh Console Playground:
1

Visit Playground

2

Select Namespace

Choose your text namespace from the dropdown
3

Choose AI Model

Select your preferred AI model
4

Configure Settings

Adjust temperature, top-k, and other parameters
5

Export Configuration

Click “Export” to download the configuration JSON
6

Save Configuration

Copy the JSON content into config/api-config.json in your project

6. Start Development Server

You’re ready to start developing! Run the development server:
npm run dev

Interactive Setup (Optional)

Use the interactive setup flow to customize your application: Visit http://localhost:3000/landing for our 4-step interactive setup:

Step 1: API Key Setup

Connect to Moorcheh AI services

Step 2: Branding

Configure app name, company, and contact info

Step 3: Theme Selection

Choose from 10+ beautiful themes

Step 4: Typography & Complete

Configure fonts and finish setup

Testing Your Setup

Demo Page

Visit http://localhost:3000/demo to test themes and fonts.

Chat Interface

Your main chat interface is available at http://localhost:3000.

Troubleshooting

Common Issues

  • Ensure Node.js version 18+ is installed
  • Check that all dependencies are installed with npm install
  • Verify your environment variables are set correctly
  • Verify your API key is correct
  • Check that your namespace exists and has documents
  • Ensure your configuration file is properly formatted
  • Clear browser cache
  • Check that configuration files are saved correctly
  • Restart the development server

Getting Help

If you encounter issues:
  1. Check the configuration guide
  2. Review the deployment guide
  3. Contact support at support@moorcheh.ai

Next Steps

Now that you have your project set up, you can: