ucsb-cs156-m23 / proj-happycows-m23-10am-4

https://ucsb-cs156-m23.github.io/proj-happycows-m23-10am-4/
0 stars 1 forks source link

Create a demo play page for visitors #89

Closed yuanchenmeng closed 1 year ago

yuanchenmeng commented 1 year ago

Overview

In this PR, I created a demo play page located at /demo/play for visitors and front end developers for developing purpose. Static dummy data from UserHomeDummy.json is used to fill the content. The demo page only displays static texts so that the front end developers can focus on UI design only without the need to be concerned about security and back end. This PR lays the groundwork for implementing pagination functionality and better UI in the future.

Minor fix

Discussion - Security Concerns

URL end point '/demo/play' is open to public without protection of Google OAuth. If dokku doens't have rate limiting protection, it may be vulnerable to DDoS attacks. I wonder whether it's a secured approach. If it is unsecured, we can use it as a dev branch instead of a production branch.

Screenshots

image

Tests

Frontend Coverage & Mutation: 100%

Linked Issues

Closes #88 Mid part of #6

pconrad commented 1 year ago

Due to the security concerns, it would be nice if the route is conditionally tied to the env.PRODUCTION variable, that way it will not be accessible on production builds.

Agreed with @iain801 about the security points. If we go forward, we should make this conditional on profile; see these lines for examples of how to do that in the backend:

For the frontend, you'd need to expose something through the systemInfo controller about the current profile.

But what I wonder is this: how is this different from using the existing Storybook and Swagger tools? It seems like it introduces extra complexity, and I'm not sure whether what we get for the developer is worth the extra complexity.

Can you help me better understand the use case for this?

yuanchenmeng commented 1 year ago

Thank you for your valuable feedback. Due to security concerns, I decide to close this PR and this branch will be used as my personal dev branch. I'll bring minor fix in this PR to the PR related to paginated profit table. Regarding my approach, I prefer to use browser development tools initially, working with static content, when designing components from scratch. Additionally, in my opinion, when working on designing components, avoiding unnecessary detours, such as configuring OAuth locally and creating additional Storybook pages, maintains a direct and efficient workflow.