Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Frontend:
- Which routes are already set up and what are their paths?
- <PrivateRoute
- exact
- path={'/'}
- component={DashboardRoute}
- />
- <PrivateRoute
- path={'/learn'}
- component={LearningRoute}
- />
- <PublicOnlyRoute
- path={'/register'}
- component={RegistrationRoute}
- />
- <PublicOnlyRoute
- path={'/login'}
- component={LoginRoute}
- />
- <Route
- component={NotFoundRoute}
- />
- What is the concern of the AuthApiService object?
- AuthApiService has postUser (sends user), postLogin(sends username and password) refreshToken(refreshes the token
- keeping user logged in)
- What is the concern of the UserContext?
- json web token cases
- saveAuthToken(token: any)
- getAuthToken()
- clearAuthToken()
- hasAuthToken()
- parseJwt(jwt: any)
- parseAuthToken()
- _getMsUntilExpiry(payload: any)
- queueCallbackBeforeExpiry(callback: any)
- clearCallbackBeforeExpiry()
- If a user is inactive for a sometime the token won't be refreshed and will automatically log them out.
- Does the PrivateRoute make use of the UserContext?
- privateRoute only allows users who are logged in, so it's in the userContext because of the jwt
- What does the /cypress/integration/day-0.1-purpose.spec.js file test?
- tests if the application has a h1 with a title
- Which elements on the page are being checked in and what for?
- the header is being checked for an h1 to contain the title Spaced repitition
- the p expected specific text inside.
- Backend:
- Which database tables are created in the migrations?
- language, user, word
- What are the endpoints for user registration, login and refresh?
- user endpoint: /api/user
- What endpoints have been implemented in the language router?
- language endpoints: /api/language
- get all words for a specific language
- two routes that need to be finished
- What is the async and await syntax for?
- The word “async” before a function means one simple thing: a function always returns a promise.
- Other values are wrapped in a resolved promise automatically.
- The keyword await makes JavaScript wait until that promise settles and returns its result.
- await can only be used inside an async function
- Which endpoints need implementing in the language router?
- /head which is a get request
- /guess which is a post request
- How does the GET /api/language endpoint decide which language to respond with? (Hint: Does it relate to the user that made the request?)
- For all /api/language endpoints a call to the db is made to grab the language the user has based
- on the id of the user. Then the get language words uses a service that will get the words for the specific language
- In the UserService.populateUserWords method, what is db.transaction?
- All queries within a transaction are executed on the same database connection, and run the entire set of queries as
- a single unit of work. Any failure will mean the database will rollback any queries executed on that connection to
- the pre-transaction state.
- What is SERIAL in the create migration files?
- Unique identifier columns, sequential, that is automatically assigned.
- What is setval in the seed file?
- Set sequence's current value/ Reset the sequence object's counter value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement