본문 바로가기

11월 26일 19:07 기준 · 10분마다 새 소식을 확인합니다

광고나 제휴로 순서를 바꾸지 않습니다 · pick 기준 보기 ›
소식 받기
코딩 · 개발

네트워크 모니터링 웹앱 설계

장비 모니터링, 구독 결제, 대시보드 맵 구현이 포함된 풀스택 모니터링 시스템 아키텍처를 설계할 때 사용합니다.

추천 툴
ClaudeAI 분류
쓰인 기법
역할 부여 · 세부 단계 제시 · 시스템 아키텍처 지정

프롬프트 원문

Claude로 실행
Act as a professional full-stack developer. You are tasked with developing a web application for **Mapping & Monitoring Networks** connected to the Mikrotik Netwatch API.

Your objectives include:
- Building a role-based multi-user system to manage devices and monitor their status (UP/DOWN).
- Mapping devices on an interactive map and managing user balances for device subscriptions.

Step-by-step instructions:

1. **Project Structure Setup**
   - Define tables: users, roles, devices, device_types, ports, connections, logs, routers, and user_balances.
   - Provide a normalized schema design with foreign key relationships.

2. **Authentication & Authorization**
   - Implement a multi-user system with login & session management.
   - Roles: Admin and User.
   - Admin can manage users, roles, and routers.
   - Users can only manage devices according to their balance.

3. **User & Balance Management**
   - CRUD operations for users (Admin only).
   - Each user has a balance.
   - Subscription model: Rp.250 per device/month.
   - Automatically deduct balance monthly based on device addition date.
   - Prevent device addition if balance is insufficient.

4. **Device Type Management (CRUD)**
   - Devices can be "manageable" or "unmanageable".
   - If manageable, assign IP addresses per port.

5. **Device Management (CRUD)**
   - Add devices with port count and name.
   - Assign IP addresses to each port if the device is manageable.
   - Add devices by clicking on a map (coordinates) → pop-up form appears.

6. **Connection Management**
   - Connect devices by selecting source & destination ports.
   - Assign IP addresses to connections.
   - Move connections to other available ports.
   - Remove connections.

7. **Integration with Mikrotik Netwatch API**
   - Monitor devices based on assigned IPs.
   - Retrieve UP/DOWN status.
   - Log device status changes.

8. **Monitoring Dashboard**
   - Display devices on a map with various view styles.
   - Use different icon colors for UP/DOWN status.
   - Show device status change history logs.

9. **Remote Device Access**
   - Add a "Remote" button for each device.
   - Clicking the button automatically creates a port forwarding rule in Mikrotik (src-port specified, dst-port random).
   - Add/remove port forwarding rules.

10. **Multi Router Implementation**
   - Each user can have more than one Mikrotik router as a Netwatch server.
   - Save router assignments per user.

11. **Interactive Map**
   - Visualize all devices and connections.
   - Support various map display styles.

12. **Logging & Audit Trail**
   - Save UP/DOWN history for each device.
   - Save user action history (add/remove device, connection, port forwarding).

13. **Security & Best Practices**
   - Validate all API requests.
   - Protect the application from SQL Injection, XSS, CSRF.
   - Use secure authentication for Mikrotik API.
한국어 풀이 보기(참고용)
전문 풀스택 개발자로 활동하세요. Mikrotik Netwatch API와 연동되는 **네트워크 맵핑 및 모니터링 웹 애플리케이션** 개발 미션을 수행합니다.

목표:
- 장치를 관리하고 상태(UP/DOWN)를 모니터링하는 역할 기반 다중 사용자 시스템 구축
- 대화형 지도에 장치를 맵핑하고 장치 구독을 위한 사용자 잔액 관리

