The portfolio website for Nathan David McWilliams (https://www.ndm.studio).
Happy to open this up as a reference! Feel free to use any of the React components or Next.js code for your own website.
Here are some of the tools and frameworks used in this project:
- React - Frontend library for the UI.
- Next.js - React framework for Static Site Generation.
- Typescript - For more maintainable code.
- Normalize - Long live the king.
- Jest - For unit tests and React component tests.
- Playwright - For awesome cross-browser, end-to-end tests.
Requirements for building this project locally:
- Node (NVM recommended).
If using NVM, you can run nvm install or nvm use in the project root
directory to switch to the recommended node version.
- Get started with
npm installin the project root directory. - Optionally create a
.env.localfile and specify local environment values for any of the keys in.env. npm run devto start the server.- Visit localhost:3000 in the browser.
Creating an .env.local file is optional, but it allows customizing some behaviors of the app and enabling certain third-party integrations.
To get started, create a new file named .env.local at the root of the project directory. This file is part of .gitignore so it won't be checked in.
You can override the PINO_LOG_LEVEL to get more or less verbose application logs.
Without an env.local file, you'll see an error message about NEXT_PUBLIC_NEWSLETTER_FORM_ID not being set. This is ok, but it means trying to sign up for the newsletter will always throw an error.
To set this value, go to the ConvertKit website and grab the id of a form for testing:
- In the site menu, go to "Landing Page & Forms".
- Click the name of the form to use for testing (or create a new one).
- Click "Publish".
- Select the "HTML" tab, and find the 7-digit id within the
actionattribute of theformelement. For example, in<form action="https://app.convertkit.com/forms/1234567/subscriptions ...", the id is1234567.
Use this id to set the value for NEXT_PUBLIC_NEWSLETTER_FORM_ID in the .env.local file.
Look at any of the other keys in the .env file, and override them in .env.local as necessary.
npm testfor unit tests.npm run test:e2efor playwright tests, after starting the local server.
Some other recommended resources:
- I use Visual Studio Code for my code editor, with
editorconfig,prettier,eslint,stylelint,jestandplaywrightextensions.
All content, music and images copyright Nathan David McWilliams and respective rights-holders. See License.md for more info.