Installation
This guide covers the complete setup of Shipr, including all required services and optional integrations. For a faster start, see the Quick Start guide.Prerequisites
Node.js 18+
Initial Setup
Install dependencies
package.json including:next(16.1.6) - Framework@clerk/nextjs- Authenticationconvex- Database and backend@ai-sdk/reactandai- AI functionalityresend- Email sending@sentry/nextjs- Error trackingposthog-js- Analytics- UI libraries (shadcn, Tailwind, etc.)
Configure Clerk (Required)
Clerk handles authentication, user management, and billing plan detection.Create a Clerk account
- Visit clerk.com
- Sign up for a free account
- Create a new application
Configure authentication methods
In your Clerk dashboard:
- Enable email/password authentication
- Optionally enable social providers (Google, GitHub, etc.)
- Configure your application name and branding
Configure redirect URLs
These are already set in You can customize these URLs if needed, but the defaults work out of the box.
.env.example:Configure Convex (Required)
Convex is your realtime database and backend.Create a Convex account
- Go to convex.dev
- Sign up with GitHub (recommended) or email
- Create a new project
Initialize Convex
Run the Convex development server:This will:
- Prompt you to log in if needed
- Push your schema from
convex/schema.ts - Generate your deployment URL
- Start watching for changes
Keep this terminal window open during development. Convex runs alongside Next.js.
Configure Clerk authentication
In the Convex dashboard:
- Select your project
- Go to Settings → Authentication
- Add Clerk as an authentication provider
- Enter your
CLERK_JWT_ISSUER_DOMAINvalue
Set Site URL (Required)
The site URL is used for metadata, canonical URLs, sitemaps, and OG images.Configure Resend (Required for Email)
Resend handles transactional emails like welcome messages and plan change notifications.Create a Resend account
- Visit resend.com
- Sign up for a free account
- You get 100 emails/day on the free tier
Get your API key
From the Resend dashboard:
- Navigate to API Keys
- Create a new API key
- Copy it to
.env:
Configure sender email
For local development/testing:For production with a verified domain:
Resend’s sandbox sender works for testing, but you’ll need to verify your domain for production.
Configure AI Chat (Optional)
The AI chat feature requires Vercel AI Gateway.Get AI Gateway API key
- Visit vercel.com
- Create or select a project
- Navigate to AI Gateway settings
- Generate an API key
.env:Configure PostHog (Optional)
PostHog provides product analytics with a reverse proxy to bypass ad blockers.Create a PostHog project
- Visit posthog.com
- Sign up for a free account
- Create a new project
Configure Sentry (Optional)
Sentry provides error tracking and performance monitoring.Create a Sentry project
- Go to sentry.io
- Create an account and organization
- Create a new Next.js project
Configure File Upload Rate Limiting (Optional)
Control image upload limits per user:Complete .env Example
Here’s what your.env should look like with all required services configured:
Start Development
With all services configured, you’re ready to run Shipr:Open your browser
Visit http://localhost:3000
Verify Setup
Check authentication
- Click “Sign Up” in the header
- Create a test account
- Complete the onboarding flow
- Verify you can access the dashboard
Check Convex sync
- Open the Convex dashboard
- Navigate to your project’s data
- Check the
userstable - you should see your test user
Database Schema
Shipr’s Convex schema (convex/schema.ts) includes:
Users Table
| Field | Type | Description |
|---|---|---|
clerkId | string | Clerk user ID (indexed) |
email | string | Primary email address |
name | string? | Full name |
imageUrl | string? | Profile image URL |
plan | string? | Billing plan: "free" or "pro" |
onboardingCompleted | boolean? | Whether user finished onboarding |
onboardingStep | string? | Current step: "welcome", "profile", etc. |
Files Table
| Field | Type | Description |
|---|---|---|
storageId | id("_storage") | Convex storage reference |
userId | id("users") | Owning user |
fileName | string | Original filename (sanitized) |
mimeType | string | MIME type (e.g., "image/png") |
size | number | File size in bytes |
Chat Tables
chatThreads:userId- Owner of the threadtitle- Auto-generated thread titlelastMessageAt- Timestamp for sorting
userId- Message ownerthreadId- Parent threadrole-"user"or"assistant"content- Message text
All tables automatically include
_id and _creationTime fields from Convex.Next Steps
Architecture
Learn how Shipr’s components work together
Authentication
Deep dive into Clerk and user sync
AI Chat
Configure and extend the AI chat feature
Deployment
Deploy to production on Vercel
Troubleshooting
Module not found errors
Convex schema errors
Environment variables not loading
- Verify
.envfile exists in the root directory - Restart both
npx convex devandpnpm dev - Check for typos in variable names (they’re case-sensitive)
Clerk/Convex authentication mismatch
- Verify
CLERK_JWT_ISSUER_DOMAINmatches in:- Your
.envfile - Convex dashboard authentication settings
- Your
- Ensure it includes
https://protocol - Restart all servers after changing