{"id":28911596,"url":"https://github.com/viniciuscestarii/mqtt-demo","last_synced_at":"2026-04-09T12:08:44.680Z","repository":{"id":300115486,"uuid":"1005242827","full_name":"ViniciusCestarii/mqtt-demo","owner":"ViniciusCestarii","description":"Full stack app for temperature sensor data visualization using MQTT, PostgreSQL, and Next.js.","archived":false,"fork":false,"pushed_at":"2025-06-19T23:43:49.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-20T00:31:37.529Z","etag":null,"topics":["echarts","mqtt","nextjs","postgresql","react","tawilwindcss"],"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/ViniciusCestarii.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}},"created_at":"2025-06-19T23:14:26.000Z","updated_at":"2025-06-19T23:43:53.000Z","dependencies_parsed_at":"2025-06-20T00:31:39.857Z","dependency_job_id":"c88dcc92-06e3-490d-ac63-10b42635b1a8","html_url":"https://github.com/ViniciusCestarii/mqtt-demo","commit_stats":null,"previous_names":["viniciuscestarii/mqtt-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ViniciusCestarii/mqtt-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fmqtt-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fmqtt-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fmqtt-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fmqtt-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ViniciusCestarii","download_url":"https://codeload.github.com/ViniciusCestarii/mqtt-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViniciusCestarii%2Fmqtt-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265445621,"owners_count":23766530,"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":["echarts","mqtt","nextjs","postgresql","react","tawilwindcss"],"created_at":"2025-06-21T19:09:10.175Z","updated_at":"2025-12-30T21:43:12.881Z","avatar_url":"https://github.com/ViniciusCestarii.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MQTT Temperature Demo\n\nThis project demonstrates a full-stack application for collecting, storing, and visualizing temperature sensor data using MQTT, PostgreSQL, and Next.js.\n\n\u003cdiv align=\"center\"\u003e\n   \n![image](https://github.com/user-attachments/assets/d9914b7d-d2df-4850-9f2d-357c5b3fe4f0)\n\n\u003c/div\u003e\n\n\n## Project Structure\n\n```\nmqtt-demo/\n├── mqtt-client/      # Node.js MQTT client that ingests sensor data and stores it in PostgreSQL\n└── web/              # Next.js web dashboard for live temperature visualization\n```\n\n---\n\n## 1. MQTT Client\n\nLocated in [`mqtt-client/`](mqtt-client/):\n\n- Connects to an MQTT broker\n- Listens for messages on the `temperature-sensor/#` topic\n- Parses temperature readings and inserts them into a PostgreSQL database\n\n### Setup\n\n1. Copy `.env.example` to `.env` and configure your environment variables:\n   ```\n   cp mqtt-client/.env.example mqtt-client/.env\n   ```\n2. Install dependencies:\n   ```\n   cd mqtt-client\n   npm install\n   ```\n3. Start the client:\n   ```\n   npm start\n   ```\n\n---\n\n## 2. Web Dashboard\n\nLocated in [`web/`](web/):\n\n- Built with [Next.js](https://nextjs.org/)\n- Fetches recent temperature readings from the database via an API route\n- Displays a live-updating line chart\n\n### Setup\n\n1. Copy `.env.example` to `.env.local` and configure your PostgreSQL connection:\n   ```\n   cp web/.env.example web/.env.local\n   ```\n2. Install dependencies:\n   ```\n   cd web\n   npm install\n   ```\n3. Run the development server:\n   ```\n   npm run dev\n   ```\n4. Open [http://localhost:3000](http://localhost:3000) in your browser.\n\n---\n\n## Database\n\nBoth the client and web dashboard use PostgreSQL. The client will automatically create the `sensor_readings` table if it does not exist.\n\nTable schema:\n```sql\nCREATE TABLE IF NOT EXISTS sensor_readings (\n  id SERIAL PRIMARY KEY,\n  temperature REAL NOT NULL,\n  created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n);\n```\n\n---\n\n## Environment Variables\n\nSee [`mqtt-client/.env.example`](mqtt-client/.env.example) and [`web/.env.example`](web/.env.example) for required variables.\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciuscestarii%2Fmqtt-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciuscestarii%2Fmqtt-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciuscestarii%2Fmqtt-demo/lists"}