Prerequisites
Before you begin, ensure you have the following installed:- Node.js 18.x or higher
- pnpm 8.x or higher (recommended package manager)
- Git for cloning the repository
Kaizen uses pnpm for faster, more efficient dependency management. If you don’t have it installed, run
npm install -g pnpm.Installation
Install dependencies
Install all required packages using pnpm:This will install the core dependencies including:
- Angular 21 - Frontend framework
- Convex - Real-time backend and database
- Clerk - Authentication provider
- PrimeNG - UI component library
- TailwindCSS - Utility-first styling
Set up environment variables
Create an environment configuration file for development:Add your Convex and Clerk credentials:
src/environments/environment.development.ts
Configure Convex backend
Initialize and deploy your Convex backend:This command will:Copy the deployment URL from the output and update your
- Create a new Convex project (if you haven’t already)
- Generate your Convex deployment URL
- Start watching for backend changes
- Sync your schema and functions to the cloud
Keep the
convex dev process running in a separate terminal. It enables hot-reloading for your backend functions.environment.development.ts file with the convexPublicUrl value.Configure Clerk authentication
Set up Clerk to handle user authentication:
- Create a free account at clerk.com
- Create a new application
- Copy your Publishable Key and add it to
environment.development.ts - In the Clerk dashboard, navigate to JWT Templates
- Create a new template named
convex - Copy the Issuer URL from the template
The Convex auth configuration in
convex/auth.config.ts uses this environment variable to validate JWTs from Clerk.Verify your setup
Once the development server is running, open your browser tohttp://localhost:4200. You should see:
- The Kaizen landing page or authentication prompt
- Clerk authentication working (sign up/sign in buttons functional)
- No console errors related to Convex or Clerk connections
On first run, you’ll need to create an account to access the game. Clerk handles all authentication flows including email verification.
Available scripts
Kaizen includes several npm scripts for common development tasks:| Command | Description |
|---|---|
pnpm start | Start the development server on port 4200 |
pnpm build | Build the production bundle |
pnpm watch | Build and watch for changes in development mode |
pnpm test | Run the Jasmine/Karma test suite |
Project structure
Next steps
Now that your development environment is ready:Architecture
Learn about Kaizen’s architecture and game mechanics
Game mechanics
Explore character progression, upgrades, and prestige
State management
Understand how Convex powers real-time game state
Backend integration
Deep dive into Clerk integration and user management
Troubleshooting
Convex connection failed
If you see errors about Convex connection failures:- Ensure
convex devis running in a separate terminal - Verify the
convexPublicUrlin your environment file matches your deployment URL - Check that your deployment is active in the Convex dashboard
Clerk authentication not working
If authentication doesn’t work:- Verify your
clerkPublicKeyis correct and starts withpk_test_orpk_live_ - Ensure you’ve created the
convexJWT template in Clerk - Confirm the
CLERK_JWT_ISSUER_DOMAINenvironment variable is set in Convex
Port already in use
If port 4200 is already in use:- Stop other Angular applications running on that port
- Or specify a different port:
ng serve --port 4201