C
C#β€’3mo ago
Pete.

Architecture problem

Hi! I am struggling with an architecture of my solution so I am here to ask on forum. πŸ™‚ Basically I want to create webAPI based interface which is connected with Blazor Server website. And over here I have got client - RaspberryPi as data provider and client. Blazor server works as data dashboard and also doing stuff connected to adding new devices on RPi. Could you give me hints how I can program creation of new peripherals for RPi using REST?
20 Replies
Jimmacle
Jimmacleβ€’3mo ago
you're combining a lot of different problems instead of focusing on one at a time what exactly do you mean by "creation of new peripherals for RPi using REST?" why do you need a web API if you're using blazor server?
Pete.
Pete.β€’3mo ago
Let me explain on drawing, wait a sec
Pete.
Pete.β€’3mo ago
No description
Lukaa
Lukaaβ€’3mo ago
do you use cpp on pi? if so you dont need a webapi, use RPC
Pete.
Pete.β€’3mo ago
still thinking about .net 8
Jimmacle
Jimmacleβ€’3mo ago
why not run the whole thing as a single application on the pi? are you trying to support multiple pis?
Pete.
Pete.β€’3mo ago
yes i want to have multiple support in the future that is the reason, i can host everything on the pi, but i have limitation in db choice (cannot be mssql tho) To be honest I am using oldest Pi (I have 100% chance to have performant code which can be installed on newest ones) Rpi2 1GB of RAM is real threat and also connected users too maybe... you got right to host blazor server and peripheral app on same device, but if I want to expand I will have a big trouble I need an idea to make it run, I can write the code, but I have no idea to make it like on schema
Jimmacle
Jimmacleβ€’3mo ago
tbh i'm still trying to understand which part of the project you need help with it sounds like all of it
Pete.
Pete.β€’3mo ago
I need an confirmation, that I can create API client on Pi and API server on Blazor server.. Is it good idea? That's all I think I need I am not an architect
Angius
Angiusβ€’3mo ago
Sure can
Jimmacle
Jimmacleβ€’3mo ago
blazor server isn't relevant to setting up a web API
Pete.
Pete.β€’3mo ago
I can set it up next to it too
Jimmacle
Jimmacleβ€’3mo ago
i'm saying whether you want to use blazor server or not doesn't change how you design the API
Pete.
Pete.β€’3mo ago
Ok I will separate it
Jimmacle
Jimmacleβ€’3mo ago
that's... not what i'm saying the blazor server components and web api components can run as part of the same application but they don't really affect each other
Pete.
Pete.β€’3mo ago
Ok, now I understand. Last question what I have - how you will solve adding new device via API form and send it to Rpi via API? I want to pass an id, type, pin, description, pinmode and if something I missed I will add too
Jimmacle
Jimmacleβ€’3mo ago
think about it and see what you can come up with you're kind of asking me to figure out half your project for you :LUL:
Pete.
Pete.β€’3mo ago
i need just little advice, rest things I know how to code... πŸ˜›
Angius
Angiusβ€’3mo ago
I'd have a dashboard in your control panel app, the Blazor Server one I assume. You paste an address of a given RPi and add it to some database
Pete.
Pete.β€’3mo ago
Thank you - I will demonstrate demo here soon 🀩