UNPKG

p3x-redis-ui-server

Version:

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

105 lines (75 loc) β€’ 5.66 kB
[//]: #@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