Skip to content

Commit 534e640

Browse files
authored
docs: update CLAUDE.md with current codebase state (#79)
1 parent 127cb80 commit 534e640

File tree

1 file changed

+49
-16
lines changed

1 file changed

+49
-16
lines changed

CLAUDE.md

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Go application that fetches DMARC reports from IMAP mailboxes, parses them, an
44

55
## Tech Stack
66

7-
- **Backend**: Go 1.25+ (see go.mod for exact version)
7+
- **Backend**: Go 1.25.4 (see go.mod for exact version)
88
- **Frontend**: Vue.js 3 with Vite
99
- **Database**: SQLite (supports both CGO and pure-Go variants)
1010
- **Package Manager**: Bun (for frontend)
@@ -51,11 +51,17 @@ parse-dmarc/
5151
│ ├── main.js # Vue entry point
5252
│ ├── assets/
5353
│ │ └── base.css # Base styles
54+
│ ├── stores/ # Pinia-like state management
55+
│ │ ├── index.js # Store exports
56+
│ │ ├── theme.js # Theme (dark/light/system) store
57+
│ │ └── settings.js # API endpoint settings store
5458
│ └── components/
5559
│ ├── dashboard/
5660
│ │ ├── DashboardHero.vue # Dashboard header/hero section
5761
│ │ ├── RecentReports.vue # Recent reports list
5862
│ │ └── ReportDrawer.vue # Report detail drawer
63+
│ ├── settings/
64+
│ │ └── SettingsModal.vue # Settings modal (theme, API endpoint)
5965
│ └── tools/
6066
│ └── DnsGenerator.vue # DMARC DNS record generator
6167
├── public/ # Static frontend assets (favicons, logos)
@@ -65,6 +71,7 @@ parse-dmarc/
6571
│ ├── captain-definition # CapRover deployment
6672
│ ├── digitalocean/ # DigitalOcean Droplet/Marketplace
6773
│ │ ├── packer.pkr.hcl # Packer image build
74+
│ │ ├── marketplace.yaml # DO Marketplace metadata
6875
│ │ └── scripts/ # Setup scripts
6976
│ └── dokploy/ # Dokploy deployment
7077
│ ├── template.toml
@@ -77,6 +84,9 @@ parse-dmarc/
7784
├── Dockerfile # Multi-stage Docker build
7885
├── compose.yml # Docker Compose for local dev
7986
├── parse-dmarc.service # systemd service file
87+
├── zeabur.yml # Zeabur deployment template
88+
├── render.yaml # Render deployment config
89+
├── Northflank.json # Northflank deployment config
8090
├── ROADMAP.md # Product roadmap
8191
├── CONTRIBUTING.md # Contribution guidelines
8292
├── .goreleaser.yml # Release automation
@@ -112,6 +122,9 @@ just clean
112122

113123
# Install binary to /usr/local/bin
114124
just install
125+
126+
# Update Zeabur template
127+
just update-zeabur-template
115128
```
116129

117130
## Building
@@ -170,19 +183,25 @@ go test -v ./internal/parser/...
170183

171184
## CLI Flags
172185

173-
| Flag | Env Var | Description |
174-
| ---------------------- | -------------------------------- | ----------------------------------------- |
175-
| `--config, -c` | `PARSE_DMARC_CONFIG` | Config file path (default: config.json) |
176-
| `--gen-config` | `PARSE_DMARC_GEN_CONFIG` | Generate sample config |
177-
| `--fetch-once` | `PARSE_DMARC_FETCH_ONCE` | Fetch reports once and exit |
178-
| `--serve-only` | `PARSE_DMARC_SERVE_ONLY` | Dashboard only, no fetching |
179-
| `--fetch-interval` | `PARSE_DMARC_FETCH_INTERVAL` | Fetch interval in seconds (default: 300) |
180-
| `--metrics` | `PARSE_DMARC_METRICS` | Enable Prometheus metrics (default: true) |
181-
| `--mcp` | `PARSE_DMARC_MCP` | Run as MCP server over stdio |
182-
| `--mcp-http` | `PARSE_DMARC_MCP_HTTP` | Run MCP over HTTP at address |
183-
| `--mcp-oauth` | `PARSE_DMARC_MCP_OAUTH` | Enable OAuth2 for MCP HTTP |
184-
| `--mcp-oauth-issuer` | `PARSE_DMARC_MCP_OAUTH_ISSUER` | OAuth2/OIDC issuer URL |
185-
| `--mcp-oauth-audience` | `PARSE_DMARC_MCP_OAUTH_AUDIENCE` | Expected token audience |
186+
| Flag | Env Var | Description |
187+
| ------------------------------------ | ---------------------------------------------- | ----------------------------------------------------- |
188+
| `--config, -c` | `PARSE_DMARC_CONFIG` | Config file path (default: config.json) |
189+
| `--gen-config` | `PARSE_DMARC_GEN_CONFIG` | Generate sample config |
190+
| `--fetch-once` | `PARSE_DMARC_FETCH_ONCE` | Fetch reports once and exit |
191+
| `--serve-only` | `PARSE_DMARC_SERVE_ONLY` | Dashboard only, no fetching |
192+
| `--fetch-interval` | `PARSE_DMARC_FETCH_INTERVAL` | Fetch interval in seconds (default: 300) |
193+
| `--metrics` | `PARSE_DMARC_METRICS` | Enable Prometheus metrics (default: true) |
194+
| `--mcp` | `PARSE_DMARC_MCP` | Run as MCP server over stdio |
195+
| `--mcp-http` | `PARSE_DMARC_MCP_HTTP` | Run MCP over HTTP at address |
196+
| `--mcp-oauth` | `PARSE_DMARC_MCP_OAUTH` | Enable OAuth2 for MCP HTTP |
197+
| `--mcp-oauth-issuer` | `PARSE_DMARC_MCP_OAUTH_ISSUER` | OAuth2/OIDC issuer URL |
198+
| `--mcp-oauth-audience` | `PARSE_DMARC_MCP_OAUTH_AUDIENCE` | Expected token audience |
199+
| `--mcp-oauth-client-id` | `PARSE_DMARC_MCP_OAUTH_CLIENT_ID` | OAuth2 client ID for token introspection |
200+
| `--mcp-oauth-client-secret` | `PARSE_DMARC_MCP_OAUTH_CLIENT_SECRET` | OAuth2 client secret for token introspection |
201+
| `--mcp-oauth-scopes` | `PARSE_DMARC_MCP_OAUTH_SCOPES` | Required scopes (comma-separated, default: mcp:tools) |
202+
| `--mcp-oauth-introspection-endpoint` | `PARSE_DMARC_MCP_OAUTH_INTROSPECTION_ENDPOINT` | Token introspection endpoint URL |
203+
| `--mcp-oauth-resource-name` | `PARSE_DMARC_MCP_OAUTH_RESOURCE_NAME` | Human-readable name for MCP server metadata |
204+
| `--mcp-oauth-insecure` | `PARSE_DMARC_MCP_OAUTH_INSECURE` | Skip TLS certificate verification (dev only) |
186205

187206
## Code Style
188207

@@ -207,9 +226,12 @@ go test -v ./internal/parser/...
207226
### Frontend
208227

209228
- `src/App.vue` - Main Vue.js dashboard component
229+
- `src/stores/theme.js` - Theme state management (light/dark/system)
230+
- `src/stores/settings.js` - API endpoint settings management
210231
- `src/components/dashboard/DashboardHero.vue` - Statistics overview
211232
- `src/components/dashboard/RecentReports.vue` - Reports list
212233
- `src/components/dashboard/ReportDrawer.vue` - Report detail view
234+
- `src/components/settings/SettingsModal.vue` - Settings dialog (theme, API endpoint)
213235
- `src/components/tools/DnsGenerator.vue` - DMARC DNS record generator
214236

215237
## API Endpoints
@@ -274,6 +296,7 @@ The Vue.js dashboard includes:
274296
- **Report Drawer** - Detailed view of individual reports
275297
- **Top Sources** - Visualization of top sending source IPs
276298
- **DMARC DNS Generator** - Interactive tool to generate DMARC DNS TXT records
299+
- **Settings Modal** - Theme switching (light/dark/system) and custom API endpoint configuration
277300

278301
## Configuration
279302

@@ -327,6 +350,9 @@ See `parse-dmarc.service` for systemd service configuration.
327350
- **Dokploy**: `deploy/dokploy/` - Docker Compose template
328351
- **Coolify**: `deploy/coolify.yaml`
329352
- **CapRover**: `deploy/captain-definition`
353+
- **Zeabur**: `zeabur.yml` - Zeabur platform template
354+
- **Render**: `render.yaml` - Render.com configuration
355+
- **Northflank**: `Northflank.json` - Northflank configuration
330356

331357
## CI/CD
332358

@@ -342,9 +368,9 @@ See `parse-dmarc.service` for systemd service configuration.
342368

343369
See `ROADMAP.md` for the comprehensive product roadmap including:
344370

345-
- **Phase 1**: Delightful Defaults (dark mode, DNS generator, health score, exports)
371+
- **Phase 1**: Delightful Defaults (dark mode, DNS generator, health score, exports)
346372
- **Phase 2**: Proactive Intelligence (alerting, trends, GeoIP maps, DNS validator)
347-
- **Phase 3**: Enterprise Ready (auth, multi-org, RBAC, Prometheus metrics)
373+
- **Phase 3**: Enterprise Ready (auth, multi-org, RBAC, Prometheus metrics)
348374
- **Phase 4**: AI-Powered Security (AI assistant, anomaly detection, forensic reports)
349375

350376
## Contributing
@@ -370,6 +396,13 @@ See `CONTRIBUTING.md` for development setup and contribution guidelines. Key are
370396

371397
The Vue.js frontend is built to `dist/`, copied to `internal/api/dist/`, and embedded via Go's `embed` directive. The binary is self-contained.
372398

399+
### State Management
400+
401+
The frontend uses a custom reactive store pattern (similar to Pinia):
402+
403+
- `theme.js` - Manages light/dark/system theme with localStorage persistence
404+
- `settings.js` - Manages custom API endpoint with validation and connection testing
405+
373406
### MCP Integration
374407

375408
The MCP server uses the official `modelcontextprotocol/go-sdk`. It supports:

0 commit comments

Comments
 (0)