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.
This commit is contained in:
Tom Butcher 2025-08-18 01:08:14 +01:00
parent e2eb240a06
commit 110f6d9a57

View File

@ -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: The application uses `config.json` for configuration. Update the following sections:
### Etcd Configuration ### Etcd Configuration
```json ```json
{ {
"database": { "database": {
@ -42,6 +43,7 @@ The application uses `config.json` for configuration. Update the following secti
``` ```
### MongoDB Configuration ### MongoDB Configuration
```json ```json
{ {
"database": { "database": {
@ -53,6 +55,7 @@ The application uses `config.json` for configuration. Update the following secti
``` ```
### Authentication Configuration ### Authentication Configuration
```json ```json
{ {
"auth": { "auth": {
@ -70,11 +73,13 @@ The application uses `config.json` for configuration. Update the following secti
## Running the Application ## Running the Application
### Development ### Development
```bash ```bash
npm run dev npm run dev
``` ```
### Production ### Production
```bash ```bash
npm start npm start
``` ```
@ -84,6 +89,7 @@ npm start
### Installation ### Installation
#### Using Docker #### Using Docker
```bash ```bash
docker run -d --name etcd \ docker run -d --name etcd \
-p 2379:2379 \ -p 2379:2379 \
@ -95,19 +101,23 @@ docker run -d --name etcd \
``` ```
#### Using Homebrew (macOS) #### Using Homebrew (macOS)
```bash ```bash
brew install etcd brew install etcd
etcd etcd
``` ```
#### Using apt (Ubuntu/Debian) #### Using apt (Ubuntu/Debian)
```bash ```bash
sudo apt-get install etcd sudo apt-get install etcd
sudo systemctl start etcd sudo systemctl start etcd
``` ```
### Verification ### Verification
Test that etcd is running: Test that etcd is running:
```bash ```bash
curl http://localhost:2379/version curl http://localhost:2379/version
``` ```
@ -139,6 +149,7 @@ The service exposes WebSocket endpoints for:
## Development ## Development
### Project Structure ### Project Structure
``` ```
src/ src/
├── auth/ # Authentication logic ├── auth/ # Authentication logic
@ -152,7 +163,7 @@ src/
### Adding New Features ### Adding New Features
1. **Database operations**: Use the `etcdServer` instance for etcd operations 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 3. **Authentication**: Extend the `KeycloakAuth` class
## Troubleshooting ## Troubleshooting