projects

Vietnam Health Literacy

2021 - 2022


Sponsored by the US Department of State, and guided by a team of experienced medical professionals, Vietnam Health Literacy is a non-profit project with a crucial mission: to provide accessible, trustworthy, and science-backed health information to the community.

Homepage
Content Page
Topic Page
Series Page

An overview of the Vietnam Health Literacy website

At the age of 20, I joined the project with a mission to turn their vision into a digital reality as a sole developer.

My mission was clear: to build a website that was not only informative but also engaging and visually appealing.

Square 1
Square 2
Square 3
Square 4
Square 5
Square 6

Bringing the Designs to Life

Our designer crafted beautiful prototypes with intricate animations. Turning these designs into a smooth web experience was a challenge I enjoyed tackling.

Using React and Framer Motion, I carefully implemented each animation, ensuring a smooth and engaging user experience.

Prototypes to Action

Accessible, on any device

It's crucial to ensure that a website looks good and works well on all these different screen sizes.

Vietnam Health Literacy was designed with this in mind. We made sure that the website is responsive, meaning it adapts to different screen sizes to provide a consistent and enjoyable experience for everyone.

Responsiveness on tabletResponsiveness on tabletResponsiveness on tablet

Ensuring seamless accessibility

A Foundation for Flexibility & Performance

While WordPress served as the project's content management system, a traditional WordPress theme wouldn't provide the flexibility and performance needed for our website.

Instead, I opted for a JAMStack approach, utilizing Gatsby as the frontend framework and connecting to WordPress via GraphQL. This allowed for seamless content management while maintaining the high level of customization.

Architecture

This approach offers several benefits:

Slow loading times can frustrate users and negatively impact search engine rankings. To ensure a blazing-fast experience, I have utilized these optimization techniques:

The toggle sidebar component is only loaded when needed.

Gatsby also provides built-in support for several optimization techniques, which I leveraged:

BlurHash

A blurred placeholder is displayed while waiting for an image to load, with a smooth transition.

These efforts resulted in a Lighthouse performance score of over 90, ensuring a smooth and enjoyable user experience.

Homepage
Content Page

Not too bad, isn't it?

Optimizing for Impatience

While static site generation offers numerous advantages, it also presents a challenge: how to efficiently update the website when content changes occur in WordPress. Rebuilding the entire site for every small change (like a small typo fix) would be slow, and inefficient. Frankly quite frustrating for everyone involved.

To address this, I harnessed the power of Turborepo and Cloudflare Pages, creating a streamlined deployment process that minimizes wait times (and maximizes our happiness - oh yeah!).

Here's how it works:

  1. The "Deploy" Button: I added a "Deploy" button within a custom WordPress plugin I developed for the CMS team. This button empowers them to initiate a re-deployment of the Gatsby site whenever content changes are made and ready to be published. This process offers several advantages: - Batched Updates: Changes can be accumulated and deployed in batches, reducing deployment frequency. - Version Control: The static nature of the site allows for easy rollback to previous versions if needed.
The flow of the Deploy button
  1. Turborepo:: This tool intelligently optimizing builds and caching dependencies. It has a cache system that stores all the build stuff, so everything runs quickly on our local and even in the cloud.

  2. Pre-push Hook: Before any code makes its way into the remote Git repository, a pre-push hook triggers a full turbo run build. This serves two crucial purposes: _ Final Sanity Check: A final double-check that making sure everything builds smoothly before we send it off to be deployed. _ Populate the Turborepo Cache: More importantly, it fills up the Turborepo cache, uploading all the built artifacts to the remote cache server. Everyone’s got everything they need.

  3. Cloudflare Pages: Now, when the code finally reaches Cloudflare Pages, Cloudflare uses Turborepo’s remote cache, so instead of rebuilding everything from scratch, it just grabs the pre-built stuff lightning fast. This is the thing that makes we happy.

Deploy with Remote Cache

The result? Deployments that are drastically faster, with a reduced risk of build errors.

Moreover, this optimized process also contributes to a smaller carbon footprint, as we're minimizing unnecessary rebuilds and resource consumption.

Keep things tidy

...and efficient, that's why I've chosen a monorepo as the best way to go. All the code for the website, the WordPress plugin, and shared components live together in a single repository.

Monorepo

This approach promotes several benefits:

Monorepo

Under the Hood

Talked enough about the fancy stuff, here's a closer look as the stack I assembled:

Monorepo

Frontend:

Backend & Infrastructure:

Programming Languages:

Empowering Communities

From architecting the website's infrastructure to optimizing its performance and crafting engaging animations, I strived to create a platform that is not only visually appealing but also informative, accessible, and easy to use.

It's incredibly rewarding to know that my work is playing a part in empowering the Vietnamese community with access to vital health information, allowing me to contribute to a meaningful cause while pushing the boundaries of my technical expertise.