- Move deprecated directories to src/_deprecated/: - hydration/ (old pipeline approach) - scraper-v2/ (old Puppeteer scraper) - canonical-hydration/ (merged into tasks) - Unused services: availability, crawler-logger, geolocation, etc - Unused utils: age-gate-playwright, HomepageValidator, stealthBrowser - Archive outdated docs to docs/_archive/: - ANALYTICS_RUNBOOK.md - ANALYTICS_V2_EXAMPLES.md - BRAND_INTELLIGENCE_API.md - CRAWL_PIPELINE.md - TASK_WORKFLOW_2024-12-10.md - WORKER_TASK_ARCHITECTURE.md - ORGANIC_SCRAPING_GUIDE.md - Add docs/CODEBASE_MAP.md as single source of truth - Add warning files to deprecated/archived directories - Slim down CLAUDE.md to essential rules only 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
108 lines
2.9 KiB
Markdown
108 lines
2.9 KiB
Markdown
# Claude Guidelines for CannaiQ
|
|
|
|
## PERMANENT RULES (NEVER VIOLATE)
|
|
|
|
### 1. NO DELETE
|
|
Never delete data, files, images, logs, or database rows. CannaiQ is a historical analytics system.
|
|
|
|
### 2. NO KILL
|
|
Never run `pkill`, `kill`, `killall`, or similar. Say "Please run `./stop-local.sh`" instead.
|
|
|
|
### 3. NO MANUAL STARTUP
|
|
Never start servers manually. Say "Please run `./setup-local.sh`" instead.
|
|
|
|
### 4. DEPLOYMENT AUTH REQUIRED
|
|
Never deploy unless user explicitly says: "CLAUDE — DEPLOYMENT IS NOW AUTHORIZED."
|
|
|
|
### 5. DB POOL ONLY
|
|
Never import `src/db/migrate.ts` at runtime. Use `src/db/pool.ts` for DB access.
|
|
|
|
---
|
|
|
|
## Quick Reference
|
|
|
|
### Database Tables
|
|
| USE THIS | NOT THIS |
|
|
|----------|----------|
|
|
| `dispensaries` | `stores` (empty) |
|
|
| `store_products` | `products` (empty) |
|
|
| `store_product_snapshots` | `dutchie_product_snapshots` |
|
|
|
|
### Key Files
|
|
| Purpose | File |
|
|
|---------|------|
|
|
| Dutchie client | `src/platforms/dutchie/client.ts` |
|
|
| DB pool | `src/db/pool.ts` |
|
|
| Payload fetch | `src/tasks/handlers/payload-fetch.ts` |
|
|
| Product refresh | `src/tasks/handlers/product-refresh.ts` |
|
|
|
|
### Dutchie GraphQL
|
|
- **Endpoint**: `https://dutchie.com/api-3/graphql`
|
|
- **Hash (FilteredProducts)**: `ee29c060826dc41c527e470e9ae502c9b2c169720faa0a9f5d25e1b9a530a4a0`
|
|
- **CRITICAL**: Use `Status: 'Active'` (not `null`)
|
|
|
|
### Frontends
|
|
| Folder | Domain | Build |
|
|
|--------|--------|-------|
|
|
| `cannaiq/` | cannaiq.co | Vite |
|
|
| `findadispo/` | findadispo.com | CRA |
|
|
| `findagram/` | findagram.co | CRA |
|
|
| `frontend/` | DEPRECATED | - |
|
|
|
|
---
|
|
|
|
## Deprecated Code
|
|
|
|
**DO NOT USE** anything in `src/_deprecated/`:
|
|
- `hydration/` - Use `src/tasks/handlers/`
|
|
- `scraper-v2/` - Use `src/platforms/dutchie/`
|
|
- `canonical-hydration/` - Merged into tasks
|
|
|
|
**DO NOT USE** `src/dutchie-az/db/connection.ts` - Use `src/db/pool.ts`
|
|
|
|
---
|
|
|
|
## Local Development
|
|
|
|
```bash
|
|
./setup-local.sh # Start all services
|
|
./stop-local.sh # Stop all services
|
|
```
|
|
|
|
| Service | URL |
|
|
|---------|-----|
|
|
| API | http://localhost:3010 |
|
|
| Admin | http://localhost:8080/admin |
|
|
| PostgreSQL | localhost:54320 |
|
|
|
|
---
|
|
|
|
## WordPress Plugin (ACTIVE)
|
|
|
|
### Plugin Files
|
|
| File | Purpose |
|
|
|------|---------|
|
|
| `wordpress-plugin/cannaiq-menus.php` | Main plugin (CannaIQ brand) |
|
|
| `wordpress-plugin/crawlsy-menus.php` | Legacy plugin (Crawlsy brand) |
|
|
| `wordpress-plugin/VERSION` | Version tracking |
|
|
|
|
### API Routes (Backend)
|
|
- `GET /api/v1/wordpress/dispensaries` - List dispensaries
|
|
- `GET /api/v1/wordpress/dispensary/:id/menu` - Get menu data
|
|
- Route file: `backend/src/routes/wordpress.ts`
|
|
|
|
### Versioning
|
|
Bump `wordpress-plugin/VERSION` on changes:
|
|
- Minor (x.x.N): bug fixes
|
|
- Middle (x.N.0): new features
|
|
- Major (N.0.0): breaking changes (user must request)
|
|
|
|
---
|
|
|
|
## Documentation
|
|
|
|
| Doc | Purpose |
|
|
|-----|---------|
|
|
| `backend/docs/CODEBASE_MAP.md` | Current files/directories |
|
|
| `backend/docs/_archive/` | Historical docs (may be outdated) |
|