11# 🔬 NanoEdgeRT 📏
22
3+ [ ![ CI] ( https://github.com/yourusername/NanoEdgeRT/workflows/CI/badge.svg )] ( https://github.com/yourusername/NanoEdgeRT/actions )
4+ [ ![ Tests] ( https://img.shields.io/badge/tests-26%20passed-brightgreen?style=flat-square )] ( https://github.com/yourusername/NanoEdgeRT/actions )
5+ [ ![ Coverage] ( https://img.shields.io/badge/coverage-100%25-brightgreen?style=flat-square )] ( https://github.com/yourusername/NanoEdgeRT/actions )
36[ ![ Deno] ( https://img.shields.io/badge/Deno-000000?style=for-the-badge&logo=deno&logoColor=white )] ( https://deno.land/ )
47[ ![ TypeScript] ( https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white )] ( https://www.typescriptlang.org/ )
58[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge )] ( https://opensource.org/licenses/MIT )
1114## ✨ Features
1215
1316- 🚀 ** Blazing Fast Performance** - ** ~ 175µs response time** , ** 5,700+ ops/sec** throughput
17+ - 🎨 ** Modern Admin UI** - Beautiful ** Vercel-style dashboard** at ` /admin ` for service management
1418- 📊 ** Interactive API Documentation** - Beautiful ** Swagger UI** with live testing at ` /docs `
1519- 🔧 ** Zero-Config Service Management** - Add services with one command, auto-discovery
1620- 🔒 ** Enterprise-Grade Security** - JWT authentication with granular permissions
@@ -33,18 +37,21 @@ graph TB
3337 JWT -->|Invalid| Error[401 Unauthorized]
3438
3539 Router --> Health["/health"]
40+ Router --> AdminUI["/admin 🎨"]
3641 Router --> Docs["/docs /swagger"]
37- Router --> Admin ["/_admin/*"]
42+ Router --> AdminAPI ["/_admin/*"]
3843 Router --> Services[Service Routes]
3944
45+ AdminUI -->|127.0.0.1 Only| Dashboard[Modern Dashboard UI]
46+ Docs -->|127.0.0.1 Only| SwaggerUI[Interactive API Docs]
47+ AdminAPI -->|127.0.0.1 Only| Start[Start Service]
48+ AdminAPI --> Stop[Stop Service]
49+ AdminAPI --> List[List Services]
50+
4051 Services --> Worker1[Service Worker :8001]
4152 Services --> Worker2[Service Worker :8002]
4253 Services --> WorkerN[Service Worker :800N]
4354
44- Admin --> Start[Start Service]
45- Admin --> Stop[Stop Service]
46- Admin --> List[List Services]
47-
4855 subgraph "Service Directory"
4956 ServiceFiles["nanoedge/services/"]
5057 ServiceFiles --> Hello["hello/index.ts"]
@@ -82,9 +89,12 @@ graph TB
8289 ```
8390
84914 . ** Visit the documentation:**
85- Open [ http://0.0.0.0:8000/docs ] ( http://0.0.0.0:8000/docs ) to see the ** interactive Swagger UI** with live API testing.
92+ Open [ http://127.0.0.1:8000/docs ] ( http://127.0.0.1:8000/docs ) to see the ** interactive Swagger UI** with live API testing.
93+
94+ 5 . ** Access the admin interface:**
95+ Open [ http://127.0.0.1:8000/admin ] ( http://127.0.0.1:8000/admin ) for the ** modern management UI** to control services.
8696
87- 5 . ** Test the APIs:**
97+ 6 . ** Test the APIs:**
8898 ``` bash
8999 # Test hello service
90100 curl " http://0.0.0.0:8000/hello?name=World"
@@ -219,41 +229,99 @@ The JWT token should include the following claims:
219229}
220230```
221231
232+ ## 🎨 Management UI
233+
234+ ### Modern Dashboard Interface
235+
236+ ** 🎯 Admin Dashboard** : [ http://127.0.0.1:8000/admin ] ( http://127.0.0.1:8000/admin )
237+
238+ NanoEdgeRT features a ** beautiful, modern web interface** inspired by ** Vercel** and ** Next.js** design systems, built with pure HTML and CSS for maximum performance and zero dependencies.
239+
240+ ### ✨ Dashboard Features
241+
242+ - 🎨 ** Modern Design** - Vercel-inspired dark theme with gradients and animations
243+ - 📊 ** Real-time Stats** - Live service counts, status monitoring, and system health
244+ - 🔧 ** Service Management** - Start/stop services with one-click controls
245+ - 🔄 ** Auto-refresh** - Dashboard updates every 30 seconds automatically
246+ - 📱 ** Responsive Design** - Perfect on desktop, tablet, and mobile devices
247+ - 🚀 ** Instant Actions** - Real-time feedback with toast notifications
248+ - 🔗 ** Quick Links** - Direct access to service endpoints and API docs
249+
250+ ### 🎯 Dashboard Sections
251+
252+ | ** Section** | ** Description** | ** Features** |
253+ | ----------------- | ------------------------------------------ | ------------------------------------- |
254+ | 📈 ** Stats Grid** | System overview with key metrics | Total services, running count, ports |
255+ | 🔧 ** Services** | Interactive service cards with controls | Start/stop, status, JWT auth display |
256+ | 🌐 ** Quick Nav** | Fast access to endpoints and documentation | Service links, API docs, health check |
257+ | ⚡ ** Live Data** | Real-time updates without page refresh | Auto-refresh, instant status updates |
258+
259+ ### 🛡️ Security Design
260+
261+ The admin interface implements ** defense-in-depth** security:
262+
263+ ``` mermaid
264+ graph LR
265+ User[User] --> Browser[Browser]
266+ Browser --> Check{Host Check}
267+ Check -->|127.0.0.1| Allow[✅ Admin UI]
268+ Check -->|0.0.0.0| Deny[❌ 403 Forbidden]
269+ Allow --> JWT[JWT Required for Actions]
270+ JWT --> Actions[Service Control]
271+ ```
272+
222273## 📊 API Endpoints
223274
224275### 📖 Interactive Documentation
225276
226- ** 🎯 Live Swagger UI** : [ http://0 .0.0.0 :8000/docs ] ( http://0 .0.0.0 :8000/docs )
277+ ** 🎯 Live Swagger UI** : [ http://127 .0.0.1 :8000/docs ] ( http://127 .0.0.1 :8000/docs )
227278
228279- 🔴 ** Try it out** : Test all APIs directly in the browser
229280- 📝 ** Real-time validation** : Input validation and response examples
230281- 🔒 ** JWT testing** : Built-in authentication token testing
231282- 📋 ** Auto-generated** : Always up-to-date with your services
232283
284+ ### 🔐 Access Control
285+
286+ For enhanced security, NanoEdgeRT implements ** IP-based access controls** :
287+
288+ | ** Endpoint Type** | ** Access** | ** Interface** | ** Examples** |
289+ | ---------------------- | ----------- | -------------- | ---------------------------------- |
290+ | 🔧 ** Admin/Docs** | ` 127.0.0.1 ` | Localhost only | ` /docs ` , ` /swagger ` , ` /_admin/* ` |
291+ | 🌐 ** Public Services** | ` 0.0.0.0 ` | All interfaces | ` /hello ` , ` /calculator ` , ` /health ` |
292+
293+ ** Why this design?**
294+
295+ - 🛡️ ** Security** : Admin functions only accessible from the server itself
296+ - 🌍 ** Accessibility** : Services available to all clients (local and remote)
297+ - ⚡ ** Performance** : No overhead for public service calls
298+ - 🔒 ** Best Practice** : Follows enterprise security patterns
299+
233300### System Endpoints
234301
235- | Endpoint | Method | Description | Performance |
236- | --------------- | ------ | -------------------------------- | -------------------------- |
237- | ` / ` | GET | Welcome message and service list | ** ~ 67µs** (14,990 ops/sec) |
238- | ` /health ` | GET | Health check and service status | ** ~ 73µs** (13,730 ops/sec) |
239- | ` /docs ` | GET | 🎨 ** Swagger UI documentation** | ** ~ 166µs** (6,010 ops/sec) |
240- | ` /swagger ` | GET | Swagger UI documentation (alias) | ** ~ 166µs** (6,010 ops/sec) |
241- | ` /openapi.json ` | GET | OpenAPI 3.0.3 specification | ** ~ 166µs** (6,010 ops/sec) |
302+ | Endpoint | Method | Description | Access | Performance |
303+ | --------------- | ------ | -------------------------------- | ---------------- | -------------------------- |
304+ | ` / ` | GET | Welcome message and service list | ` 0.0.0.0:8000 ` | ** ~ 67µs** (14,990 ops/sec) |
305+ | ` /health ` | GET | Health check and service status | ` 0.0.0.0:8000 ` | ** ~ 73µs** (13,730 ops/sec) |
306+ | ` /admin ` | GET | 🎨 ** Modern Dashboard UI** | ` 127.0.0.1:8000 ` | ** ~ 150µs** (6,600 ops/sec) |
307+ | ` /docs ` | GET | 🎨 ** Swagger UI documentation** | ` 127.0.0.1:8000 ` | ** ~ 166µs** (6,010 ops/sec) |
308+ | ` /swagger ` | GET | Swagger UI documentation (alias) | ` 127.0.0.1:8000 ` | ** ~ 166µs** (6,010 ops/sec) |
309+ | ` /openapi.json ` | GET | OpenAPI 3.0.3 specification | ` 127.0.0.1:8000 ` | ** ~ 166µs** (6,010 ops/sec) |
242310
243311### Admin Endpoints (Authentication Required)
244312
245- | Endpoint | Method | Description |
246- | ----------------------------- | ------ | ------------------------------ |
247- | ` /_admin/services ` | GET | List all services with details |
248- | ` /_admin/start/{serviceName} ` | POST | Start a specific service |
249- | ` /_admin/stop/{serviceName} ` | POST | Stop a specific service |
313+ | Endpoint | Method | Description | Access |
314+ | ----------------------------- | ------ | ------------------------------ | ---------------- |
315+ | ` /_admin/services ` | GET | List all services with details | ` 127.0.0.1:8000 ` |
316+ | ` /_admin/start/{serviceName} ` | POST | Start a specific service | ` 127.0.0.1:8000 ` |
317+ | ` /_admin/stop/{serviceName} ` | POST | Stop a specific service | ` 127.0.0.1:8000 ` |
250318
251319### Service Endpoints
252320
253- All enabled services are automatically available at:
321+ All enabled services are automatically available at ` 0.0.0.0:8000 ` :
254322
255- - ` /{serviceName} ` - Root service endpoint
256- - ` /{serviceName}/* ` - Service sub-routes
323+ - ` /{serviceName} ` - Root service endpoint (e.g., ` http://0.0.0.0:8000/hello ` )
324+ - ` /{serviceName}/* ` - Service sub-routes (e.g., ` http://0.0.0.0:8000/calculator/add ` )
257325
258326## 🧪 Testing
259327
@@ -457,7 +525,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
457525
458526## 📞 Support
459527
460- - 📚 [ Documentation] ( http://0 .0.0.0 :8000/docs )
528+ - 📚 [ Documentation] ( http://127 .0.0.1 :8000/docs )
461529- 🐛 [ Issue Tracker] ( https://github.com/lemonhx/nanoedgert/issues )
462530- 💬 [ Discussions] ( https://github.com/lemonhx/nanoedgert/discussions )
463531- 📧 [ Email Support] ( mailto:support@nanoedgert.dev )
0 commit comments