{"id":21482362,"url":"https://github.com/scottgibb/web-based-fan-controller","last_synced_at":"2026-04-05T21:37:00.677Z","repository":{"id":161223106,"uuid":"621271432","full_name":"ScottGibb/Web-Based-Fan-Controller","owner":"ScottGibb","description":"A Simple Web Based Controller for a Fan using a full stack software solution","archived":false,"fork":false,"pushed_at":"2024-10-10T13:29:06.000Z","size":620,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T09:21:31.308Z","etag":null,"topics":["docker","docker-compose","flask","flask-api","html-css-javascript","nginx","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScottGibb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-03-30T10:29:15.000Z","updated_at":"2023-03-31T14:01:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"302ca407-34d1-4e48-9ff5-3df820b952e2","html_url":"https://github.com/ScottGibb/Web-Based-Fan-Controller","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ScottGibb/Web-Based-Fan-Controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FWeb-Based-Fan-Controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FWeb-Based-Fan-Controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FWeb-Based-Fan-Controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FWeb-Based-Fan-Controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScottGibb","download_url":"https://codeload.github.com/ScottGibb/Web-Based-Fan-Controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottGibb%2FWeb-Based-Fan-Controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31451445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","docker-compose","flask","flask-api","html-css-javascript","nginx","python"],"created_at":"2024-11-23T12:32:44.092Z","updated_at":"2026-04-05T21:37:00.638Z","avatar_url":"https://github.com/ScottGibb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Based Fan Controller\n\n[![Static Analysis](https://github.com/ScottGibb/Web-Based-Fan-Controller/actions/workflows/Static%20Analysis.yml/badge.svg)](https://github.com/ScottGibb/Web-Based-Fan-Controller/actions/workflows/Static%20Analysis.yml)\n[![Build](https://github.com/ScottGibb/Web-Based-Fan-Controller/actions/workflows/Build.yml/badge.svg?branch=main)](https://github.com/ScottGibb/Web-Based-Fan-Controller/actions/workflows/Build.yml)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\u003ccenter\u003e\n\u003cimg src =\"docs/Languages_And_Tools.png\"\u003e\n\u003c/center\u003e\n\n## Summary\n\nThis project contains a very simple web based application for controlling a Fan. This was my first time creating a web app and as such is not the best app ever built. However it was done as an educational project to explore different aspects of web development. The project consists of both a backend and frontend component. The backend is written in Python and uses the Flask framework. The frontend is written in HTML and CSS and uses Bootstrap for styling. The backend and frontend are packaged together in a Docker compose file, the system is designed to run on a raspberry pi. However the frontend docker container can be moved to a seperate server if desired.\n\n## Architecture\n\nThe architecture of the system is as follows:\n\n\u003ccenter\u003e\n\u003cimg src =\"docs/System-Architecture.png\"\u003e\n\u003c/center\u003e\n\n## Installation\n\n### Update Pins\n\nFirstly, navigate to the `PythonWebApp/BackEnd/src` directory and open the `app.py` file. In this file you will need to update the constructor of FanController to the pins you have connected the fan to. The pin number should be the BCM pin number.\n\nOnce this is completed, save the file and close it.\n\n### Build Docker Images through Docker Compose\n\nNext, navigate to the `PythonWebApp` directory and run the following command:\n\n```bash\ndocker-compose up -d --build\n```\n\nIf you want to build the mock version of the backend, run the following command instead:\n\n```bash\ndocker-compose up -d --build -e MOCK=\"mock\"\n```\n\nAfter this the docker image will be built and the containers will be started. The web app should now be accessible at `http://server-ip:5001`.\n\n### Build and run Docker Images Manually\n\nAlternatively, you can build the docker images manually. To do this, navigate to the `PythonWebApp/BackEnd` directory and run the following command:\n\n```bash\nsh run.sh\n```\n\nThe same can be done for the frontend by navigating to the `PythonWebApp/FrontEnd` directory and running the following command:\n\n```bash\nsh run.sh\n```\n\n## Continuous Integration\n\nThe project uses GitHub actions to perform continuous integration. The workflow is defined in the `.github/workflows folder\n\n### Build\n\nAs part of the pipelines associated with this project is a build stage, Which builds the docker images for the backend and frontend. The build stage is defined in the `Build.yml` file. It also performs static analysis on the code using the following tools:\n\n- shellcheck\n- hadolint\n\nThis allows both dockerfiles to be validated and tested. This stage also tests the run scripts for both backend and frontend.\n\n### Static Analysis\n\nThe static analysis stage is defined in the `Static Analysis.yml` file. It performs static analysis on the code using the following tools:\n\n- pylint\n- cslint\n- eslint\n- htmllint\n\nThis allows all the code associated with this project to be properly verified and kept up to certain standards.\n\n## Useful Links\n\n- [Flask](https://flask.palletsprojects.com/en/2.0.x/)\n- [Bootstrap](https://getbootstrap.com/)\n- [Docker](https://www.docker.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottgibb%2Fweb-based-fan-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottgibb%2Fweb-based-fan-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottgibb%2Fweb-based-fan-controller/lists"}