Code Monkey home page Code Monkey logo

rm3l / rm3l.org Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 11.29 MB

The static website behind my personal blog and portfolio website, running with the JAMStack. Built with Gatsby, and leveraging a headless Ghost CMS running in a Kubernetes cluster.

Home Page: https://rm3l.org

License: MIT License

JavaScript 84.64% CSS 15.36%
blog ghost-blog ghost-cms ghost gatsby gatsby-blog gatsbyjs graphql react reactjs masonry-js portfolio-website portfolio-site portfolio javascript personal-website personal-blog netlify cypress kubernetes

rm3l.org's Introduction

rm3l.org

The static website behind rm3l.org, hosted with Netlify, built with Gatsby, and leveraging a headless Ghost Content Management System (CMS) running in a Kubernetes cluster

⚠️ Archived! See this repo for the latest version of this website.

CI Status   Code Analysis   Security Status   Netlify Status

demo

Read more about this migration journey in this blog post.

🛠 Tech Stack

🛠 Installation & Set Up

  1. Clone the repo

    git clone https://github.com/rm3l/rm3l.org my-jamstack-site && cd my-jamstack-site
  2. Install and use the correct version of Node using NVM

    nvm install
  3. Install the Gatsby CLI

    npm install -g gatsby-cli
  4. Install YARN package manager

Follow the instructions here: https://legacy.yarnpkg.com/en/docs/install

  1. Install the project dependencies

    yarn
  2. Set up environment variables and customize the project

Copy the .env.template as a .env file in the repo and customize it accordingly:

GHOST_API_URL=https://my.healdless.ghost.entrypoint
GHOST_CONTENT_API_KEY=my-ghost-blog-content-key
CYPRESS_PROJECT_ID=my-cypress-project-id
CYPRESS_RECORD_KEY=my-cypress-record-key
CONTACT_FORM_ENDPOINT=my-contact-form-endpoint
  • GHOST_API_URL : the URL to the headless Ghost blog
  • GHOST_CONTENT_API_KEY : the Ghost Content API Key, which allows to pull data from a Ghost CMS
  • CYPRESS_PROJECT_ID : the Cypress project Identifier
  • CYPRESS_RECORD_KEY : the Cypress project record key, to use in a Cypress online dashboard
  • CONTACT_FORM_ENDPOINT : the endpoint to call in the contact form

On build servers (CircleCI and Netlify), those are just defined as project-wide environment variables.

  1. Change the site configuration

Edit the src/utils/siteConfig.js file accordingly.

  1. Start the development server

    gatsby develop

Gatsby develop uses the development config in .ghost.json.

🚀 Building and Running for Production

  1. Generate a full static production build

     # Run a production build, locally
     gatsby build
  2. Preview the site as it will appear once deployed

    # Serve a production build, locally
    gatsby serve

Gatsby build uses the production config in .ghost.json.

🚨 Testing

This repository contains few Cypress end-to-end tests that not only make sure the website renders as expected, but also test accessibility (also known as a11y). To do so, the test commands spin up the Gatsby development server and run all the Cypress test specs against the former. You can run the tests using the following command:

 # Runs the tests right away, with no user interaction
 yarn test

or :

 # Interactive test launcher: opens up a Cypress browser for interactively running the tests
 yarn test:open

Deploying with Netlify

This contains 3 config files specifically for deploying with Netlify. A netlify.toml file for build settings, a /static/_headers file with default security headers set for all routes, and /static/_redirects to set Netlify custom domain redirects.

To deploy to your Netlify account, hit the button below.

Deploy to Netlify

You need however to leverage your own Ghost Content API Keys which allow Gatsby to communicate with your Ghost headless blog. For this, I currently set Netlify ENV variables for production builds instead.

Once deployed, I also set up a Ghost + Netlify Integration to use deploy hooks from Ghost to trigger Netlify rebuilds. That way, any time data changes (e.g., new post published) in the headless Ghost CMS, my website will rebuild on Netlify.

Developed by

License

The MIT License (MIT)

Copyright (c) 2020-2021 Armel Soro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

rm3l.org's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar rm3l avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rm3l.org's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.