|
| 1 | +# Contributing to enowX-Coder |
| 2 | + |
| 3 | +Thank you for your interest in contributing! enowX-Coder is a Tauri-based AI code editor built with Rust + React + TypeScript. |
| 4 | + |
| 5 | +## 🏗️ Architecture |
| 6 | + |
| 7 | +- **Backend**: `src-tauri/` — Rust (Tauri v2) |
| 8 | +- **Frontend**: `src/` — React + TypeScript |
| 9 | +- **Database**: SQLite via `sqlx` |
| 10 | +- **AI**: Streaming chat via OpenAI/Anthropic compatible providers |
| 11 | + |
| 12 | +## 🚀 Getting Started |
| 13 | + |
| 14 | +```bash |
| 15 | +# Clone the repository |
| 16 | +git clone https://github.com/kevinnft/enowX-Coder.git |
| 17 | +cd enowX-Coder |
| 18 | + |
| 19 | +# Install frontend dependencies |
| 20 | +bun install |
| 21 | + |
| 22 | +# Run in development mode |
| 23 | +cargo tauri dev |
| 24 | +``` |
| 25 | + |
| 26 | +## 📝 Commit Convention |
| 27 | + |
| 28 | +We use [Conventional Commits](https://www.conventionalcommits.org/): |
| 29 | + |
| 30 | +``` |
| 31 | +<type>(<scope>): <description> |
| 32 | +``` |
| 33 | + |
| 34 | +| Type | Description | |
| 35 | +|---|---| |
| 36 | +| `feat` | New feature | |
| 37 | +| `fix` | Bug fix | |
| 38 | +| `refactor` | Code restructure, no behavior change | |
| 39 | +| `chore` | Maintenance, tooling | |
| 40 | +| `docs` | Documentation | |
| 41 | +| `build` | Dependencies, build config | |
| 42 | +| `test` | Adding/fixing tests | |
| 43 | +| `perf` | Performance improvement | |
| 44 | + |
| 45 | +Examples: |
| 46 | +``` |
| 47 | +feat(chat): add model selector dropdown |
| 48 | +fix(editor): resolve tab sync issue on file switch |
| 49 | +refactor(agents): simplify prompt construction |
| 50 | +docs: add setup guide for Linux |
| 51 | +``` |
| 52 | + |
| 53 | +## 🌿 Git Workflow |
| 54 | + |
| 55 | +- **Trunk-based development**: branch from `main`, short-lived branches only |
| 56 | +- Delete branches after merge |
| 57 | +- Never force push to `main` |
| 58 | +- Use `git add -p` (interactive staging), never blind `git add .` |
| 59 | + |
| 60 | +## 📋 Code Standards |
| 61 | + |
| 62 | +### Rust |
| 63 | +- Use `AppError` enum with `thiserror` — never `unwrap()` in production paths |
| 64 | +- Commands are thin wrappers — all business logic in `services/` |
| 65 | +- All Tauri commands must be `async` |
| 66 | +- Use `#[serde(rename_all = "camelCase")]` on structs sent to frontend |
| 67 | + |
| 68 | +### TypeScript / React |
| 69 | +- Strict TypeScript — no `as any`, no `@ts-ignore` |
| 70 | +- Follow existing component patterns |
| 71 | + |
| 72 | +## 🧪 Pull Requests |
| 73 | + |
| 74 | +Before submitting a PR: |
| 75 | +1. Make sure `cargo clippy -- -D warnings` passes |
| 76 | +2. Make sure `bunx tsc --noEmit` passes |
| 77 | +3. Squash your commits into logical units |
| 78 | +4. Write a clear description of what changes and why |
| 79 | + |
| 80 | +## 🤝 Code of Conduct |
| 81 | + |
| 82 | +We follow Contributor Covenant. Be respectful, constructive, and inclusive. |
0 commit comments