A social platform comments flow window

Hello, I am a new coder. And for my first project, I want to create a mobil app using Kivy. I want to create a window where signed-up users can post comments, ask questions as in the following image. So I want it to be facebook-like flow window. Can I do it with only Kivy and MySQL, or should I use Django, too? What kind of code should I use to view comments and replies to them? Any source or tutorial you can share maybe?

If something has more than one user, you definitely don’t want your front end directly talking to your database. That’s an absolute nightmare to secure, and that means that inevitably, someone will figure out a way to mess your app up completely. So don’t do that.

Which means you will definitely want a back end of some form. Fortunately, though, it doesn’t need to be a huge complicated thing. I don’t think Django is necessary here; you could make a simple server using Flask or FastAPI that would serve requests (choose Flask if you want it to also serve the pages themselves, or FastAPI if it’s just API requests). Design a protocol between your front end and your back end, and then have your back end be the one that talks to your database. This is a standard pattern and fairly safe.

What you’ll need will be:

  • A way for people to actually get to the app. This could be as simple as a static HTML/CSS/JS page, hosted on GitHub Pages or Apache or pretty much anything. Very very easy. You can also have this served by the same Python program that serves everything else, eg using Flask.
  • A place to host images. This may or may not be in the same database where you store everything else. You can certainly have these run through your DB, but sometimes it’s better to have the extra complexity of a separate host for these. Or, for your first version, maybe don’t have ANY image hosting, and let people share links to images hosted on other servers.
  • Some way to log in. Do you want to do it yourself (with usernames and passwords) or let someone else do it (eg with OAuth2, which you’ll see as “Log in with Google” or “Log in with GitHub” etc)? Either way, once someone’s logged in, they should get some sort of token that the front end stores.
  • A way to create posts/comments. For example, a POST request to “/comments” with a JSON body containing a particular set of values. It should include the login token from above, preferably as a header.
  • A way to view posts/comments. For example, a GET request to “/comments” which will yield a JSON body with an array. It’s up to you whether this should also include authentication (which would allow comments to be private), or allow unauthenticated usage (if comments are public).

Those are your fundamentals (apart from image hosting, which is optional). There’s no end of additional features you can add, but if you have those, you’ll be able to play around with it with your friends!

Thank you very much for your detailed answer. It helped a lot about where to start. I am planning to use it for a university environment and planning to let people signup using the school e-mail.

1 Like