Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add learn site API contacts #68

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

rajakvk
Copy link

@rajakvk rajakvk commented Oct 17, 2021

API contract defined based on discussions in standup meetings.

"publishedDate": timestamp,
"likes": number,
"bookmarkedBy": "<userId>",
"bookmarkedDate": timestamp,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will this contain?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swarajpure
publishedDate contains the original article/video published data. This will help us to implement sort feature.
likes contains number of a feed received so far. (This is similar to instagram likes)
bookmarkedBy contains RDS user id who submitted the feed
bookmarkedDate contains date on which RDS user submitted the feed

Please refer below 2 links for further details
https://excalidraw.com/
https://github.com/Real-Dev-Squad/website-learn/wiki

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this complete document for one single user?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This structure is not for any single "user" but it is structure of a "feed". I used the words "feed" and "bookmark" loosely for the same entity. A user might add multiple feed/bookmark but a feed/bookmark must have only one author and only one bookmarkedBy value.

"author": "Name of the author",
"publishedDate": timestamp,
"likes": number,
"bookmarkedBy": "<userId>",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a discussion related to having a different structure right, is it something in pipeline?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed multiple things but not concluded with concrete plan. I guess, @SBagaria2710 might arrange a meeting to finalise how to proceed further.

<feed2>
]
,
"isLast": boolean<yes|no>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really liked the the planning behind this property


| Route | Description |
| :--------------------------------: | :---------------: |
| [GET /feeds](#get-feeds) | Returns all feeds |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about get feeds by ID , If I need to know more about particular feed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GET /bookmark/:id
I used feed and bookmark loosely for same entity. I choose that approach for a reason but it creates more confusion, so will stick to one while revamping after proposed meeting.

```

- **Error Response:**
- **Code:** 500
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

401 missing? Can unauthorised users also proceed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only authorized users can access this end point. Updated.

- **Content:** `<No Content>`

- **Error Response:**
- **Code** 404
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, will this be public route? No cookie/auth required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is open to consume non users also.

learn/README.md Outdated
- **Error Response:**
- **Code:** 500
- **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }`
- **Code:** 409
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please have the error responses sorted by their codes? Becomes easier to look at them, in my opinion

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorted.

- **Error Response:**
- **Code** 404
- **Content** `{ 'statusCode': 404, 'error': 'Not found', 'message': 'No bookmark found' }`
- **Code:** 401
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: sorting by error codes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sharp eye !
Sorted.

Copy link
Contributor

@swarajpure swarajpure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving from my side

Looks very exciting! 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants