Coder Social home page Coder Social logo

energy-poc's Introduction

Energy proof of concept

What type of energy do you use?

Netlify Status

This is an attempt at creating a website using the JAMStack. It uses NextJS to export the app to a static site and uploads it on Netlify's CDN.

Check it out here!

Development setup

Install locally using

git clone [email protected]:ClementChaumel/energy-poc.git
cd energy-poc
yarn

You'll also need to create a .env file like so

API_KEY = [api - key];
API_URL = [api - url];

The real values currently don't live anywhere so send me a private message and I'll send you a copy of my .env

Then run the dev server with

yarn dev

And the app will be running on http://localhost:5555/


You can also run the static version of the build using serve.

Install serve if you don't already have it

npm install -g serve

Then run

yarn export
cd out
serve -p 5555

And the generated static app will be running on http://localhost:5555/

Technologies

Make sure to familiarise yourself with the tehchnologies used in this project:

Testing

We use Jest and Cypress for our tests. As well as ESLint for linting.

Unit tests

To run unit tests use:

yarn test:unit

We use snapshots with jest. To update them, run

yarn test:unit -u

or

yarn update-snapshots

Don't forget to commit them!

End to end tests

Make sure you have the application running on port 5555 then run

yarn test:e2e

to open cypress test runner and watch them go. If you only care about the outcome, instead run

yarn test:e2e:headless

If they fail you'll be able to see video recordings and screenshots in test/e2e/cypress/videos and test/e2e/cypress/screenshots respectively.

Linting

Simply run

yarn lint

to check your code against the rules.

Hooks
yarn test

Is a combination of unit tests and lint. I highly suggest you to add it to your pre-commit or pre-push hook to avoid the infamous "Fixing lint" commits

What's next?

  • Set up some CI for e2e test. (Lint and unit can be ran on netlify but not e2e).
  • Find a way to get dynamic global nav + footer. I see two options:
    • Transform them in React components and put them in the component library.
    • Curl them at build time and somehow inject the html into the components. (I haven't been able to figure that one out yet)
  • Connect to the backend API
  • ???
  • profit.

energy-poc's People

Contributors

clementchaumel avatar

Watchers

James Cloos avatar  avatar

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.