Skip to content

Commit 7416e7d

Browse files
ndbroadbentclaude
andcommitted
Initial Tauri desktop app with CI infrastructure
- Tauri 2.x + Rust backend with imessage-database crate - TypeScript frontend with chat selection UI - Full Disk Access permission handling for macOS - Strict CI matching SaaS repo (biome, clippy, jscpd, file limits) - Lefthook git hooks for pre-commit/pre-push - Placeholder icons (CTM blue square) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
0 parents  commit 7416e7d

40 files changed

+6990
-0
lines changed

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
target/
7+
8+
# IDE
9+
.idea/
10+
.vscode/
11+
*.swp
12+
*.swo
13+
14+
# OS
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Logs
19+
*.log
20+
21+
# Environment
22+
.env
23+
.env.local
24+
.env.*.local
25+
26+
# Test coverage
27+
coverage/
28+
29+
# Tauri
30+
src-tauri/target/
31+
src-tauri/gen/
32+
33+
# Mobile icons (not targeting mobile platforms)
34+
src-tauri/icons/android/
35+
src-tauri/icons/ios/
36+
37+
# Lock files (use bun.lockb)
38+
package-lock.json
39+
yarn.lock
40+
pnpm-lock.yaml

.jscpd.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"threshold": 0,
3+
"reporters": ["console"],
4+
"ignore": ["node_modules/**", "target/**", "dist/**", "**/*.test.ts", "**/*.spec.ts"],
5+
"format": ["typescript", "javascript"],
6+
"absolute": true,
7+
"gitignore": true
8+
}

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# ChatToMap Desktop
2+
3+
Desktop app for exporting iMessage chats to [ChatToMap.com](https://chattomap.com).
4+
5+
## Overview
6+
7+
ChatToMap Desktop uses [imessage-exporter](https://github.com/ReagentX/imessage-exporter) to read your iMessage database and export conversations for processing by ChatToMap. The app provides a simple UI for selecting chats and uploading them securely.
8+
9+
## Requirements
10+
11+
- **macOS**: Requires Full Disk Access permission to read `~/Library/Messages/chat.db`
12+
- **Windows/Linux**: Requires an iTunes backup containing iMessage data
13+
14+
## Development
15+
16+
### Prerequisites
17+
18+
- [Bun](https://bun.sh/) 1.3+
19+
- [Rust](https://rustup.rs/) 1.70+
20+
- [Task](https://taskfile.dev/) (task runner)
21+
22+
### Setup
23+
24+
```bash
25+
# Install dependencies
26+
bun install
27+
28+
# Install git hooks
29+
task hooks:install
30+
31+
# Run development server
32+
task dev
33+
```
34+
35+
### Commands
36+
37+
| Command | Description |
38+
|---------|-------------|
39+
| `task dev` | Start Tauri development mode |
40+
| `task build` | Build for production |
41+
| `task ci` | Run all CI checks (required before commits) |
42+
| `task lint` | Run Biome linter |
43+
| `task lint:rust` | Run Clippy (Rust linter) |
44+
| `task test` | Run all tests |
45+
| `task typecheck` | TypeScript type checking |
46+
47+
### Quality Standards
48+
49+
This project follows strict quality standards:
50+
51+
- **Zero code duplication** (jscpd)
52+
- **No `any` types** in TypeScript
53+
- **No `biome-ignore` comments**
54+
- **File length limits**: 500 lines (code), 1000 lines (tests)
55+
- **Cognitive complexity**: max 15
56+
57+
All checks must pass before committing. Git hooks enforce this automatically.
58+
59+
## Architecture
60+
61+
```
62+
chat_to_map_desktop/
63+
├── src/ # Frontend (TypeScript)
64+
│ ├── index.html # Main HTML
65+
│ ├── main.ts # Frontend logic
66+
│ └── styles.css # Styling
67+
├── src-tauri/ # Backend (Rust)
68+
│ ├── src/main.rs # Tauri commands
69+
│ ├── Cargo.toml # Rust dependencies
70+
│ └── tauri.conf.json # Tauri configuration
71+
└── Taskfile.yml # Build commands
72+
```
73+
74+
## License
75+
76+
GPL-3.0 (required due to bundling GPL-licensed imessage-exporter)

Taskfile.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
version: "3"
2+
3+
tasks:
4+
default:
5+
desc: Show available tasks
6+
cmds:
7+
- task --list
8+
9+
# === Development ===
10+
dev:
11+
desc: Start Tauri development mode
12+
cmds:
13+
- cargo tauri dev
14+
15+
build:
16+
desc: Build for production
17+
cmds:
18+
- cargo tauri build
19+
20+
# === Quality Checks (run before marking any task complete) ===
21+
ci:
22+
desc: Run all CI checks
23+
cmds:
24+
- task: typecheck
25+
- task: lint
26+
- task: lint:rust
27+
- task: check-ignores
28+
- task: duplication
29+
- task: file-length
30+
- task: test
31+
32+
# === TypeScript/JS Linting ===
33+
lint:
34+
desc: Run Biome linter (check only)
35+
cmds:
36+
- bunx biome check .
37+
38+
lint:fix:
39+
desc: Run Biome linter and auto-fix issues
40+
cmds:
41+
- bunx biome check --write .
42+
43+
format:
44+
desc: Format TypeScript/JS code with Biome
45+
cmds:
46+
- bunx biome format --write .
47+
48+
typecheck:
49+
desc: TypeScript type checking
50+
cmds:
51+
- bunx tsc --noEmit
52+
53+
# === Rust Linting ===
54+
lint:rust:
55+
desc: Run Clippy (Rust linter)
56+
dir: src-tauri
57+
cmds:
58+
- cargo clippy --all-targets --all-features -- -D warnings
59+
60+
format:rust:
61+
desc: Format Rust code
62+
dir: src-tauri
63+
cmds:
64+
- cargo fmt
65+
66+
format:rust:check:
67+
desc: Check Rust formatting
68+
dir: src-tauri
69+
cmds:
70+
- cargo fmt -- --check
71+
72+
# === Code Quality ===
73+
duplication:
74+
desc: Check for code duplication (TypeScript)
75+
cmds:
76+
- bunx jscpd src/
77+
78+
file-length:
79+
desc: Check file length limits
80+
cmds:
81+
- ./scripts/check_file_length.sh
82+
83+
check-ignores:
84+
desc: Check for biome-ignore comments (zero tolerance)
85+
cmds:
86+
- |
87+
if grep -r "biome-ignore" --include="*.ts" --include="*.tsx" --include="*.js" src/ 2>/dev/null; then
88+
echo "❌ Found biome-ignore comments - these are forbidden!"
89+
exit 1
90+
fi
91+
echo "✅ No biome-ignore comments found"
92+
93+
# === Testing ===
94+
test:
95+
desc: Run all tests
96+
cmds:
97+
- task: test:rust
98+
- task: test:ts
99+
100+
test:rust:
101+
desc: Run Rust tests
102+
dir: src-tauri
103+
cmds:
104+
- cargo test
105+
106+
test:ts:
107+
desc: Run TypeScript tests
108+
cmds:
109+
- bunx vitest run
110+
111+
test:watch:
112+
desc: Run TypeScript tests in watch mode
113+
cmds:
114+
- bunx vitest
115+
116+
# === Git Hooks ===
117+
hooks:install:
118+
desc: Install git hooks with lefthook
119+
cmds:
120+
- bunx lefthook install
121+
122+
hooks:run:
123+
desc: Run pre-commit hooks manually
124+
cmds:
125+
- bunx lefthook run pre-commit
126+
127+
# === Utilities ===
128+
clean:
129+
desc: Clean build artifacts
130+
cmds:
131+
- rm -rf target dist node_modules/.cache
132+
- cd src-tauri && cargo clean
133+
134+
deps:update:
135+
desc: Update all dependencies
136+
cmds:
137+
- cd src-tauri && cargo update
138+
- bunx npm-check-updates -u
139+
- bun install

app-icon.png

39.5 KB
Loading

biome.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": true,
10+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx", "*.json"],
11+
"ignore": ["target/", "dist/", "node_modules/", "src-tauri/gen/"]
12+
},
13+
"formatter": {
14+
"enabled": true,
15+
"indentStyle": "space",
16+
"indentWidth": 2,
17+
"lineWidth": 100
18+
},
19+
"linter": {
20+
"enabled": true,
21+
"rules": {
22+
"recommended": true,
23+
"suspicious": {
24+
"noExplicitAny": "error",
25+
"noEmptyBlockStatements": "error"
26+
},
27+
"complexity": {
28+
"noExcessiveCognitiveComplexity": {
29+
"level": "error",
30+
"options": {
31+
"maxAllowedComplexity": 15
32+
}
33+
},
34+
"useLiteralKeys": "off"
35+
},
36+
"style": {
37+
"noNonNullAssertion": "warn",
38+
"useConst": "error"
39+
},
40+
"correctness": {
41+
"noUnusedVariables": "error",
42+
"noUnusedImports": "error"
43+
}
44+
}
45+
},
46+
"javascript": {
47+
"formatter": {
48+
"quoteStyle": "single",
49+
"semicolons": "asNeeded",
50+
"trailingCommas": "none"
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)