{"id":21228855,"url":"https://github.com/anras5/greenicoapi","last_synced_at":"2025-07-11T05:05:13.860Z","repository":{"id":155441769,"uuid":"583744139","full_name":"anras5/GreenicoAPI","owner":"anras5","description":"RESTful API and web application for Greenico project","archived":false,"fork":false,"pushed_at":"2023-02-12T16:06:09.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T01:47:01.733Z","etag":null,"topics":["gin-gonic","go","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anras5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-30T19:15:11.000Z","updated_at":"2024-06-19T19:34:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"2808c6be-d85a-4945-9452-b33abb90f2d0","html_url":"https://github.com/anras5/GreenicoAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anras5/GreenicoAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2FGreenicoAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2FGreenicoAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2FGreenicoAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2FGreenicoAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anras5","download_url":"https://codeload.github.com/anras5/GreenicoAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2FGreenicoAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264734826,"owners_count":23655748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gin-gonic","go","rest-api"],"created_at":"2024-11-20T23:22:34.795Z","updated_at":"2025-07-11T05:05:13.837Z","avatar_url":"https://github.com/anras5.png","language":"Go","readme":"# Greenico API\n\nWeather station with Raspberry Pi Pico - \"Greenico\"\n\n[GreenicoAPI](https://github.com/anras5/GreenicoAPI) is only a part of `Greenico` project.\n\nThe first part is [Greenico on Raspberry Pi Pico](https://github.com/anras5/Greenico). Be sure to check it out also.\n\n## Table of contents\n\n1. [The purpose of the project](#Purpose)\n2. [Description](#Description)\n3. [Technical information](#Technical)\n4. [Contact](#Contact)\n\n## Purpose\n\nThe aim of the project is to allow the user to view the current state of the weather by designing and building a weather\nstation. The preview will be possible through a browser, i.e. a web application in the form of clear graphs and on the\ndisplay attached to the weather station.\n\n## Description\n\nGo was chosen as the programming language for this part of the project with Gin framework due to the ease of\nimplementing the RESTful API and the simplicity of connecting the application with\nPostgres database. The web application was built using Go templates and language JavaScript.\nThe Postgres database was created using the Soda migration tool.\n\n## Available endpoints\n\nAPI endpoints:\n\n```go\n// API\nrouter.GET(\"/api/reading\", handlers.GetReading(db))\nrouter.GET(\"/api/readings\", handlers.GetReadings(db))\nrouter.GET(\"/api/all-readings\", handlers.GetAllReadings(db))\nrouter.POST(\"/api/reading\", handlers.InsertReading(db))\nrouter.DELETE(\"/api/reading\", handlers.DeleteReading(db))\n```\n\nWeb application endpoints:\n\n```go\n// WEB APP\nrouter.GET(\"/\", handlers.MainRender(db))\nrouter.GET(\"/voc\", handlers.PageRender(db, \"voc\"))\nrouter.GET(\"/temperature\", handlers.PageRender(db, \"temperature\"))\nrouter.GET(\"/humidity\", handlers.PageRender(db, \"humidity\"))\nrouter.GET(\"/light\", handlers.PageRender(db, \"light\"))\nrouter.GET(\"/pressure\", handlers.PageRender(db, \"pressure\"))\nrouter.GET(\"/uv\", handlers.PageRender(db, \"uv\"))\n```\n\n## Technical\n\nAPI was written in **Go** programming language with the use of **Gin framework**. All requirements are listed\nin `go.mod` file.\n\n### How to run the app\n\n1. Create (in the root directory of the project) and fill values in `.env` file:\n```\nHOSTNAME=\nPORT=\nDBNAME=\nDBUSER=\nDB_PASSWD=\n```\n2. Run `run.bat` file\n\n## Contact\nContact me at:\nanras1filip@gmail.com","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanras5%2Fgreenicoapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanras5%2Fgreenicoapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanras5%2Fgreenicoapi/lists"}