This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
LocalNetAppChat (LNAC) is a client-server application for local network communication written in C#/.NET 8.0. It consists of:
- Server: ASP.NET Core Web API handling message routing and file storage
- Client: Console application for sending/receiving messages
- Bot: Plugin-based application for executing scripts and responding to commands
# Build entire solution
cd Source/LocalNetAppChat
dotnet build
# Build specific project
dotnet build LocalNetAppChat.Server/LocalNetAppChat.Server.csproj
# Build in Release mode
dotnet build --configuration Release# Run all tests
cd Source/LocalNetAppChat
dotnet test
# Run tests for specific project
dotnet test LocalNetAppChat.Domain.Tests/LocalNetAppChat.Domain.Tests.csproj
dotnet test LocalNetAppChat.Server.Domain.Tests/LocalNetAppChat.Server.Domain.Tests.csproj# Run Server
cd Source/LocalNetAppChat/LocalNetAppChat.Server
dotnet run -- --key "MySecretKey"
# Run Client (example: chat mode)
cd Source/LocalNetAppChat/LocalNetAppChat.ConsoleClient
dotnet run -- chat --server localhost --key "MySecretKey" --clientName "TestClient"
# Run Bot
cd Source/LocalNetAppChat/LocalNetAppChat.Bot
dotnet run -- --server localhost --key "MySecretKey" --clientName "TestBot"Source/LocalNetAppChat/
├── CommandLineArguments/ # Shared CLI parsing utilities
├── LocalNetAppChat.Bot/ # Bot application with plugin system
│ └── Plugins/ # Plugin implementations (Ping, Execute, etc.)
├── LocalNetAppChat.ConsoleClient/ # Client console application
├── LocalNetAppChat.Domain/ # Shared domain logic and models
├── LocalNetAppChat.Server/ # Web API server application
└── LocalNetAppChat.Server.Domain/ # Server-specific domain logic
-
Message Processing Pipeline
- Server uses a pipeline pattern for processing incoming messages
- Pipeline components: SecurityValidation → MessageParsing → DirectMessageProcessing → Storage
- Located in
LocalNetAppChat.Server.Domain/MessageProcessing/
-
Plugin Architecture (Bot)
- Bot plugins implement
IPlugininterface - Plugins respond to specific commands (e.g.,
/ping,exec) - New plugins can be added in
LocalNetAppChat.Bot/Plugins/
- Bot plugins implement
-
Command Line Parsing
- Shared
CommandLineArgumentslibrary handles CLI parsing - Uses custom tokenizer for parsing complex command strings
- Supports both simple arguments and key-value pairs
- Shared
-
Client Operating Modes
listener: Receive messages onlymessage: Send single messagechat: Interactive send/receivefileupload/download/delete/listfiles: File operations
-
Security Model
- Simple key-based authentication (shared secret)
- All clients must provide matching key to connect
- Server validates key on every request
-
Direct Messaging: Recent enhancement allows 1:n messaging where messages can be sent to specific clients using
/msg ClientName message -
File Storage: Server maintains central file storage accessible by all authenticated clients
-
Script Execution: Bot can execute PowerShell and Python scripts from designated scripts folder
-
Cross-Platform: Uses .NET 8.0 for Windows, Linux, and macOS support
-
Communication Protocol: HTTP/HTTPS with optional SSL certificate validation bypass for development
When implementing new features:
-
Adding New Bot Commands: Create new plugin in
LocalNetAppChat.Bot/Plugins/implementingIPlugin -
Modifying Message Processing: Update pipeline components in
LocalNetAppChat.Server.Domain/MessageProcessing/ -
Adding Client Commands: Extend command parsing in
LocalNetAppChat.ConsoleClient/ -
Testing: Add unit tests in corresponding
.Testsprojects maintaining existing patterns