Giter Site home page Giter Site logo

kaze's Introduction

Kaze Project

Kaze Project is a cool, modern app designed to manage power plants. It's got this neat GraphQL API that lets you do stuff like adding and updating power plant info. It even connects to Open-Meteo to grab weather data, which is super handy for planning. The app is built using Go and packed into Docker. Plus, it's got a bunch of tests written in Go to keep everything running smoothly. Perfect for anyone into energy management and tech!

Run the project

  • make compose/build
  • make compose/up
  • make test/integration # in a separate console

Test localy

  • Create a New Power Plant:
curl -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query":"mutation ($input: NewPowerPlantInput!) { createPowerPlant(input: $input) { id name latitude longitude } }","variables": {"input": {"name": "Berlin/Pankow Wind Farm","latitude": 52.636083,"longitude": 13.42977}}}'
  • Get Power Plant by ID:
curl -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query":"query getPowerPlant($id: ID!) { powerPlant(id: $id) { id name latitude longitude hasPrecipitationToday elevation weatherForecasts { time temperature precipitation windSpeed windDirection } } }","variables": {"id": "1"}}'
  • List Power Plants (with elevation and weatherForecasts):
curl -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query":"query ListPowerPlants($page: Int, $pageSize: Int) { listPowerPlants(page: $page, pageSize: $pageSize) { powerPlants { id name latitude longitude elevation weatherForecasts { time temperature precipitation windSpeed windDirection } } totalCount } }","variables": {"page": 1,"pageSize": 10}}'
  • List Power Plants (basic info):
curl -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query":"query ListPowerPlants($page: Int, $pageSize: Int) { listPowerPlants(page: $page, pageSize: $pageSize) { powerPlants { id name latitude longitude } totalCount } }","variables": {"page": 1,"pageSize": 10}}'
  • Update a Power Plant:
curl -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query":"mutation UpdatePlant($id: ID!, $input: UpdatePowerPlantInput!) { updatePowerPlant(id: $id, input: $input) { id name latitude longitude } }","variables": {"id": "30","input": {"name": "Berlin Pankow Wind Farm"}}}'

kaze's People

Contributors

glower avatar

Watchers

 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.