Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged
3 changes: 3 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ This protocol **MUST** be followed for every task involving code modification.
- **State:** Use Pinia stores (`frontend/src/stores/`) for global state.
- **API:** Import `useApi` from `frontend/src/services/apiInstance.js`.
- **UI:** Use PrimeVue components and services (Toast, ConfirmDialog).
3. **Linting & Quality:**
- **Auto-Fix First:** Before making manual code changes to resolve lint errors, you **MUST** first execute the project's auto-fix commands (`eslint --fix`, `stylelint --fix`). Do not waste context or effort on fixable stylistic issues.
- **Pre-commit Hook:** Note that a Husky pre-commit hook is active. It will automatically attempt to fix and re-stage your changes upon commit. Do not rely on this; ensure code is clean before committing.

### Step 3: Post-Change Verification

Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ FinTrack follows a clean, modular architecture separating the frontend, backend,
- **Backend**: Mocha + Sinon + Supertest
- **Frontend**: Vitest + Vue Test Utils
- **Code Quality**: Project-wide linting via **ESLint** (JS, Vue, JSON), **Stylelint** (CSS/Tailwind v4), and **Markdownlint**. Unified under `pnpm run lint:all`.
- **Git Hooks**: Automated pre-commit hooks via **Husky** and **lint-staged** ensure all staged code is automatically fixed and validated before being committed.

## 🤖 AI-Ready Development

Expand Down Expand Up @@ -325,17 +326,24 @@ Contributions are welcome! To ensure stability and high code quality, please fol
1. Fork the repository.
2. Create a feature branch (`git checkout -b feature/AmazingFeature`).
3. **Lint-First Rule**: If your feature introduces a new language or framework, ensure its linter is configured and added to `pnpm run lint:all` before implementation.
4. **Run local tests** to ensure no regressions:
4. **Auto-Fix Rule**: Before manually addressing linting errors, always execute the project's auto-fixers to save time and tokens:

```bash
pnpm exec eslint '**/*.{js,mjs,vue}' --fix
pnpm exec stylelint 'frontend/src/**/*.css' --fix
```

5. **Run local tests** to ensure no regressions:

```bash
pnpm test # Backend tests
pnpm run test:ui # Frontend tests
pnpm run lint:all # Code quality audit
```

5. Commit your changes (`git commit -m 'feat: Add some AmazingFeature'`).
6. Push to the branch (`git push origin feature/AmazingFeature`).
7. Open a Pull Request.
6. Commit your changes (`git commit -m 'feat: Add some AmazingFeature'`).
7. Push to the branch (`git push origin feature/AmazingFeature`).
8. Open a Pull Request.

## 💎 Credits

Expand Down
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,29 @@
"main": "server.js",
"scripts": {
"start": "node backend/server.js",
"pm2:start": "pnpm run build && pm2 start infrastructure/ecosystem.config.js",
"dev": "nodemon backend/server.js",
"build": "vite build --config vite.config.mjs",
"preview": "vite preview --config vite.config.mjs",
"db:dump": "bash scripts/dump_schema.sh",
"pm2:start": "pm2 start infrastructure/ecosystem.config.js",
"pm2:stop": "pm2 stop infrastructure/ecosystem.config.js",
"pm2:restart": "pm2 restart infrastructure/ecosystem.config.js",
"pm2:logs": "pm2 logs",
"db:setup": "node backend/scripts/setupNocodb.js",
"db:seed": "node backend/scripts/seedData.js",
"db:check": "node backend/scripts/checkData.js",
"test": "mocha 'backend/tests/**/*.test.js'",
"test:email": "node backend/tests/manual_email_test.js",
"test:ui": "vitest run --config vite.config.mjs",
"build": "vite build",
"lint:js": "eslint '**/*.{js,mjs,vue}'",
"lint:css": "stylelint 'frontend/src/**/*.css'",
"lint:md": "markdownlint '**/*.md' --ignore node_modules",
"lint:json": "eslint '**/*.json' --no-error-on-unmatched-pattern",
"lint:all": "pnpm run lint:js && pnpm run lint:css && pnpm run lint:md && pnpm run lint:json"
"lint:all": "pnpm run lint:js && pnpm run lint:css && pnpm run lint:md && pnpm run lint:json",
"prepare": "husky"
},
"lint-staged": {
"**/*.{js,mjs,vue,json}": "eslint --fix",
"**/*.css": "stylelint --fix",
"**/*.md": "markdownlint --fix"
},
"keywords": [
"financial",
Expand Down Expand Up @@ -72,7 +79,9 @@
"eslint-plugin-vue": "^10.8.0",
"globals": "^17.4.0",
"http-server": "^14.1.1",
"husky": "^9.1.7",
"jsdom": "^27.4.0",
"lint-staged": "^16.4.0",
"markdownlint-cli": "^0.48.0",
"mocha": "^11.7.5",
"nodemon": "^3.0.1",
Expand Down
Loading
Loading