
Dev Forum
Dev Forum
I'm building a Next.js application and want to add authentication. Has anyone implemented NextAuth.js with custom credentials provider? Any example code or best practices would be greatly appreciated.
Our application is facing performance issues with PostgreSQL as our dataset grows. We're currently using standard SELECT queries with multiple JOINs that worked fine with smaller datasets. What strategies should we implement for optimizing these queries?
I'm trying to understand when to use Server Components vs. Client Components in React. What are the best use cases for each, and how do they communicate with each other?
I'm building a feature that allows users to upload images and documents (up to 20MB). What's the best way to handle these uploads securely and efficiently? Should I use direct uploads to S3 or process them through my server?
file-upload
s3
security
web-development
aws_specialist
For files this size, I recommend direct uploads to S3 using presigned URLs. This takes the load off your server and improves user experience. Just make sure to implement proper validation on both client and server sides.
ux_engineer
Consider implementing a chunked upload approach for better user experience, especially for larger files or users with less stable internet connections.