This project was built using the Gatsby Framework and Github Pages. You can see the live page at the next link: https://ldiego73.github.io.
I shared the code of my website with the goal of which is a guide for those who are looking to have your website quickly and easily.
Yes, you can fork this repository. Please give me the proper credit by linking to https://ldiego73.github.io. Thank you!
- Getting started
- Start your project
- Build and running your project
- Testing your project
- Deploy on Github Pages
- Architecture
- Project structure
- FAQ
Change the values of the .env
file for yours
environment | description |
---|---|
GATSBY_RECAPTCHA_KEY | Key generated by google recaptcha |
GATSBY_GITHUB_USER | Your Github User ID |
GATSBY_GETFORM_URL | URL generated when creating your form at https://getform.io/ |
GATSBY_LANGUAGE_DEFAULT | The default language of your site. Example: en |
GATSBY_LANGUAGE_VERSION | Allows you to update the language resources stored in the localstorage . Example: v1.0 |
Inside the static/locales
path you can update your site information.
locale resource | description |
---|---|
educations.json | Contains an array of the places where you studied. * |
experiences.json | Contains an array of the places where you worked until today. * |
personal.skills.json | List of your personal skills * |
technical.skills.json | List of your technical skills * |
translation.json | Contains the website information |
(*) I recommend not exceeding 5 records.
This information is located int the path src/data/social_networks.json
Example:
{
"url": "https://github.com/<USERNAME>",
"name": "Github",
"icon": "fab fa-github"
}
value | description |
---|---|
url | The redirect url to social network |
name | The title the your link |
icon | The icon associated with your social network. Icons are based on https://fontawesome.com/ |
You can freely add or remove the social networks you want to show.
In order to correctly generate the sitemap.xml and robots.txt files you must ensure that the URL is public.
Inside the gatsby-config.js
file you should change the next values:
title: `<TITLE YOUR PAGE>`,
description: `<DESCRIPTION YOUR PAGE>`,
author: `<YOUR NAME OR NICKNAME>`,
siteUrl: `<SITE PUBLIC URL>`
After making the lines mentioned above configurations, execute the following command
yarn develop
Don't forget to previously install the dependencies
yarn install
Generate your public folder.
yarn build
preview your site before being published
yarn serve
This project has a coverage of 90% to do this Unit Test and E2E Test was implemented.
Unit tests have been built using Jest to run them use the next command:
yarn test:unit
The unit test generates two files in the next path reports/test
1. result.html
This report was generated using the jest-html-reporters
dependency.
Details of the name, path configuration can be found in the file jest.config.js
.
You can see the result inside the reports/test/result.html
path
2. result.xml
This report is generated in order to upload the results in sonar cloud. The jest-sonar-reporter
dependency has been used to generate the report.
Details of the name, path configuration can be found in the file package.json
.
You can see the result inside the reports/test/result.xml
path.
If you want to remove this report when running the test, perform the next steps:
- Remove this configuration into the
package.json
"jestSonar": {
"reportPath": "reports/test",
"reportFile": "result.xml",
"indent": 4
}
- Remove execution after running unit tests into the
package.json
"posttest:unit": "node jest-sonar",
- Remove the file
jest-sonar.js
- Remove the dependency
jest-sonar-reporter
yarn remove jest-sonar-reporter
For e2e tests cypress was used
Using visual testing:
yarn test:e2e
Using with CI:
yarn test:e2e:ci
The unit test generates four results in the next path reports/e2e
1. results
XML files with the result of each test.
2. screenshots
Contains the images of the tests that were unsuccessful.
3. videos
List of videos in mp4 of the test execution.
4. result.html
The next dependencies were used to generate the report:
yarn add -D mochawesome mochawesome-merge mochawesome-report-generator
Details of the path configuration can be found in the file cypress.json
.
You can see the result inside the reports/e2e/result.html
path
- Create <username>.github.io repository
- Run
yarn build
in your directory - Upload the folder
public
into repository. - Open <username>.github.io in the browser
In the workflows
folder you will find the script to make the CD (Continuos deployment).
You can configure if you want to add or remove some steps.
For example you can skip the step of sonar cloud and coveralls if you don't need it.
- Remove the step
Code Quality
- Remove the step
Coverage
More details of use and documentation can visit the help of github actions (https://help.github.com/es/actions)
The architecture of the project is based on two important aspects:
This project is structured by the next components.
βββ__mocks__
βββ cypress
β βββ e2e
β βββ fixtures
β βββ plugins
β βββ support
βββ src
β βββ components
β β βββ footer
β β βββ header
β β βββ repository
β β βββ skills
β β βββ timeline
β β βββ top-button
β β βββ seo.js
β βββ context
β β βββ translation.context.js
β β βββ translation.provider.js
β βββ data
β β βββ social_networks.json
β βββ hooks
β β βββ use-fetch.js
β β βββ use-hover.js
β βββ images
β βββ layouts
β β βββ main.js
β βββ pages
β β βββ 404.js
β β βββ index.js
β βββ screens
β β βββ home
β β β βββ components
β β β βββ index.js
β β βββ not-found
β β β βββ index.js
β βββ styles
β β βββ componentes
β β βββ pages
β β βββ _variables.scss
β β βββ theme.scss
β βββ utils
β β βββ browser.js
β β βββ i18n.js
βββ test
β βββ components
β βββ context
β βββ hooks
β βββ layouts
β βββ pages
β βββ screens
β βββ utils
The color palette is in the next path: src/styles/_variables.scss
The colors are:
Color | Hex |
---|---|
$primary | #252526 |
$secondary | #1e1e1e |
$tertiary | #0a0a0a |
$quaternary | #468fc2 |
$color | #cccccc |
$color-error | #b71c1c |
- Change the file
icon.png
in the src/images folder. - Change the file
icon.png
in the images folder.
- Use a CMS for content management. By example https://www.sanity.io
- Add more templates, pages or improve existing.
- Add additionals tests.
- Unify files within
data
intostatic/locales
files. - Other improvements.