Giter Site home page Giter Site logo

organic-basics / ob-low-impact-website Goto Github PK

View Code? Open in Web Editor NEW
226.0 15.0 13.0 2.7 MB

The Low Impact version of the Organic Basics website

Home Page: https://lowimpact.organicbasics.com

License: Other

JavaScript 6.30% Vue 86.20% TypeScript 5.16% Shell 0.13% Makefile 0.12% SCSS 2.09%
shopify sustainability co2 nuxtjs climate

ob-low-impact-website's Introduction

Build Status

The Low Impact Website by Organic Basics

The internet is dirty. Data transfer requires electricity, which creates carbon emissions — and this leads to climate change. The Low Impact website reduces data transfer by up to 70% in comparison to our regular website.

Low Impact Manifesto

To build this website, we wrote down 10 rules for how to make a low impact website. We share these openly, so you can use it in your own project.

A low impact website:

1. Does not load any images before they are actively requested by the user.
2. Minimizes the power consumption on the users device.
3. Adapts to reflect the amount of renewable energy it’s currently running on.
4. Informs the user of the impact of their browsing behavior.
5. Does not make use of videos.
6. Stores data locally on the user’s device to minimize data transfer.
7. Compresses all data to the greatest extent possible.
8. Loads only the most crucial programming scripts, frameworks and cookies.
9. Limits the amount of light emitted by the screen.
10. Optimizes and limits the use of custom fonts.

Setup

The Low Impact Website uses Shopify's Storefront API to fetch products and basic ecommerce functionality. It uses the Nuxt.js framework.

Installation

To get started, you first need to install Yarn, and then run yarn install.

Environment variables

Shopify

To setup your environment variables, you should copy the .env.example file and rename it .env. Then you must fill it out with your own Shopify setup.

Organic Basics uses 4 different production Shopify shops and 1 for development, so we have defined 5 Apollo clients in nuxt.config.js: eur, gbp, usd, dkk and dev.

These 5 different configs are used to navigate between different currencies, and thus Shopify shops.

This happens via the _locale part of the Nuxt routing, e.g. https://lowimpact.organicbasics.com/eur.

You might not need 5 different shops, and so you must adapt the nuxt.config.js and .env files.

Contentful

We also use Contentful to display some content on the product pages. To fetch this, you must fill in .contentful.json with your own values.

Usage

To start the development server at localhost:3000, run yarn dev.

To build for production, run yarn build.

To launch the server and the production build, run yarn start

For a more detailed explanation on how things work, check out Nuxt.js docs.

Disclaimer

The Low Impact Website code is highly customized to the Organic Basics' website setup, and will more than likely not easily transfer to your setup.

Thus the main outcomes of making this code available to the public will likely be in sharing learnings and techniques, instead of providing a plug-and-play solution for low impact websites. But if you want to make such a thing, let us know!

Support

Organic Basics does not currently have the resources to provide any support to help you setup this project.

If you find any bugs, issues or similar, please create an issue on this Github repository.

License

The Low Impact Website code is released under the Climate Strike License.

ob-low-impact-website's People

Contributors

hendersonpinto avatar petyakazakova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ob-low-impact-website's Issues

Very slow TTFB

Most requests seem to have an average of 1-2 second TTFB, are they cached?

I guess your hands are tied as it's what Shopify provide, but it makes the site feel super slow when moving around new routes.

Screenshot 2020-07-01 at 08 04 16

Separately publish the Low Impact Manifesto

Thank you for your great approach to low-energy website design. As facilitator of Humane Tech Community I posted to our forum and on LinkedIn.

I maintain awesome-humane-tech and am thinking of adding a separate category for tech-related sustainability solutions. If the Low Impact Manifesto were separately defined (and maybe even have a separate github repo to showcase the techniques, not mixed in with the webshop itself) it would be a candidate for inclusion.

Apart from that my suggestion is to add github topics to the repository for findability and to attract more people to it.

Size and performance

The site loads around 5mb of data over 95 requests. This years average is 2.07MB. Transferring all this data costs money and most importantly our planet.

Also there is almost 1mb of JS scripts (uncompressed) and that's A LOT! I have a fairly good pc (6 core, 16gb ram) but scripting takes 1s from 5s test. I didn't test on a phone but I'm sure that this drains battery a lot which draws the site very ineffective in saving power.

Horizontal scrollbars

Hey,

Great site.

For those that force scroll bars, using width: 100vw; is causing issues.

Also, dropdown menu.

Screenshot 2020-07-01 at 07 59 55

Thanks,
Tom

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.