joeplaa-com / joeplaa-blog

MDX blog site build with Gatbsy.js and styled with Bootstrap.
MIT License
0 stars 0 forks source link
blog bootstrap4 gatsby gatsby-blog gatsbyjs mdx mdx-gatsby reactjs scss static-site typescript

Readme

0 Demo

https://demo-blog.joeplaa.com

1 Project description

The aim of this project is to build a fast staticly hosted, client-side blog. It should get a near perfect Google Lighthouse score to have the best chance of ranking high in the Google search results. This is achieved by building the site in Gatsby.js.

lighthouse score blog.joeplaa.com

I am very grateful for all the open source libraries I have (free) access too (see package.json). In the process of building this website, I have learned a lot and I want to give it back to the community. Therefor I have decided to make the sourcecode of my website open source. Use it, modify it, improve it, learn from it. As long as you remove my content first, I'm happy to share it with you.

1.1 Main libraries

1.2 Styling

1.3 Optimization

1.4 Development

1.5 Sources

This website would not have been possible without other peoples help. These are some of the sources I used to understand and build this site:

2. Development

3. Testing

3.1 ESlint checking

To check for ESlint errors and warnings in your codebase run:

  yarn eslint "./<folder>"

or

  npm eslint "./<folder>"

Note 1: The quotation marks are only needed on a Windows machine.

Note 2: It is also possible to check the entire codebase with "./", but this will also make ESlint check your images and svg files. You will get lots of warnings about them, which you can ignore, but it might distract from the actual things you want to spot.

3.2 Type checking

To check for TypeScript errors and warnings in your codebase run:

  yarn types

or

  npm types

3.3 Unit testing (to be implemented)

Run all tests run:

  yarn test

or

  npm test

3.4 Build test

Build your site to be sure there are no hidden errors left:

  yarn build

or

  npm build

4. Deployment

Deployment is pretty straight-forward if you know what to do. But figuring out how to deploy a site to a specific platform is always a hassle. I host a test version on a private server in Nginx. My production site is hosted in AWS CloudFront. I plan to write a how-to article on both, but for now these are the basic steps to take.

These steps are probably not enough to get it all running. I will undoubtly forget to mention some crucial steps, so for now this is for those people who know how to work with a shell in Ubuntu and are familiar with the AWS environment.

4.1 Nginx

4.2 AWS

4.2.1 AWS CLI

4.2.2 Prepare Website deploy

4.2.3 Deploy website