STRUCTURED

Professional Full-Stack Developer for Network Mapping & Monitoring Application

Contributed by lalsproject

Improved by Laravel Company · 2026-09-07

Improved prompt:

Act as a seasoned full-stack software engineer, specializing in web applications and database systems. You are responsible for designing and implementing a comprehensive web application for Network Mapping and Monitoring that integrates with the Mikrotik Netwatch API.

Project Overview:
Your primary goal is to create a multi-user, role-based web application that enables administrators and users to efficiently manage network devices, monitor their status, and visualize device connections on an interactive map. The application must also handle user subscriptions and device management based on available balances.

Project Scope and Requirements:

  1. Database Schema Design

    • Step 1: Design a normalized relational database schema with the following tables: users, roles, devices, device_types, ports, connections, logs, routers, and user_balances.
    • Step 2: Define primary and foreign key relationships between tables to ensure referential integrity.
    • Step 3: Document the schema design with clear field descriptions and data types.
  2. User Authentication and Authorization System

    • Step 1: Implement a secure multi-user login system with session management.
    • Step 2: Define two roles: Admin and User.
    • Admin Role:
      • Can create, update, and delete users.
      • Can manage user roles and router assignments.
    • User Role:
      • Can only manage devices based on their available balance.
    • Step 3: Implement role-based access control to restrict user actions based on their role.
  3. User and Balance Management

    • Step 1: Develop CRUD operations for the users table (Admin only).
    • Step 2: Each user must have an associated balance field.
    • Step 3: Implement a subscription model:
      • Charge Rp.250 per manageable device per month.
      • Automatically deduct the balance on the first day of each month.
      • Prevent users from adding new devices if their balance is insufficient.
  4. Device Type Management

    • Step 1: Create CRUD operations for the device_types table.
    • Step 2: Define two device types: "manageable" and "unmanageable".
    • Step 3: For manageable devices, allow associating IP addresses with each port.
  5. Device Management

    • Step 1: Develop CRUD operations for the devices table.
    • Step 2: Allow users to add devices with the following parameters: device name, port count, device type.
    • Step 3: If the device is manageable, allow IP address assignment to each port.
    • Step 4: Implement a map-based device addition feature:
      • Click on a location on the map to open a pop-up form for adding a new device.
      • The form should pre-fill the coordinates based on the map click.
  6. Connection Management

    • Step 1: Create CRUD operations for the connections table.
    • Step 2: Allow users to connect devices by selecting source and destination ports.
    • Step 3: Assign an IP address to each connection.
    • Step 4: Implement connection movement to other available ports.
    • Step 5: Provide a connection deletion feature.
  7. Mikrotik Netwatch API Integration

    • Step 1: Implement API calls to monitor device status based on assigned IP addresses.
    • Step 2: Retrieve the UP/DOWN status for each device.
    • Step 3: Log device status changes in the logs table.
  8. Monitoring Dashboard

    • Step 1: Design an interactive map component.
    • Step 2: Display devices on the map using different icons based on their status (UP/DOWN).
    • Step 3: Implement a device status change history log viewer.
  9. Remote Device Access

    • Step 1: Add a "Remote Access" button to each manageable device's interface.
    • Step 2: When clicked, automatically create a port forwarding rule in the associated Mikrotik router:
      • Source port: specified by the user.
      • Destination port: randomly generated.
    • Step 3: Implement a port forwarding rule addition and removal feature.
  10. Multi-Router Implementation

    • Step 1: Allow each user to have multiple Mikrotik routers as Netwatch servers.
    • Step 2: Implement a router assignment feature for each user.
  11. Interactive Map Features

    • Step 1: Support various map display styles (satellite, map, terrain).
    • Step 2: Implement zoom and pan functionality.
    • Step 3: Allow users to toggle device and connection visibility.
  12. Logging and Audit Trail

    • Step 1: Save device UP/DOWN history in the logs table.
    • Step 2: Save user action history (add/remove device, connection, port forwarding rule).
  13. Security and Best Practices

    • Step 1: Implement input validation for all API requests to prevent SQL Injection and cross-site scripting (XSS) attacks.
    • Step 2: Implement a secure authentication mechanism for the Mikrotik API integration.
    • Step 3: Follow best practices for securing sensitive data and protecting the application from common vulnerabilities.

Deliverables:

  • A comprehensive database schema design document.
  • A detailed implementation plan for each feature described above.
  • Suggestions for the technology stack and programming languages.
  • Any additional considerations or recommendations for the project's success.
Original prompt (before our improvements)

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.