Git Product home page Git Product logo

website-frontend's Introduction

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, copy the env file:

cp dev.env .env

Then run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

website-frontend's People

Contributors

apexearth avatar franckc avatar hrikb avatar micahalcorn avatar nick avatar nickick avatar rolandpo avatar shahthepro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

website-frontend's Issues

Mobile spacing

There are several places where the layout is problematic on small screens. Here are a couple of examples:

image

image

Handle rectangular team avatars

If I upload a headshot that isn't a square, it will get distorted when displayed on the community page. We probably don't want to crop the images on upload to the media library, but we should be able to constrain them to squares when rendered.

Set security headers on marketing sites

I'm not aware of any vulnerability. But as good security hygiene we should set security headers on the HTTP responses returned by all our marketing sites (originprotocol.com; ousd.com; story.xyz).
I took a quick inventory by manually inspecting the responses we are currently returning and also by using one of the many tools returned when googling "security header scanner".

Here are my suggestions.

  1. strict-transport-security
    See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
    => Let's set: strict-transport-security: max-age=31536000; includeSubdomains

  2. x-xss-protection
    See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
    => Let's set: x-xss-protection: 1; mode=block

  3. Cross-Origin-Opener-Policy
    See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy
    => Let's set: cross-origin-opener-policy-report-only: same-origin-allow-popups

  4. X-Content-Type-Options: nosniff
    See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
    => Let's set: X-Content-Type-Options: nosniff

  5. Referrer policy
    See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
    => No action needed. The default is strict-origin-when-cross-origin which I think should be fine.

  6. Content-Security-Policy
    See https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
    That one is complicated. Our sites do load some data, img assets and scripts from 3rd party sites. We could take an inventory and add all of them but I'm not positive it's the best way to go. I'd be interested in feedback from our team on what CSP we should use.

  • On originprotocol.com we load:
  • On ousd.com we load:
    • Json data from api.coingecko.com
    • JSON data from api.originprotocol.com
    • JSON data from analytics.ousd.com
    • Img assets from cmsmediaproduction.s3.amazonaws.com
  • On story.xyz
    • img.youtube.com

Implement sitemap.xml

We added sitemap support to Strapi in this PR
We now need to integrate the client with it to pull the list of dynamic URLs + add the static pages and finally generate the sitemap.xml

NavLink order ignored

Unless I'm misunderstanding the role of the order field here, I don't think it's working as intended. I set Origin Ether to position 2 and Origin Story to position 3. But Story was still displayed above Ether until I used the drag feature to literally move it up higher inside the CMS.

Screenshot 2023-05-15 at 4 31 40 PM

Social preview images

When a blog page is linked from Facebook, Twitter, Discord, etc, the preview image should be populated with the primary image at the top of the blog post. Compare these two tweets; the first involves a Medium link and the second involves our blog:

Screen Shot 2022-10-31 at 8 57 54 AM

Prevent iFraming

We should not allow any of our new marketing sites to get embedded as an iframe:

  • originprotocol.com
  • ousd.com
  • story.xyz

Let's disallow that by adding the proper headers:

X-Frame-Options: DENY
Content-Security-Policy: frame-ancestors 'none'

Page flickering

When I first get to any page on the site, there is some flickering. Like the raw content shows up but not properly formatted/styled. Then after like a half second the styling/formatting gets applied.

@nickick mentioned: "The loading flicker is probably related to how the storybook components are being rendered serverside"

@shahthepro mentioned: "The flickering could also be because the stylesheets are loaded a bit late while the DOM structure is already in place (due to SSR)"

URI scheme for legacy content and localization

Non-CMS pages

Legacy URLs

New URLs

  • /company -> english version
  • /en/company -> /company
  • /<locale>/company -> /company (for v1 until we localize, then support localized content in v2)

CMS pages

  • For v1
    • /article/
  • For v2 (after the launch)
    • /article/<locale>/
      • We'll have to do a lookup to get the <locale> article based on the english slug
    • Assuming the translated articles are tied to the original

Press kit cleanup

Let's vertically align the text on each of these cards. Due to the varying text length, there is currently some excess space above "Origin Logo" on the first card. The headings and the descriptions should all be pinned to the top of the card while the Download links should be pinned to the bottom. Basically, we want space between instead of space before the content.

The text is also quite redundant. The headings almost exactly match the images and the text below them. Each description starts with the word "Download" and then is followed by a "Download" link. How about losing the headings entirely and then either replacing the download links with a visual icon or making the descriptions sentence fragments without the word (e.g. "The Origin Protocol logo")?

Screen Shot 2022-12-05 at 2 32 24 PM

Clickable news cards