단계별 지시사항:
1. 프로젝트 구조 설정 (DB 테이불 및 외래키 정규화 스키마 설계)
2. 인증 및 권한 부여 (Admin/User 역할 분리)
3. 사용자 및 잔액 관리 (월간 장치별 구독료 차감 로직)
4. 장치 유형 관리 (CRUD)
5. 장치 관리 (지도 클릭 좌표 연동 CRUD)
6. 연결 관리 (포트 간 연결 및 IP 할당)
7. API 연동 모니터링
8. 모니터링 대시보드 (상태별 아이콘 색상 및 이력 로그)
9. 원격 장치 액세스 (포트 포워딩 규칙 생성)
10. 다중 라우터 구현
11. 대화형 지도 시각화
12. 로깅 및 감사 추적
13. 보안 및 최적 표준 적용
  • 활용DB 스키마부터 API 설계까지 복합 시스템을 구축할 때 가이드 라인으로 활용하기 좋습니다.
  • 활용원하는 프레임워크(예: Next.js + PostgreSQL)를 명시해 코드를 작성하도록 요청하세요.

출처 · prompts.chat · Professional Full-Stack Developer for Network Mapping & Monitoring Application — 원문은 출처에 게시된 그대로이며, 권리는 원작자에게 있습니다.

텍스트 결과

Gemini로 실행한 결과입니다. 입력 항목에는 국내 환경의 예시값을 적용했습니다(AI 생성 — 사실 확인 필요).

실행 입력값 보기
Act as a professional full-stack developer. You are tasked with developing a web application for **Mapping & Monitoring Networks** connected to the Mikrotik Netwatch API.

Your objectives include:
- Building a role-based multi-user system to manage devices and monitor their status (UP/DOWN).
- Mapping devices on an interactive map and managing user balances for device subscriptions.

Step-by-step instructions:

1. **Project Structure Setup**
   - Define tables: users, roles, devices, device_types, ports, connections, logs, routers, and user_balances.
   - Provide a normalized schema design with foreign key relationships.

2. **Authentication & Authorization**
   - Implement a multi-user system with login & session management.
   - Roles: Admin and User.
   - Admin can manage users, roles, and routers.
   - Users can only manage devices according to their balance.

3. **User & Balance Management**
   - CRUD operations for users (Admin only).
   - Each user has a balance.
   - Subscription model: ₩500 per device/month.
   - Automatically deduct balance monthly based on device addition date.
   - Prevent device addition if balance is insufficient.

4. **Device Type Management (CRUD)**
   - Devices can be "manageable" or "unmanageable".
   - If manageable, assign IP addresses per port.

5. **Device Management (CRUD)**
   - Add devices with port count and name.
   - Assign IP addresses to each port if the device is manageable.
   - Add devices by clicking on a map (coordinates) → pop-up form appears.

6. **Connection Management**
   - Connect devices by selecting source & destination ports.
   - Assign IP addresses to connections.
   - Move connections to other available ports.
   - Remove connections.

7. **Integration with Mikrotik Netwatch API**
   - Monitor devices based on assigned IPs.
   - Retrieve UP/DOWN status.
   - Log device status changes.

8. **Monitoring Dashboard**
   - Display devices on a map with various view styles.
   - Use different icon colors for UP/DOWN status.
   - Show device status change history logs.

9. **Remote Device Access**
   - Add a "Remote" button for each device.
   - Clicking the button automatically creates a port forwarding rule in Mikrotik (src-port specified, dst-port random).
   - Add/remove port forwarding rules.

10. **Multi Router Implementation**
   - Each user can have more than one Mikrotik router as a Netwatch server.
   - Save router assignments per user.

11. **Interactive Map**
   - Visualize all devices and connections.
   - Support various map display styles.

12. **Logging & Audit Trail**
   - Save UP/DOWN history for each device.
   - Save user action history (add/remove device, connection, port forwarding).

13. **Security & Best Practices**
   - Validate all API requests.
   - Protect the application from SQL Injection, XSS, CSRF.
   - Use secure authentication for Mikrotik API.

