Skip to content

Run the Examples (No Coding Experience Needed)

This project ships with runnable examples for every supported platform. This page is a quick hub — pick a platform, install one or two pieces of software, and you'll have a live captcha on screen.

Each section links to that example's README for the full step-by-step (download links, install steps, what to click, common errors).

Prerequisites (all platforms)

  • Node.js 18 LTS — download from https://nodejs.org (pick the LTS .msi on Windows / .pkg on macOS, double-click to install).
  • pnpm — after Node is installed, open a terminal and run npm install -g pnpm.
  • A terminal: Windows → search "PowerShell" in the Start menu; macOS → "Terminal" (Launchpad → Other).

Clone or download this repo, open a terminal in the project root, and run:

bash
pnpm install   # first run takes a few minutes; wait for Done

If pnpm install reports a Python/canvas error (only the core package), it won't stop you running the examples — ignore it. If you must build core, install Python 3.11 and run PYTHON=/usr/local/bin/python3.11 pnpm install.

Web (fastest way to see it)

From the project root:

bash
pnpm play:vue   # or: pnpm play:react  |  pnpm play:vue2

Copy the printed http://localhost:5173 into your browser — the captcha appears.

WeChat Mini-Program

  1. Install WeChat DevTools: https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html

  2. For Taro / uni-app examples, build first (output goes to dist/):

    bash
    cd examples/taro-vue      # or taro-vue2 / taro-react
    pnpm install
    pnpm dev:weapp           # uni-app uses: pnpm dev:mp-weixin

    The weixin example is native — no build step.

  3. Open WeChat DevTools → Import project → select the example dir (or its dist/ for Taro/uni-app) → use a Test AppID → the simulator shows the captcha.

Native (Android / iOS / Flutter)

These are SDK libraries, not standalone apps — you can build them, but there's no UI to view directly. To see the captcha visually, use the Web example above.

  • Android — install Android Studio (it bundles the JDK) → open packages/android → wait for Gradle sync → Build → Make Project. Command line: ./gradlew :captcha-sdk:assembleDebug :captcha-compose:assembleDebug. (README)
  • iOS (macOS only) — install Xcode → open packages/ios/Package.swift → ⌘B. Command line: xcodebuild -scheme CaptchaPro -destination 'generic/platform=iOS' -derivedDataPath .build build. Do not use swift build (it targets macOS and fails with no such module 'UIKit'). (README)
  • Flutter — install the Flutter SDKcd packages/flutter && flutter analyzeNo issues found!. It's a plugin package, so flutter build apk is expected to fail with "Target file lib/main.dart not found" — flutter analyze is the correct check. (README)

Backend demos

Each backend serves the captcha API on a different port. Open http://localhost:<port>/api/captcha?type=slider in a browser — you should get JSON back.

BackendPortRun
Node.js3001cd server/node && pnpm install && pnpm dev
Go8082cd server/go && go run cmd/server/main.go
Java8080cd server/java && mvn spring-boot:run (install Maven first — the project has no wrapper)

Verify it works

  • Web — the browser shows the captcha at localhost:5173.
  • Mini-program — the WeChat DevTools simulator shows the captcha.
  • Native — the build prints BUILD SUCCESSFUL / BUILD SUCCEEDED / No issues found!.
  • Backendhttp://localhost:<port>/api/captcha?type=slider returns JSON.

If something fails, see the matching README's "Common errors" section.

Released under the MIT License.