Skip to content

Commit a7c06be

Browse files
hemanandrclaude
andcommitted
feat: implement comprehensive development infrastructure and documentation
- Add GitHub Actions quality gates with backend/frontend/security analysis - Implement log cleanup background service with configurable retention - Add comprehensive Serilog configuration for dev/production environments - Restructure documentation with improved organization and clarity - Add configuration management UI components and services - Enhance code quality with StyleCop analyzers and EditorConfig rules - Update CORS settings and dependency management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ce4cb24 commit a7c06be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4419
-155
lines changed

.editorconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,35 @@ csharp_style_var_for_built_in_types = false:suggestion
6666
csharp_style_var_when_type_is_apparent = true:suggestion
6767
csharp_style_var_elsewhere = false:suggestion
6868

69+
# Organize usings
70+
dotnet_sort_system_directives_first = true
71+
dotnet_separate_import_directive_groups = false
72+
73+
# Code quality rules (relaxed for internal project)
74+
dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types
75+
dotnet_diagnostic.CA2007.severity = none # Consider calling ConfigureAwait on the awaited task
76+
dotnet_diagnostic.CA1062.severity = suggestion # Validate arguments of public methods
77+
78+
# StyleCop Rules (selective enforcement for internal project)
79+
dotnet_diagnostic.SA0001.severity = none # XML comment analysis disabled
80+
dotnet_diagnostic.SA1633.severity = none # File should have header
81+
dotnet_diagnostic.SA1200.severity = none # Using directives should be placed correctly
82+
dotnet_diagnostic.SA1101.severity = none # Prefix local calls with this
83+
dotnet_diagnostic.SA1309.severity = none # Field names should not begin with underscore
84+
dotnet_diagnostic.SA1413.severity = none # Use trailing comma in multi-line initializers
85+
dotnet_diagnostic.SA1118.severity = suggestion # Parameter should not span multiple lines
86+
dotnet_diagnostic.SA1600.severity = none # Elements should be documented
87+
dotnet_diagnostic.SA1601.severity = none # Partial elements should be documented
88+
dotnet_diagnostic.SA1602.severity = none # Enumeration items should be documented
89+
dotnet_diagnostic.SA1116.severity = suggestion # Parameters should begin on line after declaration
90+
dotnet_diagnostic.SA1117.severity = suggestion # Parameters should be on same line or separate lines
91+
dotnet_diagnostic.SA1127.severity = suggestion # Generic constraints should be on own line
92+
dotnet_diagnostic.SA1108.severity = suggestion # Block statements should not contain embedded comments
93+
dotnet_diagnostic.SA1502.severity = suggestion # Element should not be on single line
94+
dotnet_diagnostic.SA1516.severity = suggestion # Elements should be separated by blank line
95+
dotnet_diagnostic.SA1300.severity = suggestion # Element should begin with uppercase letter
96+
dotnet_diagnostic.SA1136.severity = suggestion # Enum values should be on separate lines
97+
6998
# TypeScript, JavaScript, JSX, TSX files
7099
[*.{ts,tsx,js,jsx}]
71100
indent_size = 2
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Quality Gates
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
jobs:
10+
backend-quality:
11+
runs-on: ubuntu-latest
12+
name: Backend Code Quality
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: '8.0.x'
21+
22+
- name: Restore dependencies
23+
run: dotnet restore ThingConnect.Pulse.Server/ThingConnect.Pulse.Server.csproj
24+
25+
- name: Build with analyzers
26+
run: dotnet build ThingConnect.Pulse.Server/ThingConnect.Pulse.Server.csproj --no-restore --configuration Release --verbosity normal
27+
28+
- name: Run tests (if any)
29+
run: |
30+
if [ -d "ThingConnect.Pulse.Tests" ]; then
31+
dotnet test ThingConnect.Pulse.Tests --no-build --configuration Release
32+
else
33+
echo "No test project found - skipping tests"
34+
fi
35+
36+
frontend-quality:
37+
runs-on: ubuntu-latest
38+
name: Frontend Code Quality
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: '18'
47+
cache: 'npm'
48+
cache-dependency-path: thingconnect.pulse.client/package-lock.json
49+
50+
- name: Install dependencies
51+
run: |
52+
cd thingconnect.pulse.client
53+
npm ci
54+
55+
- name: Run ESLint
56+
run: |
57+
cd thingconnect.pulse.client
58+
npm run lint
59+
60+
- name: Check Prettier formatting
61+
run: |
62+
cd thingconnect.pulse.client
63+
npm run format -- --check
64+
65+
- name: Build frontend
66+
run: |
67+
cd thingconnect.pulse.client
68+
npm run build
69+
70+
security-scan:
71+
runs-on: ubuntu-latest
72+
name: Security Analysis
73+
74+
steps:
75+
- uses: actions/checkout@v4
76+
77+
- name: Run npm audit
78+
run: |
79+
cd thingconnect.pulse.client
80+
npm audit --audit-level=high
81+
82+
- name: Setup .NET for security scan
83+
uses: actions/setup-dotnet@v4
84+
with:
85+
dotnet-version: '8.0.x'
86+
87+
- name: Install security scanning tool
88+
run: dotnet tool install --global Microsoft.CST.DevSkim.CLI
89+
90+
- name: Run DevSkim security analysis
91+
run: devskim analyze . --output-file security-report.json --output-format json || true
92+
93+
- name: Upload security report
94+
uses: actions/upload-artifact@v4
95+
if: always()
96+
with:
97+
name: security-report
98+
path: security-report.json

