Skip to main content
Prism is a Next.js application. You can run it locally or deploy it to any platform that supports Node.js. This guide walks through cloning the repo, wiring up the required services, and starting the dev server.
Prism was built as a hackathon project. It is not hardened for production multi-tenant deployments. If you are running it for more than personal use, review the authentication and storage permissions carefully before exposing it publicly.

Prerequisites

Before you begin, make sure you have the following:
  • Node.js 20+ — Prism uses Next.js 16 with React 19
  • Appwrite project — cloud or self-hosted; you need a project ID and a storage bucket
  • QdrantQdrant Cloud (free tier works) or a local Qdrant instance
  • Google AI API key — for Gemini chat, RAG, and embedding generation; get one from Google AI Studio

Setup

1

Clone the repository

git clone https://github.com/DawnSaju/Prism
cd Prism
2

Install dependencies

npm install
3

Configure environment variables

Create a .env.local file in the project root and add the following variables:
.env.local
# Appwrite (client-side)
NEXT_PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
NEXT_PUBLIC_APPWRITE_PROJECT_ID=your_project_id
NEXT_PUBLIC_APPWRITE_BUCKET_ID=your_bucket_id

# Appwrite (server-side — used by API routes)
APPWRITE_API_KEY=your_appwrite_server_api_key
NEXT_PUBLIC_APPWRITE_DATABASE_ID=your_database_id
NEXT_PUBLIC_APPWRITE_CHAT_HISTORY_COLLECTION_ID=your_chat_history_collection_id

# Qdrant
QDRANT_CLUSTER_URL=https://your-cluster.qdrant.io
QDRANT_API_KEY=your_qdrant_api_key

# Google Gemini
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key
Appwrite (client-side)
  • NEXT_PUBLIC_APPWRITE_ENDPOINT — The API endpoint for your Appwrite instance. For Appwrite Cloud this is https://cloud.appwrite.io/v1. For self-hosted Appwrite, use your own domain.
  • NEXT_PUBLIC_APPWRITE_PROJECT_ID — Found in your Appwrite Console under Settings → General.
  • NEXT_PUBLIC_APPWRITE_BUCKET_ID — Create a storage bucket in Storage → Buckets, then copy the bucket ID.
Appwrite (server-side)
  • APPWRITE_API_KEY — A server API key with users.write and databases.read/databases.write permissions. Create one in Settings → API Keys in the Appwrite Console. This key is used by Next.js API routes (never exposed to the browser).
  • NEXT_PUBLIC_APPWRITE_DATABASE_ID — The ID of the Appwrite Database where chat history is stored. Create a database in Databases and copy its ID.
  • NEXT_PUBLIC_APPWRITE_CHAT_HISTORY_COLLECTION_ID — The ID of the collection within that database for storing chat sessions. Create a collection with fields: userId (string), title (string), messages (string), selectedDocument (string, nullable), createdAt (string), updatedAt (string).
Qdrant
  • QDRANT_CLUSTER_URL — Your Qdrant Cloud cluster URL (e.g. https://abc123.us-east4-0.gcp.cloud.qdrant.io), or http://localhost:6333 for a local instance.
  • QDRANT_API_KEY — Found in your Qdrant Cloud console under cluster details. Leave empty if using a local unauthenticated instance.
Google Gemini
  • NEXT_PUBLIC_GEMINI_API_KEY — Generated in Google AI Studio. Prism uses gemini-2.5-flash for chat and RAG, and text-embedding-004 for generating 768-dimensional embeddings.
4

Start the development server

npm run dev
The app will be available at http://localhost:3000.

Qdrant collection

Prism manages a single Qdrant collection named prism_documents. On first use, it is created automatically with the following configuration:
SettingValue
Collection nameprism_documents
Vector size768 dimensions
Distance metricCosine
Indexing threshold10,000 vectors
Payload indexes are also created on userId, documentId, documentType, and category to enable per-user filtering and type-based search. You do not need to create the collection manually.
If you point multiple Prism instances at the same Qdrant cluster, they will share the same collection. Per-user isolation is enforced at query time by filtering on userId, but you should treat the cluster as single-tenant for now.

Appwrite setup

Prism uses Appwrite for authentication and file storage. A few things to configure in your Appwrite project:
  • Auth providers — Enable Email/Password and optionally Google OAuth under Auth → Settings. For Google OAuth, set the success redirect to http://localhost:3000/dashboard and the failure redirect to http://localhost:3000/auth/login?error=oauth_failed.
  • Storage bucket — Create a bucket and note its ID for NEXT_PUBLIC_APPWRITE_BUCKET_ID. File permissions are set per-user on upload.
  • Server API key — The /api/users/assign-plan internal route uses node-appwrite with server-side credentials to assign plan labels to new users. Add a server API key with users.write permissions and set it as APPWRITE_API_KEY in your environment if you want plan labels to work.

Running in production

To build and run a production bundle:
npm run build
Prism is a standard Next.js app and can be deployed to Vercel, a Node.js server, or any container-based platform. Ensure all environment variables from .env.local are available in your deployment environment.

Build docs developers (and LLMs) love