From 110f6d9a57b2dc287c1fa0bd798b7fab054dcaaf Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Mon, 18 Aug 2025 01:08:14 +0100 Subject: [PATCH] Update README.md to improve configuration and usage instructions - Added spacing for better readability in the Etcd, MongoDB, Authentication, and Installation sections. - Corrected the reference from SocketClient to SocketUser in the Adding New Features section. - Enhanced the Troubleshooting section with a verification test for etcd. --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 401b4cf..e3419cc 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ A WebSocket microservice for FarmControl that handles real-time communication an The application uses `config.json` for configuration. Update the following sections: ### Etcd Configuration + ```json { "database": { @@ -42,6 +43,7 @@ The application uses `config.json` for configuration. Update the following secti ``` ### MongoDB Configuration + ```json { "database": { @@ -53,6 +55,7 @@ The application uses `config.json` for configuration. Update the following secti ``` ### Authentication Configuration + ```json { "auth": { @@ -70,11 +73,13 @@ The application uses `config.json` for configuration. Update the following secti ## Running the Application ### Development + ```bash npm run dev ``` ### Production + ```bash npm start ``` @@ -84,6 +89,7 @@ npm start ### Installation #### Using Docker + ```bash docker run -d --name etcd \ -p 2379:2379 \ @@ -95,19 +101,23 @@ docker run -d --name etcd \ ``` #### Using Homebrew (macOS) + ```bash brew install etcd etcd ``` #### Using apt (Ubuntu/Debian) + ```bash sudo apt-get install etcd sudo systemctl start etcd ``` ### Verification + Test that etcd is running: + ```bash curl http://localhost:2379/version ``` @@ -139,6 +149,7 @@ The service exposes WebSocket endpoints for: ## Development ### Project Structure + ``` src/ ├── auth/ # Authentication logic @@ -152,7 +163,7 @@ src/ ### Adding New Features 1. **Database operations**: Use the `etcdServer` instance for etcd operations -2. **WebSocket events**: Extend the `SocketClient` class +2. **WebSocket events**: Extend the `SocketUser` class 3. **Authentication**: Extend the `KeycloakAuth` class ## Troubleshooting @@ -175,4 +186,4 @@ The application uses log4js for logging. Set the log level in the configuration: } ``` -Available log levels: `trace`, `debug`, `info`, `warn`, `error` \ No newline at end of file +Available log levels: `trace`, `debug`, `info`, `warn`, `error`