Joystream / youtube-synch

YouTube Synchronization
11 stars 10 forks source link

YPP backend #40

Closed zeeshanakram3 closed 2 years ago

zeeshanakram3 commented 2 years ago

implements

YoutubeSync

Required Stack

Enter localhost:3001/docs to view all api endpoints and their descriptions

For user verification flow only two endpoints are needed

/users/verify

/users/verify-and-save

Running the app

  1. Install dependencies yarn

  2. Deploy all the necessary infrastructure

    cd packages/infrastructue
    ./deploy.sh

    This script deploys the relevant dynamoDB tables for needed for the verifications flow.

  3. Start the YPP backend server yarn nx run api:serve

This will start the YPP backend service at localhost:3001

  1. Start the frontend app yarn nx run app:serve

Open the browser window at localhost:4200 to interact with the app. Click VERIFY YOUR YOUTUBE CHANNEL button to start the verification flow. If verification is successful the YPP will respond back with email and userId of the verified user. (See response type for /users/verify endpoint at localhost:3001/docs).

After that the frontend app need to prepare the request for save the verified channel to the YPP backend state. There is no UI for that so, you can use any api client(e.g. Postman) for making request to users/verify-and-save with provided values of userId, joystreamChannelId, email, and optional referrerId

zeeshanakram3 commented 2 years ago

I would suggest error format along those lines: ...

Addressed error changes as suggested in the review

When I query /users/{userId}/videos I get 500 server error

Fixed

When I query /channels/{id}, what is the ID that should be passed here? Seems whatever I pass (I tried user ID, joystream channel ID) I get back

Fixed. You should pass the Joystream ChannelId as parameter. I have updated the description

When I query/users I get 500 server error

Fixed

kdembler commented 2 years ago

Also noticed that if I call verify (I will get my YT email back) and then call verify-and-save with different email, the different email is not saved and my user still has the YT email attached when I query /users

zeeshanakram3 commented 2 years ago

The API still fails to start if it fails to connect to RPC endpoint

Addressed. Now API won't crash on Node version > 14

Also noticed that if I call verify (I will get my YT email back) and then call verify-and-save with different email, the different email is not saved and my user still has the YT email attached when I query /users

Fixed.

zeeshanakram3 commented 2 years ago

Seems this wasn't resolved? I still see the same behavior

Sorry, there was an issue in the previous fix. Now resolved

We discussed changing the endpoints 👇 Did you decide to skip this after all?

Overlooked that before. Now resolved, now verify-and-save is POST to /channels