.obsidian/app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.obsidian/core-plugins.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"file-explorer": true,
3+
"global-search": true,
4+
"switcher": true,
5+
"graph": true,
6+
"backlink": true,
7+
"canvas": true,
8+
"outgoing-link": true,
9+
"tag-pane": true,
10+
"footnotes": false,
11+
"properties": false,
12+
"page-preview": true,
13+
"daily-notes": true,
14+
"templates": true,
15+
"note-composer": true,
16+
"command-palette": true,
17+
"slash-command": false,
18+
"editor-status": true,
19+
"bookmarks": true,
20+
"markdown-importer": false,
21+
"zk-prefixer": false,
22+
"random-note": false,
23+
"outline": true,
24+
"word-count": true,
25+
"slides": false,
26+
"audio-recorder": false,
27+
"workspaces": false,
28+
"file-recovery": true,
29+
"publish": false,
30+
"sync": true,
31+
"bases": true,
32+
"webviewer": false
33+
}

ONE_PAGER.MD

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## 0) One‑liner & Intent
44

5-
A free, on‑prem, Windows‑service + web UI tool for manufacturing sites to monitor device **availability** (Ethernet/Wi‑Fi, IPv4/IPv6) using a **YAML** configuration, with **live status**, **historical rollups**, and **CSV export**. Designed for wide adoption to promote the ThingConnect brand.
5+
**Free, on-premises availability monitoring for manufacturing IT/OT over IPv4/IPv6.**
6+
7+
ThingConnect Pulse provides YAML-configured monitoring with live dashboard, historical rollups, and CSV export. Designed for plant IT/OT admins, production supervisors, and maintenance engineers who need reliable network device monitoring with zero external dependencies and 5-minute setup.
68

79
---
810

@@ -30,9 +32,11 @@ A free, on‑prem, Windows‑service + web UI tool for manufacturing sites to mo
3032
## 2) Primary Users & Jobs‑to‑Be‑Done
3133

3234
* **Plant IT/OT Admin:** define targets via YAML; confirm site health; export reports.
33-
* **Production Supervisor:** glance all green? view on phone/tablet before/after shift.
35+
* **Production Supervisor:** glance "all green?" view on phone/tablet before/after shift.
3436
* **Maintenance/Controls Engineer:** correlate device outages with line incidents.
3537

38+
*See [detailed personas](./docs/personas.md) for complete user profiles and JTBD analysis.*
39+
3640
**Confidence:** 0.9
3741

3842
---

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# ThingConnect Pulse
22

3-
Network availability monitoring system for manufacturing sites.
3+
**Free, on-premises availability monitoring for manufacturing IT/OT over IPv4/IPv6.**
4+
5+
ThingConnect Pulse provides YAML-configured monitoring with live dashboard, historical rollups, and CSV export. Designed for plant IT/OT admins, production supervisors, and maintenance engineers who need reliable network device monitoring with zero external dependencies.
6+
7+
**Value:**
8+
- **Lightweight**: 5-minute setup with single Windows Service installer
9+
- **Local-first**: No cloud dependencies, all data stays on-premises
10+
- **Readable config**: Simple YAML configuration with explicit Apply workflow
11+
12+
**Non-Goals (v1):**
13+
- No TLS/auth UI, no WAN exposure, no localization
14+
- Links: [Complete Specification](./ONE_PAGER.MD)[Problem & Value](./docs/value.md)[Scope & Non-Goals](./docs/scope-v1.md)[Product Roadmap](./docs/roadmap.md)
415

516
## Quick Start
617

ThingConnect.Pulse.Server/Program.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ public static async Task Main(string[] args)
1818
// Initialize path service for directory management
1919
var pathService = new PathService();
2020

21-
// Configure Serilog for rolling file logging
21+
// Create initial configuration to read Serilog settings
22+
var configuration = new ConfigurationBuilder()
23+
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
24+
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", optional: true, reloadOnChange: true)
25+
.Build();
26+
27+
// Configure Serilog from configuration files
2228
Log.Logger = new LoggerConfiguration()
23-
.MinimumLevel.Information()
24-
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
25-
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Information)
29+
.ReadFrom.Configuration(configuration)
2630
.Enrich.FromLogContext()
27-
.WriteTo.Console()
28-
.WriteTo.File(
29-
Path.Combine(pathService.GetLogsDirectory(), "pulse-.log"),
30-
rollingInterval: RollingInterval.Day,
31-
retainedFileCountLimit: 30,
32-
shared: true)
31+
.Enrich.WithMachineName()
32+
.Enrich.WithProcessId()
3333
.CreateLogger();
3434

3535
try
@@ -76,13 +76,16 @@ public static async Task Main(string[] args)
7676

7777
// Add prune services
7878
builder.Services.AddScoped<IPruneService, PruneService>();
79+
80+
// Add log cleanup service
81+
builder.Services.AddHostedService<LogCleanupBackgroundService>();
7982

8083
// Add CORS
8184
builder.Services.AddCors(options =>
8285
{
8386
options.AddPolicy("AllowFrontend", policy =>
8487
{
85-
policy.WithOrigins("https://localhost:55610", "http://localhost:55610", "https://localhost:5173", "http://localhost:5173")
88+
policy.WithOrigins("https://localhost:55610", "http://localhost:55610", "https://localhost:5173", "http://localhost:5173", "https://localhost:55605")
8689
.AllowAnyHeader()
8790
.AllowAnyMethod()
8891
.AllowCredentials();

0 commit comments

Comments
 (0)