'Connect a python-run PostgreSQL database to a flutter web app
I am currently developing a flutter web app for tracking the information in students classes. The app is basically a task management app curated for students.
I have finished most of the flutter UI design, but my main issue now is connecting the web app with my intended database, postgresql . I have come to understand that I cannot connect a flutter web app directly to the postgres database. I plan to use python to run the functionality of the postgres database i.e python scripts to populate tables in the database etc.
The only solution I can think of is creating an API that can take user information from my flutter frontend and store it in my python-run postgres database. How could I achieve this, or what are alternative solutions for connecting the flutter UI to my postgres database?
Solution 1:[1]
Connecting a frontend application directly to a database is usually not a good idea. You will expose a lot of security concern within your application. What you are proposing right now is already a good option. Python is a good backend choice for a new project, do explore framework like Flask, FastApi (for creating API), and SqlAlchemy or Sqlmodel (for interacting with your database).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Lin Cheun Hong |