Virufy is a nonprofit research organization developing artificial intelligence (AI) technology to screen for COVID-19 from cough patterns, rapidly and at no cost through use of a smartphone. To learn more or get involved, visit our website.
By default, Next.js uses Node to run applications. Github Pages on the other hand, does not support Node and is designed to host only static HTML pages and assets. Therefore, the Next.js app needed to be statically exported, but that came with its own challenges.
Static exports does not support internationalized routing with Pages Router.
Static exports does not support image optimization at build time.
next/image
can be used with static export, it required using a custom image loader and a service like Cloudinary to optimize images. We wanted to keep the project simple and not have to rely on another third party service unless we had to.Install all dependencies.
npm i
Start the development server
npm run dev
Open http://localhost:3000/en with your browser to see the home page.
To simulate a production build locally, run the following:
npm run build
Note: Before pushing any changes, I recommend building the app locally to make sure it passes without errors. Pushing changes and solely relying on the deployment process to catch build errors can use up limited cloud resources provided by Netlify's free plan. Plus, building locally first can promote green software development practices.
When a PR is made against the production branch, main
, a Netlify deploy preview is generated to display the PR changes on the website.
Once the PR is merged, a deploy to Github Pages is auto-triggered.
Note: To properly view the preview site, append the locale /en
to the deploy preview url provided by Netlify.