Coder Social home page Coder Social logo

benthillerkus / homeconnect Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 2.42 MB

iot satire (on the blockchain)

Home Page: https://homeconnect.bent.party

License: BSD 2-Clause "Simplified" License

C++ 12.36% JavaScript 12.60% HTML 3.04% Svelte 67.29% C 4.70%
iot fridge

homeconnect's Introduction

homeconnect

Inoffizielle Implementierung des use-cases "Inhalt des Kühlschranks quasi in Realtime auf dem Handy sehen".

_MG_8855_small _MG_8856_small

Setup

Web

Vorraussetzungen:

  • Es wird ein Account / Projekt bei Supabase benötigt
    • Stell sicher, dass ein Storage-Bucket mit dem Namen images vorhanden ist
    • Die Sicherheitseinstellungen für den Bucket müssen öffentlichen Zugriff erlauben
  • Für's Hosten bietet sich Vercel oder Netlify1 an
  • NodeJS muss installiert sein
cd web
npm install
npm run dev

Umgebungsvariablen

Ein .env-File mit Umgebungsvariablen wird im web-Verzeichnis platziert. Bei Vercel kann man die dann in den Projekteinstellungen auch eintragen und sich über die Supabase-Integration auch automatisch holen.

|_ embedded
|_ web
  |_ src
  |_ .gitignore
  | //
  |_ .env

Die Schlüssel brauchen den Präfix VITE_ um von Vite gesehen zu werden.

VITE_PUBLIC_SUPABASE_ANON_KEY=""
SUPABASE_SERVICE_ROLE_KEY="" // Wird nicht benutzt; trotzdem vorsichtig mit dem!
VITE_PUBLIC_SUPABASE_URL=""
VITE_HOMECONNECT_ALLOW_POST="" // Nicht von Supabase; denk dir einen aus.
VITE_HOMECONNECT_ALLOW_VIEW="" // ^^

Embedded

Vorraussetzungen:

Umgebungsvariablen

Im Header embedded/include/env.h liegen alle Konfigurationsvariablen.

|_ embedded
  |_ include
    |_ env.h
    |_ README
  | //
  |_ src
    |_ main.cpp
|_ web
// Für HTTPS wird das Root-Zertifikat des Webservers gebraucht. In meinem Fall ist die Kette Vercel -> Cloudflare -> Let's Encrypt
const constexpr char *rootCACert = R"(-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
// ....
// ....
-----END CERTIFICATE-----
)";

const constexpr char *ssid = "mySSID"; // Die SSID des WLANs in dem der ESP32-Cam laufen soll
const constexpr char *password = "myPASS"; // Das Wifipasswort
const String token = "bearerTOKEN"; // Der Wert aus VITE_HOMECONNECT_ALLOW_POST
const String host = "bla.com"; // In meinem Fall homeconnect.bent.party
const String path = "https://" + host + "/api/v1/images";
const constexpr uint16_t port = 443;

Weblinks

Footnotes

  1. Nicht ausprobiert. Wahrscheinlich geht sogar auch Cloudflare; man kann das ganze aber auch natürlich selber hosten oder lokal laufen lassen.

homeconnect's People

Contributors

benthillerkus avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.