Skip to content

gear5labs/chenpilot-client

Repository files navigation

ChenPilot Client

A modern, responsive web client for ChenPilot - a crypto wallet management system with AI agent capabilities. Built with Next.js, TypeScript, and Tailwind CSS.

Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone <repository-url>
    cd chenpilot-client
  2. Install dependencies

    pnpm install
  3. Set up environment variables

    cp .env.example .env.local

    Update the environment variables in .env.local:

    NEXT_PUBLIC_API_BASE_URL=http://localhost:2333
    NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_id
    NEXT_PUBLIC_APP_NAME=ChenPilot
    NEXT_PUBLIC_APP_VERSION=1.0.0
  4. Start the experimental backend (required for full functionality)

    cd ../chenpilot-experimental
    npm install
    npm run dev
  5. Start the development server

    cd ../chenpilot-client
    pnpm dev
  6. Test the integration

    node test-integration.js
  7. Open your browser Navigate to http://localhost:3000

Available Scripts

  • pnpm dev - Start development server
  • pnpm build - Build for production
  • pnpm start - Start production server
  • pnpm lint - Run ESLint
  • pnpm test - Run tests (when implemented)

CI/CD Pipeline

This project uses GitHub Actions for continuous integration and deployment to Vercel.

GitHub Secrets Configuration

Before the CI/CD pipeline can run, configure the following secrets in your GitHub repository:

  1. Navigate to SettingsSecrets and variablesActions
  2. Add the following repository secrets:
Secret Name Description How to Obtain
VERCEL_TOKEN Vercel API token Go to Vercel Account Settings → Create new token
VERCEL_ORG_ID Vercel organization ID Run vercel link in your project, then check .vercel/project.json
VERCEL_PROJECT_ID Vercel project ID Run vercel link in your project, then check .vercel/project.json

Workflow Behavior

On Pull Requests:

  • Runs CI checks (install, lint, build)
  • Creates a Vercel preview deployment
  • Comments the preview URL on the PR
  • Blocks merge if any check fails

On Push to Main:

  • Runs CI checks (install, lint, build)
  • Deploys to Vercel production
  • Updates deployment summary

CI Checks

All deployments require passing:

  1. ✅ Dependency installation (pnpm install --frozen-lockfile)
  2. ✅ Linting (pnpm lint)
  3. ✅ Build (pnpm build)
  4. ✅ Tests (pnpm test - when implemented)

Git Hooks (Husky)

This project uses Husky to enforce code quality before commits.

Automatic Setup

Husky hooks are automatically installed when you run:

pnpm install

The prepare script in package.json handles the installation.

Pre-commit Hook

Before each commit, the following checks run automatically:

  • Linting: ESLint runs on all staged .js, .jsx, .ts, .tsx files
  • Auto-fix: ESLint will attempt to fix issues automatically
  • Commit blocking: If linting fails, the commit is blocked

Troubleshooting Husky

Hooks not running?

# Reinstall hooks
pnpm exec husky install

# Check hook permissions
chmod +x .husky/pre-commit

Skip hooks (emergency only):

git commit --no-verify -m "your message"

⚠️ Note: Skipping hooks should be rare. The CI pipeline will still enforce all checks.

Environment Variables for Production

Ensure all required environment variables are set in your deployment platform.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support and questions:

  • Create an issue in the repository
  • Check the documentation
  • Contact the development team

Built with love by the ChenPilot Team

Releases

No releases published

Packages

 
 
 

Contributors

Languages