Serve up a dynamic web page for guests with no login

Posted on
Mon Jun 26, 2023 8:02 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Serve up a dynamic web page for guests with no login

Very cool. Is there a Wiki to read up on how to get started?

Posted on
Mon Jun 26, 2023 8:37 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Serve up a dynamic web page for guests with no login

Not as such, and I should also add a few caveats about my specific project.

1. I started this project before Indigo added a built-in websocket server, so my plugin is running an "independent" websocket server that (essentially) mimics the built-in one. I've been too lazy to refactor my plugin and JavaScript code to take advantage of the built-in server. My plugin handles all the interaction--serving up Indigo object details, interpreting app requests, etc. which are now effectively unnecessary.

2. My app is specifically written for my Indigo install and wouldn't be something that someone could just install and run on their system. For example, the menus are referring to specific rooms in our house. The app doesn't have the capability to customize the interface through the app and would require someone to redo the entire codebase for their application. I didn't write it with the intention of making it universal.

3. My app has a couple big bugs in it at the moment. I stopped working on it to help out with some other things and haven't got around to working out these kinks. I was in the process of refining the UI when I stopped (see the image). As you can see, things are a bit broken at the moment (it looks like I need to change a battery in my outdoor luminance device though). :D

It would be nearly impossible to write a How-To article I'm afraid. I use a combination of libraries including VueJS, Vuex, Bootstrap, ChartJS, v-calendar, and others and these aren't even the only ones you can use (Indigo Touch for the web uses Svelte and TypeScript, and I know someone else working with Kivy which is pure Python). I knew absolutely nothing about any of these libraries--including having no JavaScript knowledge--when I got started and I still consider myself a beginner. Someone with a good handle on JavaScript would be able to pick this stuff up pretty easily.

If you're serious, I would suggest boning up on tutorials to write a small SPA to attach to Indigo's websocket server and start small. :D

Screenshot 2023-06-26 at 9.27.32 AM-2.png
Screenshot 2023-06-26 at 9.27.32 AM-2.png (114.9 KiB) Viewed 1674 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Jun 26, 2023 8:40 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Serve up a dynamic web page for guests with no login

P.S. the nuts and bolts of Indigo's websocket API are contained here:

https://wiki.indigodomo.com/doku.php?id=indigo_2022.2_documentation:api

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Jun 26, 2023 9:01 am
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Serve up a dynamic web page for guests with no login

I think the easiest place to start is by checking out the Example HTTP Responder plugin in the Plugin SDK. For anyone new to web development or for anyone familiar with it but not in Python, this will guide you through the initial steps. It has simple examples of serving up static content, handling GET and POST requests, using templates to return dynamic HTML, etc. It also has a TON of comments that explain pretty much everything the plugin is doing. If you have any questions, you can post them on the SDK forum and we'll help you through.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 26, 2023 10:35 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Serve up a dynamic web page for guests with no login

jay (support) wrote:
I think the easiest place to start is by checking out the Example HTTP Responder plugin in the Plugin SDK. For anyone new to web development or for anyone familiar with it but not in Python, this will guide you through the initial steps. It has simple examples of serving up static content, handling GET and POST requests, using templates to return dynamic HTML, etc. It also has a TON of comments that explain pretty much everything the plugin is doing. If you have any questions, you can post them on the SDK forum and we'll help you through.


Thanks Jay. This sounds like a fun project.

Posted on
Tue Jul 25, 2023 10:46 am
mundmc offline
User avatar
Posts: 1061
Joined: Sep 14, 2012

Re: Serve up a dynamic web page for guests with no login

Thanks both for the tips… This might be when I finally make a plug-in. Yes, I've been writing that for well over eight years now.

Posted on
Wed Jul 26, 2023 2:50 pm
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: Serve up a dynamic web page for guests with no login

While I think I'm almost good at the networking part... presenting a URL that would lead to a web page populated with data from Indigo...actually doing the web page is outside my ability, which is why I find PAGES in Indigo easy enough for a novice like me to build interesting, informative, and useful pages. Just not sure I could mange any of the other ideas suggested here. I'm hoping someone might develop a plugin for this... maybe "Guest Pages Plugin", that would still leverage the "easy" design part of Pages, but with no login authentication, or at least a separate login that wouldn't give the user access to the whole system.

Posted on
Wed Jul 26, 2023 9:13 pm
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Serve up a dynamic web page for guests with no login

You can serve up public (no authentication) static web pages from a plugin, just put the files in this directory:

Code: Select all
MyPlugin.indigoPlugin/Contents/Resources/public/


then access them via:

Code: Select all
https://myreflector.indigodomo.net/com.yourplugins.myplugin/public/


where com.yourplugins.myplugin is the plugin's ID.

Check out the Example HTTP Responder plugin in the SDK for details and directions.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 27, 2023 12:14 pm
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: Serve up a dynamic web page for guests with no login

OK

this almost looks easy enough!

Thanks

Who is online

Users browsing this forum: No registered users and 11 guests