# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Weather data management system -- a multi-module Maven project with a Spring Boot backend and Vue 3 frontend for managing meteorological monitoring data from weather stations.

- **Backend**: Spring Boot 3.5.11, Java 17, Apache Shiro, MyBatis-Plus, Quartz
- **Frontend**: Vue 3 + TypeScript + Vite 5, Element Plus, ECharts, Pinia
- **Database**: MySQL 8.0 (primary), supports Oracle / SQL Server / PostgreSQL / Dameng via dynamic datasource
- **Cache**: Redis (Lettuce client)

## Project Conventions

- **No emoji**: Avoid using emoji in code (including variable names, comments, commit messages) and in response messages. Use plain text instead.
- **Keep CLAUDE.md files current**: Any operation that adds, deletes, or modifies files affecting project structure (new modules, new packages, renamed components, dependency changes, config changes, schema changes, etc.) must update the relevant CLAUDE.md file(s) -- top-level for cross-cutting changes, module-level for module-specific changes.

## Module Index

| Module | Path | Purpose |
|--------|------|---------|
| system-common | `system-common/` | Shared library: base classes, Redis, validation, XSS, utilities |
| system-dynamic-datasource | `system-dynamic-datasource/` | Multi-datasource support via AbstractRoutingDataSource |
| system-admin | `system-admin/` | Main Spring Boot application, REST API, jobs, security |
| weather-data-ui | `weather-data-ui/` | Vue 3 frontend |

Each module has its own `CLAUDE.md` with module-specific architecture and conventions. When working in a module, read that module's CLAUDE.md for context.

## Build & Run Commands

### Backend

```bash
# Build everything (skip tests)
mvn clean package -DskipTests

# Build only system-admin module
cd system-admin && mvn package -DskipTests

# Run with dev profile
cd system-admin && mvn spring-boot:run -Dspring-boot.run.profiles=dev
```

Main entry: `system-admin/src/main/java/com/weather/AdminApplication.java`

### Frontend

```bash
cd weather-data-ui
npm install
npm run dev          # dev server on port 8001
npm run build        # production build
npm run lint         # ESLint on src/**/*.{vue,ts}
```

### Docker Compose

```bash
docker compose up -d    # MySQL + Redis + admin + api + UI + nginx gateway
```

## Key Configuration

- **Dev profile**: `system-admin/src/main/resources/application-dev.yml` -- local MySQL (weather_data_system), Redis 127.0.0.1:6379
- **Prod profile**: `application-prod.yml` -- expects env variables for DB/Redis (see docker-compose.yml)
- **project-options.redis.open**: toggles Redis caching globally (set via sys_params)
