Skip to content

danielamram/drivenets-router-management-be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drivenets Router Management Backend

This project provides a mock backend server for the Drivenets Router Management interview application using json-server.

Description

The Drivenets Router Management Backend is a simple REST API server that simulates a backend for router management operations. It uses json-server to provide a fully functioning REST API based on a JSON file that serves as the database.

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/drivenets-router-management-be.git
cd drivenets-router-management-be
  1. Install dependencies:
npm install

Usage

Starting the server

To start the mock backend server:

npm start

This will start the server on port 3001. The API will be available at http://localhost:3001.

API Endpoints

RESTful routes for the routers are available at http://localhost:3001/routers.

for example:

[
  {
    "id": "r-000001",
    "name": "Regional Gateway",
    "type": "enterprise",
    "createdAt": "2022-10-15T09:34:33.000Z",
    "updatedAt": "2023-06-01T07:55:51.774Z",
    "coordinates": {
      "latitude": 80.9654,
      "longitude": -13.3508
    },
    "portCount": 127,
    "supportedProtocols": ["RIP", "BGP", "HSRP", "LISP", "OSPF", "PIM"],
    "throughputGbps": 40
  },
  {
    "id": "r-000003",
    "name": "Personal WiFi",
    "type": "home",
    "createdAt": "2022-10-08T23:48:06.000Z",
    "updatedAt": "2024-12-12T17:39:43.240Z",
    "coordinates": {
      "latitude": -25.842,
      "longitude": 54.3554
    },
    "connectedDevices": 25,
    "parentalControlsEnabled": false,
    "maxBandwidthMbps": 1000
  },
  {
    "id": "r-000006",
    "name": "High-Speed Access Point",
    "type": "wifi",
    "createdAt": "2022-01-08T07:06:11.000Z",
    "updatedAt": "2024-04-28T21:52:28.723Z",
    "coordinates": {
      "latitude": -38.3813,
      "longitude": 156.3821
    },
    "wifiChannels": [4, 20, 33, 16],
    "supportsDualBand": true
  }
]

You would have the following endpoints:

  • GET /routers - Get all routers
  • GET /routers/1 - Get router with id 1
  • POST /routers - Create a new router
  • PUT /routers/1 - Update router with id 1
  • PATCH /routers/1 - Partially update router with id 1
  • DELETE /routers/1 - Delete router with id 1

Similar endpoints would be available for interfaces.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published