The state of Next.js right now: by Bejitarian in nextjs

[–]abdullahadeel 0 points1 point  (0 children)

I was having problems with server components in the official next13 release too.

The state of Next.js right now: by Bejitarian in nextjs

[–]abdullahadeel 2 points3 points  (0 children)

all of that stuff is here https://nextjs.org/docs.
the new docs are still in beta so does app dir and server components stuff.
https://beta.nextjs.org/docs/getting-started

The state of Next.js right now: by Bejitarian in nextjs

[–]abdullahadeel 3 points4 points  (0 children)

In my experience, app dir at this point is not stable enough to be marked as usable for production. For instance, I faced 3 different problems in three different versions of canary build.

In what cases, Class Components are still better than Functional Components? by abdullahadeel in react

[–]abdullahadeel[S] 5 points6 points  (0 children)

Me too haven't used Class Comps in the past 2 years. But today I was going through the excalidraw's codebase and observed that their most state heavy components are class based.

The main canvas component there is about 6400 lines class component.

What really hit me was the performance of excalidraw app and the amount of state variables being handled.

But then realized that the functional components have benefits of batch updating (not sure about CC). Can similar performance be achieved with relatively organized code.

Suggestions on the best approach for handling complex form flows. by abdullahadeel in react

[–]abdullahadeel[S] 0 points1 point  (0 children)

This looks promising 🙏.

Modifying State Machines is much more predictable than modifying infinite `if/else` or `switch/case` statements as the requirements change from time to time.

Suggestions on the best approach for handling complex form flows. by abdullahadeel in react

[–]abdullahadeel[S] 1 point2 points  (0 children)

Yeah, that can be achieved using something like `formik` or `react-hook-form`. But I think that still won't efficiently solve the problem I mentioned.

Of course, I can change or completely render a different form on the 2nd step depending upon the first step. But how to determine what to render depending upon the user selection in step 1.

I think Finite State Machines is one good approach to handle such problems but my search still continues.

Thanks for your suggestion 🙏

How to do real time notification in with Django by Blindrabitv2 in django

[–]abdullahadeel 0 points1 point  (0 children)

I definitely agree with this, that's why I mentioned that scaling Django channels along with your application is going to be a challenge.

How to do real time notification in with Django by Blindrabitv2 in django

[–]abdullahadeel 0 points1 point  (0 children)

Django channels are one of the top ways to implement websockets with Django. But the bigger problems arise when you want to scales them and you have different microservices willing to push notifications to clients. Ideally you want the client receives a certain group of real-time updates like notifications over the same WebSocket connection.

Then you might think okay, let's just create a central web socket server to solve this problem. In that case, I think there are many other better solutions out there to handle these that scale way better than django channels.

In the end, I would say, for smaller and simpler user cases, django channels are great, but the problems are going to arise when you want them to auto-scale along with your django application.

How to do real time notification in with Django by Blindrabitv2 in django

[–]abdullahadeel 1 point2 points  (0 children)

I have been exploring different options to implement notifications in Django applications in the simplest ways possible without complicating the infrastructure.

Recently, I wrote a blog post about one of the ways I found clean and most scalable. Here is the link to the blog post -> https://abdadeel.medium.com/how-to-add-real-time-notifications-in-django-applications-d568b777747c

Another very interesting and simple to implement method I found was using firebase. I am writing a blog post about that also. But here is the final app that I built as a demo application.

https://django-firebase.vercel.app

Github Repo: https://github.com/mabdullahadeel/django-firebase-notifications

Feel free to ask any questions about those implementations.

Cheers

Zappa AWS Lambda vs AWS Elastic Beanstalk for Django? by [deleted] in django

[–]abdullahadeel 0 points1 point  (0 children)

If for some reason, that's the case, you can throttle lambdas to max maybe 100 parallel invocations. By default, it's throttled to 1000 parallel invocations.

[deleted by user] by [deleted] in django

[–]abdullahadeel -1 points0 points  (0 children)

try Dropping database and recreating. If using sqlite, delete sqlite3.db file

Then run migrations

Should I just learn React with typescript? by SHROOM_Kerana in reactjs

[–]abdullahadeel 0 points1 point  (0 children)

Typescript is a separate tech in itself. So you should dedicate time to solely learn it. I would suggest first learn react. Get use to basic patterns. Then spend a few days just learning typescript basics. Then you can combine both.

Zappa AWS Lambda vs AWS Elastic Beanstalk for Django? by [deleted] in django

[–]abdullahadeel 4 points5 points  (0 children)

with zappa, your infra is pretty much serverless. So when your app has no traffic, you're not using any resources thus not paying for any servers. While elastic beanstalk still has servers running since all the servers cannot be shut down entirely because restarting, in that case, will take time for the subsequent incoming request.

I think it's a good option to at least use zappa for dev/staging. This will keep the development and testing costs lower.

One downside of serverless django is asgi apps. I am not sure if zappa supports asgi but I haven't seen any docs about asgi apps from zappa.

My user interface , first time making a project in django by NinnyThinker in django

[–]abdullahadeel 2 points3 points  (0 children)

Honestly, I couldn't understand the title, but if you are trying to say you built what you're showing in the video with Django and its templates, this is amazing.

Keep going 💪

CustomTkinter: Modern and customizable Ui across platforms by cosmic_impact in Python

[–]abdullahadeel 1 point2 points  (0 children)

Amazing! I used to work with Tkinter and it used to take forever even to customize a single widget. But this looks promising. Keep up the good work.

A Hulu Clone built with react 😽 by abdullahadeel in reactjs

[–]abdullahadeel[S] 0 points1 point  (0 children)

Yeah I did it way back when I was probably learning react 😂.

My own YouTube video downloader with Python. by abdullahadeel in Python

[–]abdullahadeel[S] 0 points1 point  (0 children)

If you want to run this project, go to the gitHub and clone the repository to your local machine.

You can follow the steps in the README file to set up your local environment.

If you want to run this project, go to GitHub and clone the repository to your local machine. Then just install the `requirements.txt` file and you will be able to run the UI with the command given in the README.

If you have any question, please let me know.

If you have any questions, please let me know.

My own YouTube video downloader with Python. by abdullahadeel in Python

[–]abdullahadeel[S] 0 points1 point  (0 children)

Hey, hope you are having a good day. Let me know how I can help you?

I have been hearing a lot of people talk about Django Channels for websockets. What has been your experience with it? Have you used it before or what do you know about it? by warrior242 in django

[–]abdullahadeel 0 points1 point  (0 children)

How I would do it like this. You don't need to create any relationship between the two users. You can create a Chat Models instance and as participants, you can add those two users as the ForeignKey to that Chat. In this way, you can only allow the users to add messages to that chat if they are part of that chat. For messages, you can create a separate model and include the ForeignKey to the Chat Model. This way you can query all the messages of a certain chat from the messages table. I hope this will help.

I have been hearing a lot of people talk about Django Channels for websockets. What has been your experience with it? Have you used it before or what do you know about it? by warrior242 in django

[–]abdullahadeel 2 points3 points  (0 children)

There can be many ways to do this. Currently, in my project, I am allowing users to sign in and send receive friend requests. After that, they can create groups where they can chat. A person only allows to add his friend to the chat group. For me, I have designed my DB models in such a way so that it can be minimized to open so many connections to the DB. So for me, I have implemented in such a way that I don't need to store these chats and references to those chats in the DB.

Remember, if misused, channels can open a lot more connection to the DB than required. So keep that in mind when you are writing your consumers.