0

I hope you are doing well. I have some questions or rather a guide

I just finished a training in SQL, and I chose PostgreSQL as my DBMS.

Before I start, I'll give you a briefing to put you in the context:

I am developing a Windows Desktop application (with Flutter), this application will be a local application that will run on several machines.

And all instances of the application installed on the different machines will fetch data from my PostgreSQL database.

So, instead of making a direct interaction between the database and the application, I want to set up APIs that will take care of the interaction between the database and the application. The application will send an API request and the API will interact with the database and return the response to the application... (Of course you already know what an API is and what it does).

The Desktop application is a local application, the database will be on a local machine/server which is on the same network as all the others.

So my question is if it is possible to do this, to make local APIs only that will interact with my local database and local application. If so, how do I go about it? What are the tools I need to learn to use or have.

Thank you!

P.S: I hope I was clear enough in my message (everything was a blur in my head). I did some research on the internet but nothing that really explains what I need. I am still a beginner

Sorry for the long message😁

1
  • 1
    Have a look at grpc for Dart, it allows to build a client-server application with remote procedure calls in a relatively straightforward way. This is not REST but potentially easier for what you want to achieve. The example in the documentation might give you some ideas how to use this to wrap SQL queries on the server and expose them via grpc to clients. grpc.io/docs/languages/dart/quickstart Commented May 9, 2022 at 22:07

1 Answer 1

2

Your front-end app will be developed by Flutter, your back-end will be PostgreSQL, then your problem is about API server and how to work with DB. Your API server can be developed in any language, and depending on the language your choose then you will use its respective packages. Dart language offers an API server by using Shelf.

I'd recommend to use Postgraphile for your database, then you can use Ferry for your app, then you would not need an API server.

I hope this info helps you.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Do you have useful links that can help me to setup that ? Any course ?
Links: Postgraphile tutorial, Postgraphile CLI, Postgraphile with Docker, Ferry tutorial. Ferry's doc needs an update. You can use http package to work with Postgraphile instead of Ferry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.