/NodeJS-DevRadar

DevRadar is a project developed during the Semana Omnistack presented by Rockeseat. This project is a way to find near devs by techs.

Primary LanguageTypeScriptMIT LicenseMIT

DevRadar API

DevRadar is a Restfull API of DevRadar Web and DevRadar Mobile

Express Version Cors Version Axios Version Mongoose Version SocketIo Version Typescript Version

📝About

DevRadar API is a project developed during the Semana Omnistack 10 presented by Rockeseat.

WEB: DevRadar Web

API: DevRadar Mobile

🚀 Getting started

# Clone this repository
$ git clone https://github.com/Luksdantas/NodeJS-DevRadar.git

# Access the project folder cmd/terminal
$ cd NodeJS-DevRadar

# install the dependencies
$ npm install

# Run the application in development mode
$ npm run dev

# The application will open on the port: 3333 - go to http://localhost:3333

🛠 DevRadar API

Insomnia document

POST Create Dev

Request

POST /devs

{
  "github_username": "Luksdantas",
  "techs": "ReactJs, Node, ReactNative",
  "latitude": 0.1,
  "longitude": 0.1
}

Response

{
  "techs": [
    "ReactJs",
    "ReactNative",
    "Node"
  ],
  "_id": "604a3418616cc11ee0ef6a88",
  "github_username": "Luksdantas",
  "name": "Luksdantas",
  "avatar_url": "https://avatars.githubusercontent.com/u/55062200?v=4",
  "bio": "\r\n    do {\r\n      beBetterEveryDay()\r\n} while (true);\r\n \r\n\r\n\r\n\r\n",
  "location": {
    "coordinates": [
      0.1,
      0.1
    ],
    "_id": "604a3418616cc11ee0ef6a89",
    "type": "Point"
  },
  "__v": 0
}

GET Devs

Request

GET /devs

Response

[
  {
    "techs": [
      "ReactJs",
      "ReactNative",
      "Node"
    ],
    "_id": "604a3418616cc11ee0ef6a88",
    "github_username": "Luksdantas",
    "name": "Luksdantas",
    "avatar_url": "https://avatars.githubusercontent.com/u/55062200?v=4",
    "bio": "\r\n    do {\r\n      beBetterEveryDay()\r\n} while (true);\r\n \r\n\r\n\r\n\r\n",
    "location": {
      "coordinates": [
        0.1,
        0.1
      ],
      "_id": "604a3418616cc11ee0ef6a89",
      "type": "Point"
    },
    "__v": 0
  }
]

PUT Dev

Request

PUT /devs/:github_username

{
	"techs": "ReactJs, React Native, Node, Typescript",
	"latitude": 0.2,
	"longitude": 0.2
}

Response

{
  "n": 1,
  "nModified": 1,
  "opTime": {
    "ts": "6938417867373150209",
    "t": 4
  },
  "electionId": "7fffffff0000000000000004",
  "ok": 1,
  "$clusterTime": {
    "clusterTime": "6938417867373150209",
    "signature": {
      "hash": "OKCWfoQPTczr//Fo2gA2u+GmOqo=",
      "keyId": "6936447585485848579"
    }
  },
  "operationTime": "6938417867373150209"
}

DELETE Dev

Request

DELETE /devs/:github_username

Response

{
  "n": 1,
  "opTime": {
    "ts": "6938419130093535234",
    "t": 4
  },
  "electionId": "7fffffff0000000000000004",
  "ok": 1,
  "$clusterTime": {
    "clusterTime": "6938419130093535234",
    "signature": {
      "hash": "NzCG42AJYnHs+DgkSqBSuRBrCv8=",
      "keyId": "6936447585485848579"
    }
  },
  "operationTime": "6938419130093535234",
  "deletedCount": 1
}

GET Search Near Devs

Request

GET /search?latitude=lat&longitude=lon&techs=techsstring

Response

{
  "devs": [
    {
      "techs": [
        "ReactJs",
        "ReactNative",
        "Node"
      ],
      "_id": "604a37f3089b7319e81be47a",
      "github_username": "Luksdantas",
      "name": "Luksdantas",
      "avatar_url": "https://avatars.githubusercontent.com/u/55062200?v=4",
      "bio": "\r\n    do {\r\n      beBetterEveryDay()\r\n} while (true);\r\n \r\n\r\n\r\n\r\n",
      "location": {
        "coordinates": [
          0.1,
          0.1
        ],
        "_id": "604a37f3089b7319e81be47b",
        "type": "Point"
      },
      "__v": 0
    }
  ]
}

📑 License

License

Made with ❤️ by Lucas Dantas 👋🏽 Get in Touch!