Skip to content

Vite React TypeScript SPA that uses an OpenAPI generated API client to fetch live data from Fingrid.

License

Notifications You must be signed in to change notification settings

Avicted/finland-power-status

Repository files navigation

Finland Power Status

This is a basic Vite React TypeScript client SPA (Single Page Application) that can display data about the finnish power grid.

This serves as an example of how to generate an API in TypeScript from an OpenAPI specification and also using the generated API.

A Node.js proxy in vite.config.js is used to adhere to the CORS policy at the end server.

You need an API key to be able to use this client.

How to install and run

npm install

npm run dev

The API in TypeScript was generated with the following command (no need to run this again):

# openapi-generator-cli generate -i avoindata-api.json -g typescript-fetch -o ./generated-api
npm run generate-api

Screenshot

Screenshot

The data is from Fingrid

https://developer-data.fingrid.fi/

About

Vite React TypeScript SPA that uses an OpenAPI generated API client to fetch live data from Fingrid.

Topics

Resources

License

Stars

Watchers

Forks

Languages