2.5 KiB
2.5 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is a WeChat Mini Program called "徵象" (emblem-scanner) for QR code scanning and processing. The app connects to the Themblem service for QR code verification and includes camera functionality with device-specific optimizations.
Architecture
Main App Structure:
app.js- Main application entry point with global data and worker initializationutils.js- Utility functions for camera rules, device detection, and QR code extractionpages/- WeChat Mini Program pages (index, camera, debug, webview, etc.)components/- Reusable UI components (scanguide, tooltips, modals, etc.)worker/- WebAssembly worker thread for QR code processing using qrtool librarystatic/- Static assets and resources
Key Components:
- Camera system with device-specific zoom rules fetched from API
- WebAssembly-based QR processing in worker thread for performance
- Dual camera modes: native camera (
pages/camera/) and web view (pages/camwebview/) - Upload and verification system connecting to themblem.com API
Global Data:
server_url: 'https://themblem.com' - main API endpointsession_id: Generated unique session identifierreal_ip: User's IP address fetched from external serviceworker: WebAssembly worker for QR processing
Development Commands
This is a WeChat Mini Program project. Development is done through WeChat Developer Tools IDE.
Linting:
# ESLint configuration available but no npm scripts defined
# Lint manually using WeChat Developer Tools or external ESLint
No test framework or build scripts are configured in package.json
Key Files
project.config.json- WeChat Mini Program configurationapp.json- App pages, window settings, and worker configurationutils.js- Core utility functions for camera and QR code handlingworker/index.js- WebAssembly QR code processing workerprecheck.js- QR code frame validation logicupload.js- Image upload and verification functions
Dependencies
lottie-miniprogram- Lottie animations support- WebAssembly qrtool library (
qrtool.wx.js) - QR code processing
External APIs
https://themblem.com/api/v1/camera-rules/- Device-specific camera settingshttps://themblem.com/api/v1/check-auto-torch/- Auto torch functionalityhttps://whatsmyip.hondcloud.com- IP address detectionhttps://research.themblem.com/event/- Event tracking endpoint