Dev Server Setup

Customize Dev Server Setup

The example workflow file (from the previous page) includes the steps below that install and start the backend and frontend servers and create a test user. You should customize this part to match your own development setup:

            - name: Install dependencies
              run: |
                  npm ci --prefix backend
                  npm ci --prefix frontend                  

            - name: Start backend
              run: |
                  CI=false npm run dev --prefix backend &
                  npx wait-on http://localhost:3001
                  echo "Backend server is ready!"                  

            - name: Start frontend
              run: |
                  CI=false npm run dev --prefix frontend &
                  npx wait-on http://localhost:3000
                  echo "Frontend server is ready!"                  

            - name: Create a test user
              run: |
                  npm --prefix backend run add-user -- '${{ secrets.TEST_USER_USERNAME }}' '${{ secrets.TEST_USER_PASSWORD }}'                  

Replace ports 3000 and 3001 in the npx wait-on calls if you use different ports.

Customize Web App Port

In the example workflow file (from the previous page), we use port 3000 for the web app. If you use a different port, replace the value 3000 for this line:

                  TARGET_URL: "http://localhost:3000"

Add Services

You’ll need to add any services that your web app depends on and respective environment variables for them directly under the claude-code-action job. For example, a commonly used service is a database. Here is an example of adding a service for PostgreSQL:

        services:
            postgres:
                image: postgres:16
                env:
                    POSTGRES_USER: user
                    POSTGRES_PASSWORD: password
                    POSTGRES_DB: mydb
                options: >-
                    --health-cmd pg_isready
                    --health-interval 10s
                    --health-timeout 5s
                    --health-retries 5                    
                ports:
                    - 5432:5432
        env:
            DATABASE_URL: postgres://user:password@localhost:5432/mydb

How To Initiate The Agent

You’re all set! Tag @claude in an issue, an issue comment, a pull request review, or a pull request review comment to trigger Claude Code, and include something like the following in your message to Claude Code: “Use Kaimo to test that it is working.”