Code Monkey home page Code Monkey logo

curie's Introduction

Hey I'm Yuvraj



I'm a Full Stack Developer, Competitive Programmer, and a hobbyist Graphic and UI Designer


Tech & Tools Preference


Languages I know


Let's get in touch ๐Ÿ˜‰


curie's People

Contributors

anuprajvarma avatar curiousyuvi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

azzam1503

curie's Issues

[CREATE]: Create /delete and /update in user route

Delete Request:

curl --location --request GET 'http://localhost:5000/api/user/delete/:uid'

Delete Response:

status=200
{  "message" : "success" }

or

status=400
{  "message" : "failure" }

Update Request:

curl --location --request POST 'http://localhost:5000/api/user/update/:uid' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name":"Something New",
    "status":"๐Ÿ”ฅ bruh"
}'

Update Response:

status=200
{  "message" : "success" }

or

status=400
{  "message" : "failure" }

[CREATE]: Create /:uid route in user route

User Request:

curl --location --request GET 'http://localhost:5000/api/user/:uid'

User Response:

status=200
{
    "uid":"696969",
    "name":"Yuvraj Singh",
    "username":"curiousyuvi",
    "avatar_url":"some_url",
    "status":"๐Ÿ”ฅ hot",
    "rooms":["room1","room2"]
}

or

status=404
{
   "message":"user not found"
}

[CREATE]: Create /search/:username route in user routes

Search Request

curl --location --request GET 'http://localhost:5000/api/user/search/:username?strict=false'

Search Response

{
  users : [
   {
    "uid":"696969",
    "name":"Yuvraj Singh",
    "username":"curiousyuvi",
    "avatar_url":"some_url",
    "status":"๐Ÿ”ฅ hot",
    "rooms":["room1","room2"]
  },
  {
    "uid":"696967",
    "name":"Anup Varma",
    "username":"anupraj60",
    "avatar_url":"some_url",
    "status":"๐Ÿ”ฅ hot",
    "rooms":["room1","room3"]
  }
]
}

[CREATE]: Create /exists/:uid in user route

User exists request

curl --location --request GET 'http://localhost:5000/api/user/exists/:uid'

User exists response

status=200
{
  "exists": "true"
}
or
{
  "exists": "false"
}

or

status=400
{
  "message": "something went wrong"
}

[CREATE]: Create Room model and schema, create room route and add /create, /:rid, /delete, /update

Room Schema

{
    "_id": { type: String, required: true, unique: true },
    "name": { type: String, required: true },
    "state": { type: String, default: "idle" },
    "image_url": { type: String, default: default_avatar_url },
    "users": [{ type: String }],
    "messages": [{ type: String }]
}

Create Request:

curl --location --request POST 'http://localhost:5000/api/room/create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "rid":"121212",
    "name":"๐Ÿคž Cool music boyz",
    "username":"curiousyuvi",
    "image_url":"some_url",
    "state":"idle",
    "users":["uid1","uid2"],
    "messages":["mid1","mid2"]
}'

Create Response:

status=200
{  "message" : "success" }

or

status=400
{  "message" : "failure" }

Room Get Request:

curl --location --request GET 'http://localhost:5000/api/room/delete/:rid'

Room Get Response:

status=200
{
    "rid":"121212",
    "name":"๐Ÿคž Cool music boyz",
    "username":"curiousyuvi",
    "image_url":"some_url",
    "state":"idle",
    "users":["uid1","uid2"],
    "messages":["mid1","mid2"]
}

or

status=404
{
   "message":"room not found"
}

Delete Request:

curl --location --request GET 'http://localhost:5000/api/room/delete/:rid'

Delete Response:

status=200
{  "message" : "success" }

or

status=400
{  "message" : "failure" }

Update Request:

curl --location --request POST 'http://localhost:5000/api/room/update/:rid' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name":"Something New",
    "state":"playing"
}'

Update Response:

status=200
{  "message" : "success" }

or

status=400
{  "message" : "failure" }

[CREATE]: Create new variant in /room/:rid and /user/:uid routes

In /room/:rid and /user/:uid routes, accept a query param "short" and if short is true, return a short version of room and user data.

Short version of getUser request:

curl --location --request GET 'http://localhost:5000/api/user/:uid?short=true'

Short version of getUser respnse :

{
  uid
  name
  username
  status
  avatar_url
}

Short version of getRoom request:

curl --location --request GET 'http://localhost:5000/api/room/:rid?short=true'

Short version of getRoom respnse :

{
  rid
  name
  image_url
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.