{"id":24030189,"url":"https://github.com/bacemhlabba/iot-platform","last_synced_at":"2025-02-26T03:35:11.743Z","repository":{"id":271033882,"uuid":"912029143","full_name":"bacemhlabba/IoT-platform","owner":"bacemhlabba","description":"A repository for IoT platform project","archived":false,"fork":false,"pushed_at":"2025-01-04T23:38:09.000Z","size":93201,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T00:18:49.538Z","etag":null,"topics":["flask","humidity","iot","project","python-framework-flask","python3","raspberrypi","tempurature"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/bacemhlabba.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":"2025-01-04T13:53:21.000Z","updated_at":"2025-01-04T23:38:13.000Z","dependencies_parsed_at":"2025-01-05T01:45:20.858Z","dependency_job_id":null,"html_url":"https://github.com/bacemhlabba/IoT-platform","commit_stats":null,"previous_names":["bacemhlabba/iot-platform"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacemhlabba%2FIoT-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacemhlabba%2FIoT-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacemhlabba%2FIoT-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacemhlabba%2FIoT-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bacemhlabba","download_url":"https://codeload.github.com/bacemhlabba/IoT-platform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788631,"owners_count":19857691,"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":["flask","humidity","iot","project","python-framework-flask","python3","raspberrypi","tempurature"],"created_at":"2025-01-08T17:29:53.329Z","updated_at":"2025-02-26T03:35:11.708Z","avatar_url":"https://github.com/bacemhlabba.png","language":"HTML","readme":"# IoT Project\n\nThis repository contains a Flask project that serves web pages to display sensor data from Firebase and a local database. The project also includes functionality to update the LED state in the local database.\n\n## Setup Instructions\n\n### 1. Set up and run the Flask project\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/bacemhlabba/IoT-platform.git\n    cd IoT-platform\n    ```\n\n2. Create a virtual environment and activate it:\n    ```bash\n    python3 -m venv venv\n    source venv/bin/activate\n    ```\n\n3. Install the required dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. Run the Flask app:\n    ```bash\n    ./run.sh\n    ```\n\n### 2. Create and configure the Firebase project\n\n1. Go to the [Firebase Console](https://console.firebase.google.com/) and create a new project.\n\n2. Add a new web app to the project and follow the instructions to register the app.\n\n3. Download the `firebase.json` file from the Firebase Console and place it in the root directory of the project.\n\n4. Update the file with the Firebase configuration details.\n\n### 3. Set up the local database\n\n1. Run the migration script to create the `sensor_data` table and insert initial data:\n    ```bash\n    python3 migrate.py\n    ```\nOR \n\n ```bash\n    ./run.sh\n```\n\n### 4. Using Docker Compose\n\n1. Make sure Docker and Docker Compose are installed on your machine.\n\n2. Build and start the containers:\n    ```bash\n    docker-compose up --build\n    ```\n\n3. Open a web browser and go to `http://127.0.0.1:5000/` to access the index page.\n\n## Running the App\n\n1. Make sure the virtual environment is activated and the required dependencies are installed.\n\n2. Run the Flask app:\n    ```bash\n    ./run.sh\n    ```\n\n3. Open a web browser and go to `http://127.0.0.1:5000/` to access the index page.\n\n4. Use the navigation links to go to Page 1 and Page 2 to view the sensor data and update the LED state.\n\n## Project Structure\n\n```\nIoT-platform/\n├── app/\n│   ├── static/\n│   ├── templates/\n│   ├── __init__.py\n│   ├── routes.py\n│   └── models.py\n├── migrations/\n├── screenshots/\n├── venv/\n├── .gitignore\n├── docker-compose.yml\n├── Dockerfile\n├── firebase.json\n├── migrate.py\n├── README.md\n├── requirements.txt\n└── run.sh\n```\n\n## Technologies Used\n\n- Python\n- Flask\n- Firebase\n- SQLite\n- Docker\n- Docker Compose\n- HTML/CSS\n- JavaScript\n\n## Contributing\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature-branch`).\n3. Make your changes.\n4. Commit your changes (`git commit -m 'Add some feature'`).\n5. Push to the branch (`git push origin feature-branch`).\n6. Open a pull request.\n\n## Screenshots\n\n### Home Page\n![Home Page](screenshots/home.jpeg)\n\n### Page 1 - Firebase Data\n![Page 1](screenshots/firebase_db.jpeg)\n\n### Page 2 - Local Database Data\n![Page 2](screenshots/local_db.jpeg)\n\n### Submit Data to Firebase\n![Submit Form](screenshots/put_data_to_firebase.jpeg)\n\n### Submit Data to SQLite\n![Submit SQLite](screenshots/put_data_to_local_db.jpeg)\n\n### Popup for Sensor Data\n![Popup](screenshots/popup.jpeg)\n\n### LED State Update off\n![LED State](screenshots/led_stat_popup_off.png)\n\n### LED State Update on\n![LED State](screenshots/led_stat_popup_on.png)\n\n### Firebase Realtime\n![Firebase Realtime](screenshots/firebase_realtimedatabase.jpeg)\n\n### SQLite Tables\n![SQLite Tables](screenshots/sqllite_tables.png)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbacemhlabba%2Fiot-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbacemhlabba%2Fiot-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbacemhlabba%2Fiot-platform/lists"}