Skip to main content
Prompts Mikrotik Netwatch Network Mapping Web App Builder

model coding user risk: medium

Mikrotik Netwatch Network Mapping Web App Builder

The prompt tasks the model with acting as a full-stack developer to build a web application for mapping and monitoring networks connected to the Mikrotik Netwatch API. It specifies…

  • Policy sensitive
  • Human review

PROMPT

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.

ROLES & RULES

Role assignments

  • Act as a professional full-stack developer.

EXPECTED OUTPUT

Format
markdown
Constraints
  • step-by-step implementation
  • include schema design
  • full-stack code
  • security best practices

SUCCESS CRITERIA

  • Build role-based multi-user system
  • Provide normalized schema design with tables and relationships
  • Implement authentication and authorization with roles
  • Manage user balances and subscriptions
  • Implement CRUD for device types, devices, connections
  • Integrate with Mikrotik Netwatch API for monitoring
  • Create monitoring dashboard with interactive map
  • Implement remote device access with port forwarding
  • Support multi-router per user
  • Implement logging and audit trail
  • Apply security best practices

FAILURE MODES

  • Overlooking complex balance deduction logic
  • Incomplete Mikrotik API integration details
  • Missing interactive map visualizations
  • Inadequate security implementations like CSRF protection

CAVEATS

Missing context
  • Programming languages and frameworks (e.g., React, Node.js, PostgreSQL).
  • Target database (e.g., MySQL, PostgreSQL).
  • Map library (e.g., Leaflet, Google Maps).
  • UI framework details and styling.
  • Deployment or hosting instructions.
Ambiguities
  • Tech stack (frontend/backend frameworks, database, map library) not specified.
  • Output format unclear: full code, architecture, or partial implementation?
  • Mikrotik Netwatch API integration details (endpoints, authentication) vague.
  • Balance deduction logic: exact monthly calculation and timing not defined.

QUALITY

OVERALL
0.70
CLARITY
0.85
SPECIFICITY
0.80
REUSABILITY
0.20
COMPLETENESS
0.65

IMPROVEMENT SUGGESTIONS

  • Specify tech stack: 'Use React.js for frontend, Node.js/Express for backend, PostgreSQL for database, Leaflet for maps.'
  • Clarify output: 'Provide complete source code in a zipped folder structure, with README.'
  • Break into phases: 'Step 1: Database schema SQL. Step 2: Backend API code. etc.'
  • Add success criteria: 'App must pass security scans and handle 100 concurrent users.'
  • Define Mikrotik API: 'Use RouterOS API v7 with provided credentials.'

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR MODEL