Deployment
In addition to running locally, AITuberKit supports deployment to various cloud platforms.
Vercel
As a Next.js application, deploying to Vercel is the easiest option.
Steps
- Create an account on Vercel and connect your GitHub repository
- Import the AITuberKit repository from "New Project"
- Configure environment variables (refer to
.env.examplefor required API keys) - Click "Deploy" to start the deployment
Configuration Tips
- Framework Preset:
Next.jsis automatically detected - Node.js Version: Specify
24.x - Environment Variables: Manage server-side API keys (e.g.,
OPENAI_API_KEY) through Vercel's environment variable settings
Security Notice
When deploying to Vercel, set API keys as Vercel environment variables to prevent client-side exposure. Environment variables prefixed with NEXT_PUBLIC_ are exposed to the client, so never use them for API keys.
Cloudflare
Deployment to Cloudflare Workers/Pages is also supported. OpenNext for Cloudflare is used to run the Next.js application on Cloudflare.
Prerequisites
- A Cloudflare account
- Wrangler CLI installed (
npm install -g wrangler) and logged in (wrangler login)
Build and Deploy
# Build for Cloudflare only
npm run build:cloudflare
# Local preview (build + wrangler dev)
npm run preview:cloudflare
# Deploy (build + wrangler deploy)
npm run deploy:cloudflareHow It Works
scripts/build-cloudflare.jsmanages the build processNEXT_PUBLIC_RESTRICTED_MODE=trueis automatically set during build, enabling restricted mode- Unnecessary files under
public/(gitignored, over 25MB, non-ASCII filenames) are automatically stashed and restored - Configuration is managed through
wrangler.jsoncandopen-next.config.ts
Limitations
- Runs in Restricted Mode, which may limit some features
- Be aware of Cloudflare Workers runtime constraints (memory, execution time, etc.)
Docker
Deployment using Docker is also available.
Docker Compose
# Prepare the environment variables file
cp .env.example .env
# Start with Docker Compose
docker compose upDocker Deployment for Production
The Dockerfile is configured to start in development mode (npm run dev). For production use, modify the Dockerfile as follows:
# Change CMD for production
RUN npm run build
CMD ["npx", "next", "start"]Security Considerations
Regardless of the deployment platform, keep the following in mind:
- API Key Management: Manage API keys through environment variables and prevent client-side exposure
- Access Control: Implement authentication and authorization mechanisms as needed
- User Guidance: If users provide their own API keys, inform them about security best practices
For more details, see the security section in Introduction.
