[//]: #@corifeus-header

# 🏍️ P3X Redis UI server — Socket.IO backend for the dual Angular + React frontend with AI queries, 54 languages, and auto data decompression

                        
[//]: #@corifeus-header:end
## Folder Structure

```
redis-ui-server/
├── bin/
│   ├── p3xrs.mjs               # Main entry point (ES Module)
│   └── bcrypt-password.mjs      # Password hash generator utility
├── src/
│   ├── index.mjs                # Barrel export
│   ├── lib/
│   │   ├── boot.mjs             # Server bootstrap (Express + Socket.IO)
│   │   ├── cli.mjs              # CLI argument parsing (Commander)
│   │   ├── console-stamp.mjs    # Logging utilities
│   │   ├── http-auth.mjs        # HTTP Basic authentication (bcrypt)
│   │   ├── check-license.mjs    # License validation against network.corifeus.com
│   │   ├── redis-static-commands.mjs  # Redis command definitions
│   │   └── ioredis-cluster/     # Redis Cluster utilities (8 modules)
│   └── service/
│       ├── index.mjs            # Service initialization
│       ├── http/                # Express HTTP server + static file serving
│       ├── license/             # License enforcement middleware
│       └── socket.io/
│           ├── socket.mjs       # Socket.IO connection handler
│           ├── shared.mjs       # Shared state
│           └── request/         # Per-command request handlers (25+ modules)
├── dist/                        # Build output
├── Gruntfile.cjs                # Build tasks (CommonJS, corifeus-builder)
└── package.json                 # "type": "module" (native ESM)
```

### Key Architecture Notes
- **Full ES Modules** — All source files use `.mjs` extension with `import`/`export` syntax; `package.json` has `"type": "module"`
- **Socket.IO** — Primary communication protocol (not REST) for all Redis operations
- **ioredis** — Redis client library supporting standalone, cluster, and sentinel modes
- **SSH tunneling** — `tunnel-ssh` for secure Redis connections
- **settle() pattern** — Test connection uses a settlement guard to prevent double-emit race conditions

## Exceptions
- Always log a short context plus the full exception (stack trace included).
- Never swallow errors. Rethrow or propagate unless explicitly safe to continue. Redact secrets.
- Example (do this): `catch (e) { console.error('context: saving profile failed', e); throw e }`
- Dont always try/catch, only when we needed, not always.
 - Avoid micro try/catch. Do not wrap simple setters/state updates or single-line calls in individual try/catch blocks. Prefer a single, meaningful boundary (e.g., around a request handler or an async action) where you can add context and rethrow/propagate.
 - Only catch when you will: (a) add context and rethrow; or (b) intentionally continue with a documented fallback that is safe. Otherwise, let errors bubble to the existing handler.
 - Prefer optional chaining, guards, and validations over blanket try/catch.
[//]: #@corifeus-footer

---

## 🚀 Quick and Affordable Web Development Services

If you want to quickly and affordably develop your next digital project, visit [corifeus.eu](https://corifeus.eu) for expert solutions tailored to your needs.

---

## 🌐 Powerful Online Networking Tool  

Discover the powerful and free online networking tool at [network.corifeus.com](https://network.corifeus.com).  

**🆓 Free**  
Designed for professionals and enthusiasts, this tool provides essential features for network analysis, troubleshooting, and management.  
Additionally, it offers tools for:  
- 📡 Monitoring TCP, HTTP, and Ping to ensure optimal network performance and reliability.  
- 📊 Status page management to track uptime, performance, and incidents in real time with customizable dashboards.  

All these features are completely free to use.  

---

## ❤️ Support Our Open-Source Project  
If you appreciate our work, consider ⭐ starring this repository or 💰 making a donation to support server maintenance and ongoing development. Your support means the world to us—thank you!  

---

### 🌍 About My Domains  
All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](https://corifeus.eu), and [corifeus.com](https://corifeus.com), are developed in my spare time. While you may encounter minor errors, the sites are generally stable and fully functional.  

---

### 📈 Versioning Policy  
**Version Structure:** We follow a **Major.Minor.Patch** versioning scheme:  
- **Major:** 📅 Corresponds to the current year.  
- **Minor:** 🌓 Set as 4 for releases from January to June, and 10 for July to December.  
- **Patch:** 🔧 Incremental, updated with each build.  

**🚨 Important Changes:** Any breaking changes are prominently noted in the readme to keep you informed.

---


[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2026.4.371

 [![NPM](https://img.shields.io/npm/v/p3x-redis-ui-server.svg)](https://www.npmjs.com/package/p3x-redis-ui-server)  [![Donate for PatrikX3 / P3X](https://img.shields.io/badge/Donate-PatrikX3-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6)  [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)





[//]: #@corifeus-footer:end