안녕하세요. Mikrotik Netwatch API 연동 네트워크 맵핑 및 모니터링 시스템의 핵심 아키텍처 및 구현 계획입니다.

  1. 데이터베이스 스키마 설계 (PostgreSQL/Prisma 기준)
  2. users: id, email, password_hash, role(ADMIN/USER), balance, created_at
  3. routers: id, user_id, name, ip_address, api_port, username, password_encrypted
  4. device_types: id, name, is_manageable
  5. devices: id, user_id, router_id, device_type_id, name, lat, lng, created_at
  6. ports: id, device_id, port_number, ip_address
  7. connections: id, src_port_id, dst_port_id, connection_ip
  8. logs: id, device_id, status(UP/DOWN), message, created_at
  9. audit_logs: id, user_id, action, details, created_at
  1. 핵심 기능 구현 전략
  2. 인증 및 권한: JWT + HTTPOnly Cookie 세션 관리. RBAC 미들웨어로 Admin/User 접근 제어.
  3. 구독/잔액 차감: 백엔드 Cron 스케줄러가 매월 등록일 기준 장비당 ₩500 차감. 잔액 미달 시 장비 등록 API(POST /devices) 블로킹.
  4. Mikrotik API 통합: routeros-client 라이브러리를 활용해 각 유저의 라우터와 SSL 소켓 통신. Netwatch 주기적 핑 테스트 및 상태(UP: 초록, DOWN: 빨강) 로그 기록.
  5. 인터랙티브 맵: Leaflet.js 기반 지도 UI. 클릭 위치 좌표(lat, lng)를 팝업 폼으로 전송하여 장비 추가 및 커스텀 마커/연결선 렌더링.
  6. 원격 접속: 장비의 'Remote' 버튼 클릭 시 Mikrotik API로 NAT Port Forwarding (dst-nat) 규칙 자동 생성 및 임의 포트 할당.
  1. 보안 및 안정성
  2. ORM 적용으로 SQL Injection 방지, Helmet/CSURF 적용으로 XSS 및 CSRF 차단.
  3. 라우터 접속 비밀번호는 AES-256-GCM 암호화 저장.

초기 프로젝트 구조 및 DB 마이그레이션 코드를 바로 생성할까요?

mopick 개선안

원문을 더 잘 동작하게 고쳐 쓴 프롬프트

원문을 그대로 넣으면 AI 가 매번 다르게 답하거나 중요한 부분을 빠뜨릴 수 있습니다. 개선안은 원문의 뜻과 언어는 그대로 두고 역할 · 바꿔 넣을 입력 칸 · 결과 형식 · 지킬 조건을 보완해 다시 쓴 버전입니다. 원문과 같은 곳(ChatGPT · Claude 등)에 그대로 붙여 넣어 쓰면 됩니다.

AI 자체 평가 — 개선안을 쓴 AI 가 명확성 · 구체성 · 결과 형식 · 재사용성 기준(100점)으로 직접 매긴 점수 · 결과를 돌려 검증한 값은 아님

원문82
개선안95

원문의 문제 → 개선안에서 고친 점

  • 입력 칸레슨 05 배우기 ›

    원문 · 없음바꿔 넣을 자리가 표시돼 있지 않아 쓸 때마다 원문을 직접 고쳐야 했습니다.

    개선 · 2개[e.g., Node.js (Express), React, PostgreSQL] · [e.g., Leaflet.js / OpenStreetMap]

고친 이유 (개선안을 만든 AI 의 설명)

  1. 1기술 스택 및 지도 라이브러리 설정을 위한 [대괄호] 파라미터 추가
  2. 2출력 형식을 DB 스키마, 백엔드 로직, 프론트엔드로 명확히 구체화
  3. 3예외 케이스 검증 및 결과물 품질 보장을 위한 자기 검토 단계 보강

원문

Act as a professional full-stack developer. You are tasked with developing a web application for **Mapping & Monitoring Networks** connected to the Mikrotik Netwatch API.

Your objectives include:
- Building a role-based multi-user system to manage devices and monitor their status (UP/DOWN).
- Mapping devices on an interactive map and managing user balances for device subscriptions.

Step-by-step instructions:

1. **Project Structure Setup**
   - Define tables: users, roles, devices, device_types, ports, connections, logs, routers, and user_balances.
   - Provide a normalized schema design with foreign key relationships.

2. **Authentication & Authorization**
   - Implement a multi-user system with login & session management.
   - Roles: Admin and User.
   - Admin can manage users, roles, and routers.
   - Users can only manage devices according to their balance.

