# Project Development Notes

## Development Workflow

```mermaid
graph TD
    A[Start Development] --> B[Install Dependencies]
    B --> C{pnpm install}

    C --> D[Choose Development Mode]
    D --> E[Full Stack<br/>pnpm run dev]
    D --> F[Individual Services]
    D --> G[Docker Setup]

    E --> H[Web + Service<br/>Hot Reload Enabled]
    F --> I[Web Only<br/>pnpm run web]
    F --> J[Service Only<br/>pnpm run service]
    F --> K[CLI Only<br/>pnpm run cli]

    G --> L[docker-compose up]

    H --> M[Make Changes]
    I --> M
    J --> M
    K --> M
    L --> M

    M --> N{File Changed?}
    N -->|Yes| O[Hot Reload<br/>Automatic]
    N -->|No| P[Test Changes]

    O --> P
    P --> Q[Check Browser/CLI]
    Q --> R{Working?}
    R -->|Yes| M
    R -->|No| S[Debug Issues]
    S --> M

    style A fill:#e3f2fd
    style H fill:#e8f5e8
    style O fill:#fff3e0
    style S fill:#ffebee
```

## Package Manager

This project uses **pnpm** as the package manager. Always use `pnpm` commands instead of `npm` or `yarn`.

- Install dependencies: `pnpm install`
- Run scripts: `pnpm run <script>`
- Add packages: `pnpm add <package>`

## Development Servers

The web and service applications support hot reloading for most changes:

- **Web app** (`apps/web`): Runs with `pnpm run dev` and hot reloads on code changes.
- **Service app** (`apps/service`): Runs with `pnpm run service` and hot reloads on code changes.

**Do not** frequently stop and restart these servers unless necessary (e.g., for configuration changes or dependency updates). Let the hot reloading handle code updates during development.

## Project Structure

- Monorepo managed with Turbo
- Apps: `apps/web` (Next.js), `apps/service` (NestJS)
- Shared packages in `packages/`
- Legacy code in `legacy/`

## Running the Project

- Full stack: `pnpm run dev` (runs both web and service)
- Individual apps: `pnpm run web` or `pnpm run service`
- With Docker: Use `docker-compose.yml` for containerized setup

## Important Reminders

- Use pnpm, not npm
- Trust hot reloading - avoid unnecessary restarts
- Check package.json scripts for available commands
