Problem on database application deployment

Hello, I’m new to Xojo.
Xojo is so amazing that I can create my app for my small business on the fly. Recently I prepare to digitalize my family old business, all data will be stored in database so that I can manage it more precisely. I planned to use PostgreSQL as my database, and use Xojo to write a desktop client to connect it, mainly installed in my office. And then, I want to write a Web App, it may be accessed by my supplier and customer, for delivery monitoring and product checking etc.
The problem is : Should I write a daemon app as a middle, my desktop client only access the middle app by ServerSocket, and let the middle app deal with the database. Or I connect my database through desktop client directly? I’m confused because seems both of them have its advantage.
If I should create a server app to handle the job, should I use Xojo to write it too? I have think about Python, is it able to write a Xojo app, using Socket Function to communicate with Python App running on server-side?
I know Python and Xojo, but not advance, looking for helpful suggestion, Thank You!

I would not expose your postgresql database to the wide open internet as that has security risks

A middle tier written in either Xojo or some other language is definitely a good idea

Yes you can write a middle tier in python & talk to it from a Xojo application using a socket