Installation & Setup
This guide covers setting up TaskForge Studio for local development and deploying to production. TaskForge Studio is built with Next.js 14 and requires several third-party services for full functionality.Prerequisites
Before you begin, ensure you have:- Node.js: Version 20 or higher
- npm, yarn, pnpm, or bun: Package manager of your choice
- Git: For cloning the repository
- Clerk Account: For authentication (clerk.com)
- Convex Account: For backend database (convex.dev)
- Liveblocks Account: For real-time collaboration (liveblocks.io)
TaskForge Studio integrates three essential services:
- Clerk: User authentication and organization management
- Convex: Real-time backend database for board storage
- Liveblocks: Real-time collaboration and presence
Local Development Setup
Install Dependencies
Install all required packages using your preferred package manager:This will install all dependencies from
package.json:Configure Environment Variables
Create a
.env.local file in the project root with the following variables:.env.local
Set Up Clerk Authentication
- Go to clerk.com and create an account
- Create a new application
- Enable Organizations feature in the Clerk dashboard
- Copy your publishable key and secret key
- Configure allowed redirect URLs:
http://localhost:3000- Your production domain
- User sign-up and sign-in
- Organization creation and management
- User profiles and avatars
- Session management
Set Up Convex Database
-
Install Convex CLI globally:
-
Initialize Convex in your project:
-
Follow the prompts to:
- Log in to your Convex account
- Create a new project
- Link to your local development
-
The Convex URL will be automatically added to your
.env.local
- boards: Board metadata (title, author, organization, image)
- userFavorites: User’s favorited boards
Set Up Liveblocks
- Go to liveblocks.io and create an account
- Create a new project
- Copy your secret key
- Configure the Liveblocks authentication endpoint
liveblocks.config.ts:11-54:app/api/liveblocks-auth/route.ts:Run the Development Server
Start the Next.js development server:The application will be available at http://localhost:3000
Make sure Convex is also running (
npx convex dev) in a separate terminal for the backend to work.Project Structure
Understand the TaskForge Studio codebase:Key Files
canvas.tsx
Line 46: Main canvas component
Handles all drawing operations, layer management, and real-time collaboration.
Handles all drawing operations, layer management, and real-time collaboration.
board.ts
Convex mutations: Create, update, delete, favorite operations
Backend logic for board management.
Backend logic for board management.
liveblocks.config.ts
Line 11: Liveblocks client setup
Real-time presence and storage configuration.
Real-time presence and storage configuration.
canvas.ts (types)
Layer types: Rectangle, Ellipse, Text, Note, Path
TypeScript definitions for canvas objects.
TypeScript definitions for canvas objects.
Building for Production
Build the Application
Create an optimized production build:This will:
- Compile TypeScript
- Optimize React components
- Bundle and minify assets
- Generate static pages where possible
Test Production Build Locally
Deployment Options
Deploy to Vercel (Recommended)
TaskForge Studio is optimized for Vercel deployment:Connect to Vercel
- Push your code to GitHub, GitLab, or Bitbucket
- Go to vercel.com and import your repository
- Vercel will automatically detect Next.js
Configure Environment Variables
Add all environment variables from
.env.local to Vercel:- Go to Project Settings > Environment Variables
- Add each variable (Clerk keys, Convex URL, Liveblocks keys)
- Make sure to set them for Production, Preview, and Development
Deploy Convex to Production
NEXT_PUBLIC_CONVEX_URL in Vercel with the production URL.Update Clerk & Liveblocks
- Clerk: Add your Vercel domain to allowed origins
- Liveblocks: Update CORS settings to include your domain
Alternative Platforms
Netlify
- Connect your Git repository
- Set build command:
npm run build - Set publish directory:
.next - Add environment variables
Self-Hosted
- Build with
npm run build - Run with
npm start - Use PM2 or Docker for process management
- Configure reverse proxy (Nginx/Apache)
Railway
- Import from GitHub
- Railway auto-detects Next.js
- Add environment variables
- Deploy with one click
Docker
Create a
Dockerfile:Configuration
Clerk Configuration
Organization Settings: Enable organizations in Clerk dashboardConvex Schema
Define your database schema inconvex/schema.ts:
Liveblocks Room Configuration
Troubleshooting
Authentication Not Working
- Verify Clerk environment variables are set correctly
- Check that your domain is added to Clerk’s allowed origins
- Ensure organizations are enabled in Clerk dashboard
Convex Connection Failed
- Make sure
npx convex devis running during development - Verify
NEXT_PUBLIC_CONVEX_URLmatches your deployment - Check that Clerk integration is configured in Convex dashboard
Liveblocks Not Syncing
- Verify authentication endpoint at
/api/liveblocks-authis working - Check CORS settings in Liveblocks dashboard
- Ensure
LIVEBLOCKS_SECRET_KEYis set correctly
Build Errors
- Clear
.nextfolder:rm -rf .next - Delete
node_modules:rm -rf node_modules && npm install - Check TypeScript errors:
npx tsc --noEmit
Performance Optimization
TaskForge Studio includes several performance optimizations:
- Layer Limit: Maximum 100 layers per board (defined in
canvas.tsx:40) - Liveblocks Throttling: Updates throttled to 16ms (~60fps)
- Suspense Boundaries: React Suspense for smooth loading states
- Optimistic Updates: UI updates immediately before server confirmation
Next Steps
Quickstart Guide
Learn how to use TaskForge Studio and create your first board
Canvas API
Explore the layer types and canvas operations
Customization
Customize colors, themes, and UI components
Contributing
Contribute to TaskForge Studio development
Need help? Check the troubleshooting section above or review the source code in the repository.