This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a WeChat Mini Program for expense splitting management. The application helps users track shared expenses in group activities (like friend gatherings) and calculate how much each person should pay or receive.
- Framework: WeChat Mini Program (similar to React but with specific APIs)
- Entry Point:
app.js- Contains global application logic and request utilities - Routing: Defined in
app.jsonwith pages organized in/pagesdirectory - Components: Pages follow a 4-file structure (
.js,.wxml,.wxss,.json)
- Authentication:
/pages/loginand/pages/register - Ledger Management:
/pages/ledger(list and create) - Expense Tracking:
/pages/expense(list and add) - User Management: Member management features
- All API requests go through
app.request()wrapper inapp.js - Uses JWT token authentication stored in
wx.getStorageSync('jwtToken') - API calls follow pattern:
/expense/[resource]/[action] - Error handling includes automatic redirect to login on 401 responses
utils/util.js- Time formatting functionsapp.js- Global request handler with authentication
- Create directory in
/pages/ - Add four files:
.js,.wxml,.wxss,.json - Register page in
app.json
- Use
app.request()method (not directwx.request()) - All URLs are automatically prefixed with
baseUrlfromapp.globalData - Authentication headers are automatically added
- Uses
Page.datafor component state - Updates via
this.setData() - Lifecycle methods:
onLoad,onShow,onPullDownRefresh, etc.
This is a WeChat Mini Program project that runs in the WeChat Developer Tool. There are no traditional build commands like npm scripts. Development workflow:
- Open project in WeChat Developer Tool
- Edit files directly
- Changes are automatically compiled and reflected in the simulator
- Use WeChat DevTools for debugging
Testing is done through the WeChat Developer Tool:
- Simulator for UI testing
- Console for debugging
- Network panel for API monitoring
- No automated test framework configured
Deployment is done through the WeChat Developer Tool:
- Click "Upload" in the toolbar
- Enter version number and project description
- Submit for review in WeChat Mini Program admin panel