r/PythonLearning • • 2d ago

Finished a Messaging App

So i am a teen learning Python, and i made this messaging app, as a project, and i would like it to be reviewed. Now, should i keep learning? If yes, what? or should i keep making advanced projects??
And where do i stand rn?

Note: This is a terminal based app.

GitHub Repository Link: https://github.com/suryansh-devx/python-messaging-app

If you have no one to send a message, send me, my ID is 2672

Thanks in advance!

5 Upvotes

21 comments sorted by

5

u/Lyaw_Lyawa 2d ago edited 2d ago

Bueno, hay muchas cosas por mejorar.

Te recomiendo algunas cosas:

  1. (Opcional, poco importante) Empieza a usar expresiones regulares, para no tener que escribir print vacios.
print(f"\n Welcome to {app_name}! \n"}
  1. Podrías usar questionary. Que permite mostrar opciones en la terminal (esto te evita escribir código para excepciones luego), es una librería sencilla de aprender. Usar input() para mostrar opciones no me parece lo más adecuado.

  2. Si usas input para escribir el mensaje al presionar entre el mensaje se envía. Para que realmente sea como escribir un mensaje la función de enviar mensaje debe tenerla otra tecla.

  3. Si no guardas un archivo de la conversación, después el usuario no podrá acceder a su conversaciones (el usuario no debería acceder directamente al archivo, sino con la opciones) podrías incluir una opción de búsqueda por fecha, título (si incluyes que el mensaje tenga título, como en el correo), interceptor (Podría ser el ID de otra persona).

  4. No veo un diagrama de flujo, no sé si lo tengas hecho. Como piensas añadir cosas, un diagrama con subgrafos te puede ayudar a saber qué vas a hacer próximamente y que ya hiciste de forma ordenada. Si usas Obsidian puedes descargar una extensión para mostrar mermaid (así haces los diagramas más rápido, además puedes incluir comentarios extra que solo tú puedes ver). Hacer esos diagramas implica aprender mermaid, por supuesto, sin embargo, no creo que tardes más de una hora en eso, es bastante sencillo.

De resto, lo veo muy bien.

2

u/riklaunim 2d ago

It's more of a database insert/select app than actual messaging, still it's a step in the right direction. Look at code testing and project setup so it's easier to manage and work on.

could check out socket.io and do a real-time web based chat application ;)

You

2

u/Defiant_Meal1898 1d ago

okay thanks!

2

u/StephenHawkinguss 2d ago

Please tell me you didn't really hardcode the API keys 😭

7

u/Defiant_Meal1898 1d ago

No, i used supabase

1

u/StephenHawkinguss 1d ago

And how do you write to your db on supabase? 🤔

1

u/Defiant_Meal1898 5h ago

using code, the data gets stored in a table, mainly PostgreSQL

1

u/StephenHawkinguss 5h ago

and how does supabase know if you're allowed to write to that table 🤔?

1

u/Defiant_Meal1898 4h ago

tbh everyone can write the table, that's how the messaging works

1

u/StephenHawkinguss 3h ago

so i can just copy your api keys from github and spam bs? Do you understand the issue now?

4

u/[deleted] 2d ago

[removed] — view removed comment

1

u/Defiant_Meal1898 2d ago

Thanks! It is like Gmail, to send a message, you have to enter your ID and the receiver's ID. The messages disappear after they have been read, and 1-1 chat. You can create IDs.

1

u/StephenHawkinguss 2d ago

You know that thats just a bot hahah

0

u/[deleted] 2d ago

[removed] — view removed comment

1

u/Defiant_Meal1898 2d ago

They get deleted, i recommend trying it yourself? It is a terminal based app

0

u/[deleted] 2d ago

[removed] — view removed comment

1

u/Defiant_Meal1898 2d ago

Install supabase using pip, and then run the main.py file

0

u/[deleted] 2d ago

[removed] — view removed comment

1

u/Defiant_Meal1898 2d ago

Yeah, no worries!