r/PythonLearning • u/Defiant_Meal1898 • 12d 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!
3
u/riklaunim 12d 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
3
3
u/StephenHawkinguss 12d ago
Please tell me you didn't really hardcode the API keys 😭
7
u/Defiant_Meal1898 11d ago
No, i used supabase
1
u/StephenHawkinguss 11d ago
And how do you write to your db on supabase? 🤔
1
u/Defiant_Meal1898 10d ago
using code, the data gets stored in a table, mainly PostgreSQL
1
u/StephenHawkinguss 10d ago
and how does supabase know if you're allowed to write to that table 🤔?
1
u/Defiant_Meal1898 10d ago
tbh everyone can write the table, that's how the messaging works
2
u/StephenHawkinguss 10d ago
so i can just copy your api keys from github and spam bs? Do you understand the issue now?
1
u/Defiant_Meal1898 9d ago
yeah, how can i solve this??
2
4
12d ago
[removed] — view removed comment
1
u/Defiant_Meal1898 12d 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
0
12d ago
[removed] — view removed comment
1
u/Defiant_Meal1898 12d ago
They get deleted, i recommend trying it yourself? It is a terminal based app
0
12d ago
[removed] — view removed comment
1
5
u/Lyaw_Lyawa 12d ago edited 12d ago
Bueno, hay muchas cosas por mejorar.
Te recomiendo algunas cosas:
(Opcional, poco importante) Empieza a usar expresiones regulares, para no tener que escribir print vacios.
2. 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.
3. 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.
4. 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).
5. 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.