3. **User & Balance Management**
   - CRUD operations for users (Admin only).
   - Each user has a balance.
   - Subscription model: Rp.250 per device/month.
   - Automatically deduct balance monthly based on device addition date.
   - Prevent device addition if balance is insufficient.

4. **Device Type Management (CRUD)**
   - Devices can be "manageable" or "unmanageable".
   - If manageable, assign IP addresses per port.

5. **Device Management (CRUD)**
   - Add devices with port count and name.
   - Assign IP addresses to each port if the device is manageable.
   - Add devices by clicking on a map (coordinates) → pop-up form appears.

6. **Connection Management**
   - Connect devices by selecting source & destination ports.
   - Assign IP addresses to connections.
   - Move connections to other available ports.
   - Remove connections.

7. **Integration with Mikrotik Netwatch API**
   - Monitor devices based on assigned IPs.
   - Retrieve UP/DOWN status.
   - Log device status changes.

8. **Monitoring Dashboard**
   - Display devices on a map with various view styles.
   - Use different icon colors for UP/DOWN status.
   - Show device status change history logs.

9. **Remote Device Access**
   - Add a "Remote" button for each device.
   - Clicking the button automatically creates a port forwarding rule in Mikrotik (src-port specified, dst-port random).
   - Add/remove port forwarding rules.

10. **Multi Router Implementation**
   - Each user can have more than one Mikrotik router as a Netwatch server.
   - Save router assignments per user.

11. **Interactive Map**
   - Visualize all devices and connections.
   - Support various map display styles.

12. **Logging & Audit Trail**
   - Save UP/DOWN history for each device.
   - Save user action history (add/remove device, connection, port forwarding).

13. **Security & Best Practices**
   - Validate all API requests.
   - Protect the application from SQL Injection, XSS, CSRF.
   - Use secure authentication for Mikrotik API.

개선안 · 색칠한 [칸]에 내 내용을 넣어 쓰세요

Act as a senior full-stack developer. You are tasked with designing and developing a web application for **Mapping & Monitoring Networks** connected to the Mikrotik Netwatch API.

**Environment & Preferences:**
- Preferred Tech Stack: [e.g., Node.js (Express), React, PostgreSQL]
- Map Library: [e.g., Leaflet.js / OpenStreetMap]

**Key Objectives:**
1. Role-based multi-user management (Admin/User) with device subscription billing (Rp.250/device/month auto-deduction).
2. Device & port mapping on an interactive map with connection management.
3. Mikrotik Netwatch API integration for device status monitoring, logging, and automated port forwarding.

**Step-by-Step Requirements:**
1. **Database Schema**: Provide normalized schema design (tables: users, roles, devices, device_types, ports, connections, logs, routers, user_balances) with explicit foreign keys.
2. **Authentication & Roles**: Implement login/session; Admin manages users/roles/routers; Users manage devices based on balance.
3. **Billing System**: CRUD for users (Admin), device addition validation based on balance, and monthly auto-deduction logic.
4. **Device & Port CRUD**: Support manageable (IP per port) and unmanageable devices. Map-click coordinate placement via pop-up forms.
5. **Connection & Topology**: Connect source/destination ports with IP assignment, connection reassignment, and deletion.
6. **Mikrotik Netwatch & Remote Access**: Poll/receive UP/DOWN status, log history, and dynamically create/remove port forwarding rules (specified src-port, random dst-port).
7. **Multi-Router & Dashboard**: Support multiple Mikrotik routers per user. Provide an interactive map with UP/DOWN visual status indicators and activity audit logs.
8. **Security**: Ensure request validation, Mikrotik API authentication, and protection against SQLi, XSS, CSRF.

**Output Format Required:**
- **Part 1**: Database Schema DDL / Models.
- **Part 2**: Core Backend Logic & Mikrotik API integration code snippets.
- **Part 3**: Interactive Map Frontend Component implementation outline.

**Self-Verification Checklist:**
- Ensure all 13 core feature areas are covered.
- Check that subscription deduction and balance validation edge cases are handled.
- Verify security practices for Mikrotik credentials storage.

같은 분야 프롬프트 코딩 · 개발

더 보기 ›