Requirements
Before you begin, make sure you have the following installed:
node --versionnpm install -g pnpmInstallation Steps
Create a New Project
Run the VexBlocks CLI to create a new project. This will set up a complete Turborepo monorepo with all the necessary configuration:
npx @vexblocks/cli initFollow the interactive prompts to configure your project.
Navigate to Project
Change into your newly created project directory:
cd my-vexblocks-projectInstall Dependencies
Install all required npm packages using pnpm:
pnpm installAdd VexBlocks Packages
Add the CMS dashboard, backend, and other packages:
npx @vexblocks/cli add allThis installs the CMS dashboard, Convex backend, shared utilities, and type generator.
Configure VexBlocks
Update your application settings in packages/backend/convex/cms/vexblocks.config.ts:
const config: VexBlocksConfig = {
appName: "My App",
email: {
fromName: "My App",
fromAddress: "noreply@yourdomain.com",
},
}These settings control your application name (used in email subjects) and the sender information for transactional emails.
Set Up Convex
Create a Convex account and initialize your backend:
cd packages/backend
npx convex devThis will prompt you to log in and create a new Convex project. Copy the deployment URL when provided.
Configure Environment Variables
Copy the environment example file and fill in your Convex deployment details:
# In the root of your project
cp .env.example .env.local
# Add your Convex URL
NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud
CONVEX_DEPLOYMENT=your-deployment
SITE_URL=http://localhost:3001Start Development
Run the development server for all packages:
pnpm devThis will start:
- CMS Dashboard at
http://localhost:3001 - Convex backend (watching for changes)
- Any other apps in your workspace
Success! Your VexBlocks CMS is now running. Visit http://localhost:3001 to access the dashboard.
Adding to Existing Project
If you already have a Turborepo project and want to add VexBlocks to it:
# In your Turborepo root
npx @vexblocks/cli init
# Then add packages
npx @vexblocks/cli add allThe CLI will detect your existing Turborepo and integrate VexBlocks seamlessly.
Optional: Cloudflare Images
For the media library feature, you can optionally set up Cloudflare Images:
- Create a Cloudflare account
- Enable Cloudflare Images in your dashboard
- Add your account ID and API token to
.env.local:
CLOUDFLARE_ACCOUNT_ID=your-account-id
CLOUDFLARE_SECRET_TOKEN=your-api-tokenTroubleshooting
Port Already in Use
If port 3001 is already in use, you can change it in apps/cms/package.json:
"scripts": {
"dev": "next dev --port 3002"
}Convex Connection Errors
Make sure:
- Your
NEXT_PUBLIC_CONVEX_URLis correctly set - The Convex backend is running (
npx convex devinpackages/backend) - You're logged in to Convex
pnpm Install Fails
Try clearing the pnpm cache and reinstalling:
pnpm store prune
pnpm installNext Steps
- Follow the Quick Start guide to create your first schema
- Learn about creating schemas
- Explore CLI commands for managing your project