|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +**Denamu (데나무)** is an RSS-based tech blog curation platform. It aggregates developer blog content from multiple platforms (Tistory, Velog, Medium) into a single service with real-time trending, search, and developer chat features. |
| 8 | + |
| 9 | +- **Production URL**: https://denamu.dev |
| 10 | +- **Architecture**: Monorepo with microservices (Docker Compose orchestration) |
| 11 | + |
| 12 | +## Repository Structure |
| 13 | + |
| 14 | +``` |
| 15 | +server/ # NestJS backend API (port 8080) |
| 16 | +client/ # React + Vite frontend (port 5173) |
| 17 | +feed-crawler/ # RSS feed crawler with AI tagging |
| 18 | +email-worker/ # Email processing via RabbitMQ |
| 19 | +docker-compose/ # Infrastructure configs (local, dev, prod) |
| 20 | +nginx/ # Reverse proxy configuration |
| 21 | +``` |
| 22 | + |
| 23 | +## Common Commands |
| 24 | + |
| 25 | +### Root Level |
| 26 | +```bash |
| 27 | +npm run start:local # Start all services locally (no watch) |
| 28 | +npm run start:dev # Start dev environment with hot reload |
| 29 | +npm run start:was-dev # Start backend services only |
| 30 | +npm run commit # Commitizen for structured commits |
| 31 | +``` |
| 32 | + |
| 33 | +### Server (NestJS) |
| 34 | +```bash |
| 35 | +cd server |
| 36 | +npm run start:dev # Development with watch mode |
| 37 | +npm run build # Production build |
| 38 | +npm run lint # ESLint |
| 39 | +npm run test:unit # Unit tests |
| 40 | +npm run test:e2e # E2E tests (uses Testcontainers) |
| 41 | +npm run test:dto # DTO validation tests |
| 42 | +npm run migration:create # Create DB migrations |
| 43 | +``` |
| 44 | + |
| 45 | +### Client (React) |
| 46 | +```bash |
| 47 | +cd client |
| 48 | +npm run dev # Development server |
| 49 | +npm run build # Production build |
| 50 | +npm run lint # ESLint |
| 51 | +npm run test # Vitest unit tests |
| 52 | +npm run test:coverage # Coverage report |
| 53 | +``` |
| 54 | + |
| 55 | +### Feed Crawler |
| 56 | +```bash |
| 57 | +cd feed-crawler |
| 58 | +npm run start:dev # Development mode |
| 59 | +npm run test:unit # Unit tests |
| 60 | +npm run test:e2e # Integration tests |
| 61 | +``` |
| 62 | + |
| 63 | +## Tech Stack |
| 64 | + |
| 65 | +- **Backend**: NestJS, TypeORM, MySQL 8.0, Redis 7.2, RabbitMQ 3.13 |
| 66 | +- **Frontend**: React 18, TypeScript, Vite, TanStack Query, Zustand, Tailwind CSS, Radix UI |
| 67 | +- **Real-time**: Socket.IO (WebSocket chat) |
| 68 | +- **AI**: Anthropic Claude SDK (automatic content tagging in feed-crawler) |
| 69 | +- **Monitoring**: Prometheus, Grafana, Winston logging |
| 70 | +- **Auth**: JWT + OAuth (Google, GitHub) via Passport.js |
| 71 | + |
| 72 | +## Architecture Notes |
| 73 | + |
| 74 | +### Backend (Server) |
| 75 | +- Module-based NestJS architecture: each feature has Module, Controller, Service |
| 76 | +- TypeORM with MySQL for data persistence |
| 77 | +- Redis for caching and session management |
| 78 | +- Global exception filters and interceptors for consistent error handling |
| 79 | +- Swagger API documentation available |
| 80 | + |
| 81 | +### Frontend (Client) |
| 82 | +- TanStack Query for server state, Zustand for client state |
| 83 | +- Custom hooks pattern for logic reuse |
| 84 | +- Socket.IO client for real-time chat |
| 85 | + |
| 86 | +### Feed Crawler |
| 87 | +- tsyringe for dependency injection (not NestJS) |
| 88 | +- Scheduled jobs via node-schedule for RSS polling |
| 89 | +- Claude AI integration for automatic tag generation |
| 90 | +- RabbitMQ for event publishing |
| 91 | + |
| 92 | +### Email Worker |
| 93 | +- RabbitMQ consumer for async email processing |
| 94 | +- Nodemailer for email delivery |
| 95 | + |
| 96 | +## Code Review Convention |
| 97 | + |
| 98 | +Uses Pn-level system (Korean language reviews): |
| 99 | +- **P1**: Critical - security issues, business logic errors (must fix before deploy) |
| 100 | +- **P2**: Important - code quality/functionality issues (must fix) |
| 101 | +- **P3**: Medium - potential bug risks, improvements (strongly consider) |
| 102 | +- **P4**: Light - readability suggestions (optional) |
| 103 | +- **P5**: Questions - optional suggestions |
| 104 | + |
| 105 | +## Environment Variables |
| 106 | + |
| 107 | +Key environment variable groups (see `.env.example` files): |
| 108 | +- Database: `DB_HOST`, `DB_PORT`, `DB_USER`, `DB_PASSWORD`, `DB_NAME` |
| 109 | +- Redis: `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD` |
| 110 | +- RabbitMQ: `RABBITMQ_HOST`, `RABBITMQ_PORT`, `RABBITMQ_USER`, `RABBITMQ_PASSWORD` |
| 111 | +- JWT: `JWT_ACCESS_SECRET`, `JWT_REFRESH_SECRET` |
| 112 | +- OAuth: `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` |
| 113 | + |
| 114 | +## CI/CD |
| 115 | + |
| 116 | +GitHub Actions workflows deploy to self-hosted runner via GHCR: |
| 117 | +- `deploy_server.yml` - NestJS backend |
| 118 | +- `deploy_client.yml` - React frontend |
| 119 | +- `deploy_feed-crawler.yml` - Crawler service |
| 120 | +- `deploy_email-worker.yml` - Email worker |
| 121 | +- Test workflows run on PR: `test_server_dto.yml`, `test_server_e2e.yml`, `test_feed-crawler.yml` |
0 commit comments