{"id":34644039,"url":"https://github.com/ayltai/espark","last_synced_at":"2026-04-14T23:04:35.440Z","repository":{"id":328190006,"uuid":"1113383318","full_name":"ayltai/espark","owner":"ayltai","description":"A lightweight framework for building scalable and efficient ESP32-based IoT applications. It provides a modular architecture, easy-to-use APIs, and built-in support for common IoT protocols.","archived":false,"fork":false,"pushed_at":"2026-04-14T21:19:12.000Z","size":348,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-14T21:29:52.003Z","etag":null,"topics":["esp32","iot","micropython"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayltai.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-09T22:47:46.000Z","updated_at":"2026-04-14T21:17:07.000Z","dependencies_parsed_at":"2026-01-06T19:07:58.760Z","dependency_job_id":null,"html_url":"https://github.com/ayltai/espark","commit_stats":null,"previous_names":["ayltai/espark"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/ayltai/espark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayltai%2Fespark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayltai%2Fespark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayltai%2Fespark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayltai%2Fespark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayltai","download_url":"https://codeload.github.com/ayltai/espark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayltai%2Fespark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31817201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: 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":["esp32","iot","micropython"],"created_at":"2025-12-24T17:34:53.791Z","updated_at":"2026-04-14T23:04:35.427Z","avatar_url":"https://github.com/ayltai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Espark\n\nEspark is a lightweight framework for building scalable and efficient ESP32-based IoT applications. It provides a modular architecture, easy-to-use APIs, and built-in support for common IoT protocols.\n\n## Project Goals\n\n- Simplify the development of ESP32 applications.\n- Provide a modular and extensible architecture.\n- Support common IoT protocols like MQTT.\n- Ensure efficient resource management for low-power devices.\n- Provide a clean and easy-to-use API.\n- Provide an user-friendly UI for configuration and monitoring.\n\n## Features\n\n- **Device Provisioning**: Easy setup and configuration of ESP32 devices.\n- **Telemetry Collection**: Built-in support for collecting and sending telemetry data.\n- **Scalable Architecture**: Designed to handle a large number of devices efficiently.\n- **Seamless Communication**: Support for MQTT protocol.\n- **Over-the-Air Updates**: Support for OTA application updates.\n\n## Hardware Requirements\n\n- ESP32-based development board\n- USB Cable for programming and power\n- Optional: Sensors and triggers for specific applications\n\n## Project Structure\n\n```\nespark/\n├── espark-core/\n│   ├── esparkcore/      # FastAPI backend framework\n│   │   ├── data/              # Models, repositories\n│   │   ├── routers/           # API endpoints\n│   │   ├── schedules/         # Background tasks\n│   │   ├── services/          # Business logic, MQTT handling\n│   │   └── utils/             # Utility functions\n│   └── Makefile\n├── espark-node/\n│   ├── esparknode/      # MicroPython application framework\n│   │   ├── actions/           # Action handlers\n│   │   ├── data/              # Data storage\n│   │   ├── libraries/         # External libraries\n│   │   ├── networks/          # Network management\n│   │   ├── sensors/           # Sensor interfaces\n│   │   ├── triggers/          # Trigger interfaces\n│   │   ├── utils/             # Utility functions\n│   │   └── base_node.py       # Main application file\n│   └── Makefile\n└── espark-react/        # React frontend application\n    ├── src/\n    │   ├── data/              # Data models and data providers\n    │   ├── i18n/              # Internationalization files\n    │   ├── pages/             # Application pages\n    │   ├── routes/            # Application routing\n    │   ├── utils/             # Utility functions\n    │   ├── App.tsx            # Main application component\n    │   └── index.tsx          # Application entry point\n    └── package.json\n```\n\n## Development Workflows\n\n### Setting up the backend\n\n1. Add espark-core as a dependency in your FastAPI project.\n   ```bash\n   pip install espark-core\n   ```\n2. Configure database connections and MQTT settings as environment variables.\n3. Implement additional data models, repositories, routers, and business logic if needed.\n4. Add the `DeviceRouter`, `TelemetryRouter`, and other additional routers to your FastAPI app.\n\n### Setting up the ESP32 application\n\n1. Clone the espark-node repository to your local machine.\n2. Copy `espark-core/Makefile.template` to `Makefile` and customize it for your device.\n3. Run `make upgrade` to copy the espark-core library to your device project.\n4. Implement device-specific actions, sensors, and triggers as needed.\n5. Run `make flash` to upload the firmware to your ESP32 device.\n6. Run `make deploy` to upload the application to the device.\n\n### Setting up the frontend\n\n1. Add espark-react as a dependency in your React project.\n   ```bash\n   pnpm install espark-react\n   ```\n2. Render `\u003cEsparkApp /\u003e` in your main application file.\n\n### Configurations\n\n- **espark-core**: Use environment variables, or `.env` file, for database and MQTT configurations.\n- **espark-node**: Use `esparknode.configs` for device-specific configurations.\n- **espark-react**: Customise `EsparkApp` props for application settings.\n\n## Examples and Patterns\n\n- **Router Example**: `device_router.py` in `espark-core/esparkcore/routers/` demonstrates how to create API endpoints for device management.\n- **Respository Example**: `device_repository.py` in `espark-core/esparkcore/data/repositories/` shows how to implement data access logic for devices.\n- **Action Example**: `esp32_relay.py` in `espark-node/esparknode/actions/` illustrates how to define actions for ESP32 devices.\n- **Sensor Example**: `sht20_sensor.py` in `espark-node/esparknode/sensors/` demonstrates how to read data from a SHT20 sensor.\n- **Trigger Example**: `gpio_trigger.py` in `espark-node/esparknode/triggers/` shows how to create GPIO-based triggers for device actions.\n- **List, Show, Edit Screens Example**: `DeviceList`, `DeviceShow`, and `DeviceEdit` components in `espark-react/src/pages/devices/` demonstrate how to create CRUD screens for device management.\n\n## Example Projects\n\n- **Espartan**: A smart thermostat and open-door alert automation system using ESP32-C3 devices, leveraging espark for device management and telemetry, available at [https://github.com/ayltai/Espartan](https://github.com/ayltai/Espartan).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayltai%2Fespark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayltai%2Fespark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayltai%2Fespark/lists"}