Skip to main content
This guide walks you through running DocuSphere on your local machine for the first time. By the end, you will have all three services configured, both dev servers running, and a working document you can open in your browser.
1

Clone the repository and install dependencies

Clone the DocuSphere repository and install its Node.js dependencies.
git clone https://github.com/Pragyat-Nikunj/DocuSphere.git
cd DocuSphere
Then install dependencies with your preferred package manager:
npm install
2

Set up Convex

DocuSphere uses Convex as its backend — it stores documents and serves real-time queries.
  1. Create a free account at convex.dev.
  2. Create a new project from the Convex dashboard.
  3. Copy your Deployment name (shown as dev:your-deployment) and your Convex URL (e.g. https://your-deployment.convex.cloud).
You will use these values as CONVEX_DEPLOYMENT and NEXT_PUBLIC_CONVEX_URL in the next step.
3

Set up Clerk authentication

DocuSphere uses Clerk for user sign-in and organization management.
  1. Create a free account at clerk.com.
  2. Create a new application in the Clerk dashboard.
  3. From the API Keys section, copy:
    • Your Publishable key (starts with pk_test_)
    • Your Secret key (starts with sk_test_)
  4. From JWT Templates, note your Issuer domain (e.g. https://your-domain.clerk.accounts.dev). This is your CLERK_JWT_ISSUER_DOMAIN.
4

Set up Liveblocks

DocuSphere uses Liveblocks to power real-time presence, cursors, and room sync.
  1. Create a free account at liveblocks.io.
  2. Create a new project from the Liveblocks dashboard.
  3. Copy your Secret key from the API keys section (starts with sk_dev_).
This value is used as NEXT_PUBLIC_LIVEBLOCKS_SECRET_KEY. Despite the NEXT_PUBLIC_ prefix in the variable name, this key is only read in the server-side /api/liveblocks-auth route — it is never sent to the browser.
5

Create your .env.local file

Create a .env.local file in the root of the repository and fill in the values you collected in the previous steps:
.env.local
# Convex
CONVEX_DEPLOYMENT=dev:your-convex-deployment
NEXT_PUBLIC_CONVEX_URL=https://your-convex-url.convex.cloud
NEXT_PUBLIC_CONVEX_SITE_URL=https://your-convex-url.convex.site

# Clerk (Authentication)
CLERK_JWT_ISSUER_DOMAIN=https://your-clerk-domain.clerk.accounts.dev
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_publishable_key
CLERK_SECRET_KEY=sk_test_your_clerk_secret_key

# Liveblocks (Collaboration)
NEXT_PUBLIC_LIVEBLOCKS_SECRET_KEY=sk_dev_your_liveblocks_secret_key
Replace each placeholder value with the real credentials from the Convex, Clerk, and Liveblocks dashboards.
6

Start the dev servers

DocuSphere requires two servers running at the same time: the Convex backend and the Next.js frontend.In your first terminal, start the Convex dev server:
npx convex dev
In a second terminal, start the Next.js dev server:
npm run dev
Both servers must be running simultaneously. The Next.js app connects to Convex at runtime — if Convex is not running, document queries and mutations will fail.
7

Open the app and create your first document

Navigate to http://localhost:3000 in your browser.
  1. Sign in using the Clerk authentication flow.
  2. On the home screen, choose a template from the gallery or start from a blank document.
  3. Your document is created and saved automatically. Share the URL with another browser tab or another user to see real-time collaboration in action.

Build docs developers (and LLMs) love