learning_ai_common_plat/services/tracker-service/README.md
saravanakumardb1 90b9cf93d8 fix(common): configure ESLint 9 and fix lint issues
- Added @eslint/js dependency
- Updated eslint.config.js for ESLint 9 compatibility
- Added required globals (crypto, localStorage, React, etc.)
- Fixed unused imports and variables
- Disabled sort-imports temporarily
- Formatted all files with Prettier
2026-02-12 16:37:30 -08:00

59 lines
2.3 KiB
Markdown

# Tracker Service
Product-agnostic issue tracker for feature requests, bugs, and task management.
Built with Fastify + TypeScript + Azure Cosmos DB.
## Port
`4004` (configurable via `PORT` env var)
## Modules
- **items** — CRUD for tracker items (bugs, features, tasks) with filtering, pagination, and stats
- **comments** — Threaded discussion on items
- **votes** — Upvote toggle (1 per user per item)
## API Endpoints
| Method | Path | Description |
| ------ | ----------------------------- | ---------------------------------------- |
| GET | `/items` | List/filter/search items |
| POST | `/items` | Create item |
| GET | `/items/stats` | Aggregate counts by type/status/priority |
| GET | `/items/:id` | Get single item |
| PUT | `/items/:id` | Update item |
| PATCH | `/items/:id/status` | Quick status transition |
| DELETE | `/items/:id` | Delete item |
| GET | `/items/:itemId/comments` | List comments |
| POST | `/items/:itemId/comments` | Add comment |
| PUT | `/items/:itemId/comments/:id` | Edit comment |
| DELETE | `/items/:itemId/comments/:id` | Delete comment |
| POST | `/items/:itemId/vote` | Toggle upvote |
| GET | `/items/:itemId/votes` | List voters |
| GET | `/health` | Health check |
## Setup
```bash
cp .env .env # fill in values
npm install
npm run dev # starts with tsx watch on port 4004
```
## Testing
```bash
npm test # vitest run (29 tests)
```
## Environment Variables
See `.env` for required variables:
- `COSMOS_ENDPOINT` — Azure Cosmos DB endpoint
- `COSMOS_KEY` — Cosmos DB primary key
- `COSMOS_DATABASE` — Database name
- `JWT_SECRET` — Shared secret for JWT verification (from platform-service)
- `DEFAULT_PRODUCT_ID` — Default product scope (e.g., `lysnrai`)
- `PORT` — Server port (default `4004`)