Make this entire card clickable so that the user doesn't have to find the "Read more" link.

Screen Shot 2022-10-31 at 6 15 30 AM

Canonicalize URLs

The originprotocol.com google indexing issue report shows a significant numbers of URLs having duplicate content and this is impacting our SEO score.

One of the largest category is URLs with parameters. Here are a few examples:

It is unclear why google attempts to index those in the first place. Most likely there are external sites hosting those links.

We are not using URL parameters on the new site. So let's canonicalize all URLs by stripping any parameters and then redirect to the canonicalized version. For example:

SEO optimizations

Issues with the highest impact on SEO ranking:

User-Agent: *
Allow: /

More detailed feedback in this doc.

Article page: HTML content sanitization

We are using CKEditor to create HTML content on Strapi.
The client then pulls it and displays it on the site using __dangerouslyInsetHTML.

There is a potential risk of an XSS in case one of the CMS admin user account getting hacked then the hacker could insert a malicious script in the content.

To guard against this, the client should sanitize the HTML we get from Strapi to only allow a whitelist of HTML tags.

Support AVIF image format as an option

To improve both site load performance and SEO score we should add AVIF support. This is relevant for all our marketing sites:

  • originprotocol.com
  • ousd.com
  • story.xyz

Notes:

  • Some browsers do not support AVIF so we should provide a fallback like jpeg.
    Here is an article with an example of how to use the tag for that purpose.
  • One complication comes from images uploaded via the CMS. We would need to modify the CMS to be able to provide 2 formats for an image (AVIF and jpg). Or use a service that does image conversion on the fly. For example CloudFlare image or https://imgix.com/

OETH announcement banner

Add a banner to the main website pointing to OETH.com but keep it wired off or unmerged until we're ready to make the public announcement (mockup in progress).

Pull team + investor + advisor data from Strapi

As opposed to hardcoding this data in the client, we should pull it from Strapi.
That would make it easier to update and also would avoid having to hardcode it on the 3 different clients (originprotocol.com, story.xyz, ousd.com)

https://staging-next.originprotocol.com/api/circulating-ogn returning 500

Reproduction:

I checked the Next.js server logs
heroku logs -a origin-website-staging -t
and saw these errors:

2022-10-13T01:30:18.463621+00:00 heroku[router]: at=info method=GET path="/api/circulating-ogn" host=staging-next.originprotocol.com request_id=8d928c87-9f52-4d5b-a730-699cff09f604 fwd="157.22.72.154,172.71.158.64" dyno=web.1 connect=0ms service=1ms status=500 bytes=165 protocol=https
2022-10-13T01:30:18.460223+00:00 app[web.1]: TypeError: Only absolute URLs are supported

I thought perhaps it was because NEXT_PUBLIC_STATS_ENDPOINT was set to staging-api.originprotocol.com (note the missing https://) so I tried to change it to https://staging-api.originprotocol.com but that did not fix.

Inconsistent blog preview images

I'm not sure if this is a CMS delay or what, but we're seeing different images for the same posts between / and /company. A hard refresh does not resolve it.

Screen Shot 2022-10-25 at 7 53 55 AM

Screen Shot 2022-10-25 at 7 54 04 AM

Google analytics

P0: Have tags on every pages to track the traffic to each of them.

P1 (not blocking for launch): track specific actions (for ex. click on buttons). We'll want marketing to provide a list of actions they'd like to track.

Article page: missing bullet points styling from a copy/paste of a gdoc

I created this article in the CMS: https://origin-cms-staging.herokuapp.com/admin/content-manager/collectionType/api::blog.website-post/6?plugins[i18n][locale]=en

For the body Rich Text content, I did a copy/paste from this gdoc: https://docs.google.com/document/d/1LSk8T7meVbZxSQsVYkAKiDuc2VoiQU_vqaMgBsLa5a4/edit

The bullet points show up correctly in the CMS CKEditor, but not on the article's page on the site:
https://origin-website-staging.herokuapp.com/blog/website-post-3

Press kit

We need to update the graphics in the press kit to be the correct ones and include higher-resolution versions in the download. We're currently blocked on this until we can agree on which versions to use.

Blog post with no author causes front-end crash

If an article is created in the Strapi CMS without an author being set on it, it causes the front-end page displaying the article to crash.

The Next.js error logs show the following:

2022-10-21T05:36:09.054111+00:00 app[web.1]: TypeError: Cannot read properties of null (reading 'avatar')
2022-10-21T05:36:09.054136+00:00 app[web.1]: at Article (/app/.next/server/pages/[slug].js:265:78)

The client should be more resilient and if no author is set it should still display the content.

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.