1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 09:13:19 +01:00
👔 Portfolio thingy, built with Gatsby https://matthiaskretschmann.com
Go to file
dependabot[bot] 217fe7a38b
Bump @testing-library/react from 13.0.0 to 13.1.1 (#874)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 13.0.0 to 13.1.1.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v13.0.0...v13.1.1)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-20 16:22:07 +01:00
.github package updates 2021-11-28 16:12:27 +00:00
content service worker update notification 2021-09-19 16:22:05 +02:00
scripts Migrate to Framer Motion (#656) 2021-09-11 21:37:38 +02:00
src remove shortid dependency 2022-02-12 13:58:11 +00:00
static fetch matomo.js on build time 2021-03-13 22:50:00 +01:00
tests package updates 2022-02-12 13:51:58 +00:00
.dockerignore kick out Travis 2019-11-26 02:37:57 +01:00
.env.example move to kremalicious/location endpoint 2021-12-03 00:57:26 +00:00
.eslintrc package updates 2021-05-23 12:35:54 +02:00
.gitignore bump Gatsby packages 2022-01-24 19:33:16 +00:00
.prettierrc migrate to File System API 2020-11-20 22:36:55 +00:00
.stylelintrc simplify stylelint/prettier setup 2020-03-22 00:27:33 +01:00
docker-compose.yml new icons 2019-11-12 22:25:05 +01:00
Dockerfile Docker dev image fixes 2019-06-09 21:04:30 +02:00
gatsby-browser.js service worker update notification 2021-09-19 16:22:05 +02:00
gatsby-config.js package updates 2022-02-12 13:51:58 +00:00
gatsby-node.js Migrate to Framer Motion (#656) 2021-09-11 21:37:38 +02:00
gatsby-ssr.js remove AppProvider, replace with hooks 2019-11-11 23:54:07 +01:00
LICENSE documentation, switch to Travis 2018-05-14 01:51:47 +02:00
package-lock.json Bump @testing-library/react from 13.0.0 to 13.1.1 (#874) 2022-04-20 16:22:07 +01:00
package.json Bump @testing-library/react from 13.0.0 to 13.1.1 (#874) 2022-04-20 16:22:07 +01:00
README.md move to kremalicious/location endpoint 2021-12-03 00:57:26 +00:00

👔 Portfolio thingy, built with Gatsby.

matthiaskretschmann.com


🎉 Features

The whole portfolio is a React-based single page app built with Gatsby v3.

Most metadata is powered by one resume.json file based on 🗂 JSON Resume, and one projects.yml file to define the displayed projects.

💍 One data file to rule all pages

All displayed project content is powered by one YAML file where all the portfolio's projects are defined. The project description itself is transformed from Markdown written inside the YAML file into HTML on build time.

Gatsby automatically creates pages from each item in that file utilizing the {ProjectsYaml.slug}.jsx template.

🗂 JSON Resume

Most site metadata and social profiles are defined in content/resume.json based on the JSON Resume standard and used throughout the site as a custom React hook. Additionally, a resume page is created under /resume.

If you want to know how, have a look at the respective components:

🐱 GitHub repositories

The open source section at the bottom of the front page shows selected GitHub repositories, sourced from GitHub.

On build time, all my public repositories are fetched from GitHub, then filtered against the ones defined in content/repos.yml, sorted by the last push date, and provided via the pageContext of the front page.

If you want to know how, have a look at the respective components:

📍 Location

On client-side, my current and, if known, my next physical location on a city level is fetched from my (private) nomadlist.com profile and displayed in the header.

Fetching is split up into a serverless function, a hook, and display component. Fetching is done with a serverless function as to not expose the whole profile response into the browser.

If you want to know how, have a look at the respective components:

💅 Theme switcher

Includes a theme switcher which allows user to toggle between a light and a dark theme. Switching between them also happens automatically based on user's system preferences.

If you want to know how, have a look at the respective components:

🏆 SEO component

Includes a SEO component which automatically switches all required meta tags for search engines, Twitter Cards, and Facebook OpenGraph tags based on the browsed route/page.

If you want to know how, have a look at the respective component:

📇 Client-side vCard creation

The Add to addressbook link in the footer automatically creates a downloadable vCard file on the client-side, based on data defined in content/meta.yml.

If you want to know how, have a look at the respective component:

💫 Page transitions

Includes mechanism for transitioning between route changes with full page transitions defined with Framer Motion.

If you want to know how, have a look at the respective components:

📈 Matomo (formerly Piwik) analytics tracking

Site sends usage statistics to my own Matomo installation. To make this work in Gatsby, I created and open sourced a plugin, gatsby-plugin-matomo, which is in use on this site.

🖼 Project images

All project images live under content/images and are automatically attached to each project based on the inclusion of the project's slug in their filenames.

All project images make use of the excellent gatsby-plugin-image plugin, working in tandem with gatsby-plugin-sharp and gatsby-transformer-sharp.

All together, Gatsby automatically generates all required image sizes for delivering responsible, responsive images to visitors, including lazy loading of all images. Also includes the intersection-observer polyfill to make lazy loading work properly in Safari.

All project images use one single component where one main GraphQL query fragment is defined, which then gets used throughout other GraphQL queries.

💎 Importing SVG assets

All SVG assets under src/images/ will be converted to React components with the help of gatsby-plugin-svgr. Makes use of SVGR so SVG assets can be imported like so:

import { ReactComponent as Logo } from './components/svg/Logo'

return <Logo />

🍬 Typekit component

Includes a component for adding the Typekit snippet.

If you want to know how, have a look at the respective component:

Development

You can simply use Docker & Docker Compose or install and run dependencies on your local system.

git clone git@github.com:kremalicious/portfolio.git
cd portfolio/

# GATSBY_GITHUB_TOKEN is required for some parts
# See https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
cp .env.sample .env
vi .env

# use Docker
docker-compose up

# or go with local system
npm i
npm start

🔮 Linting

ESlint, Prettier, and Stylelint are setup for all linting purposes:

npm run lint

To automatically format all code files:

npm run format
npm run format:css

👩‍🔬 Testing

Test suite is setup with Jest and react-testing-library.

To run all tests, including all linting tests:

npm test

Most test files live beside the respective component. Testing setup, fixtures, and mocks can be found in the ./tests/ folder.

🎈 Add a new project

To add a new project, run the following command. This adds a new item to the top of the projects.yml file, creating the title & slug from the argument:

npm run new -- "Hello"

Then continue modifying the new entry in content/projects.yml.

Finally, add as many images as needed with the file name format and put into content/images/:

SLUG-01.png
SLUG-02.png
SLUG-03.png
...

🚚 Deployment

Every branch or Pull Request is automatically deployed by Vercel with their GitHub integration, where the main branch is automatically aliased to matthiaskretschmann.com. A link to a preview deployment will appear under each Pull Request.

A backup deployment is also happening to a S3 bucket, triggered by pushes to main and executed via GitHub Actions. The deploy command simply calls the scripts/deploy-s3.sh script, syncing the contents of the public/ folder to S3:

npm run deploy:s3

Upon live deployment, deploy script also pings search engines. GitHub requires the following environment variables to be setup for successful deployments in the repository secrets:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_DEFAULT_REGION

🏛 Licenses

© Copyright 2019 Matthias Kretschmann

All images and projects are plain ol' copyright, most displayed projects are subject to the copyright of their respective owners.

Don't care if you fork & play with it, but you're not allowed to publish anything from it as a whole without my written permission. Also please be aware, the combination of typography, colors & layout makes up my brand identity. So please don't just clone everything, but rather do a remix!

All the rest, like all code and documentation, is under:

The MIT License

Full MIT license text