Frontend Feedback App | by MV ( Next.js - postgreSQL )
Design comparison
Solution retrospective
This project was developed using Next, Tailwind, and Postgres (PRISMA). While I tried to maintain the original idea offered by Frontend Mentor, as I progressed towards a more developed and functional full-stack application, I had to change certain aspects of the application, as well as add certain functionalities that wouldn’t exist otherwise. I am proud of how I used Next’s Server Actions to replace the use and creation of an API, as well as the integration with Postgres and the handling of data in the database. Special attention was also paid to accessibility and responsiveness.
What challenges did you encounter, and how did you overcome them?The configuration of authv5 was especially difficult, mainly because it forced me to switch from using Postgres directly to using Prisma (due to issues with the edge runtime and certain modules that the pg library used). Additionally, not involving an API made it challenging to adapt the way form behaviors and data loading were handled at the beginning. Also, to avoid radically changing the behavior and original data provided in the project, some actions are executed with a bit of ‘brute force’ to mitigate certain behaviors that would conflict with the new additions as a full-stack project. And, of course, naming things
What specific areas of your project would you like help with?All help, feedback , advice, and critiques are welcome! Especially regarding the authorization and database management parts. :)
Community feedback
- @brunomoletaPosted 4 months ago
Ciao Marcos,
I forked you repo locally, and the first issue that I ran was:
after setting the local
DATABASE_URL
at.env
, runningprisma generate
and starting the app, The moment where you try to register an account, the app returns:ClientFetchError: There was a problem with the server configuration. Check the server logs for more information. Read more at [https://errors.authjs.dev#autherror] (https://errors.authjs.dev/#autherror)
Which ends up at the page:
http://localhost:3000/api/auth/error
Good job setting this error page, because it's not rare that people don't think about the case where the server is off.
I want to know how you went about this integration with the server. It feels strange for a "normal dev" in the sense that when I saw the error, I wanted to test the API at Postman, but then I read the code a bit more and noticed that it's all Next.js. I did not know this was possible.
So please explain how this integration works if you'd like.
Marked as helpful0@Dantalian5Posted 4 months ago@brunomoleta Hi Bruno, as always, it’s a pleasure to have you on board. I’m sorry for the problems you’ve encountered. I believe they are entirely due to the very poor documentation I wrote, in addition to not specifying the setup steps clearly. I have recreated everything from scratch, and the errors occurred due to not initializing Prisma and the auth_secret. I have updated the steps on GitHub, please do not hesitate to contact me if the problem persists.
OK, let’s talk about Next.js :) This was my first project of this magnitude using Next.js, and it has truly been surprising. When you start with the documentation, Next.js introduces “server actions,” which can replace API routes in certain scenarios. These are functions that run exclusively on the server, so the client cannot access the data of the function, only the explicit results of it, just as they would with an API call.
In my case, all interactions with the database, authentication processes, and heavy calculations are carried out through these server actions, ensuring security and speed. Unlike an API, only the specific page in question can access these functions, making them more secure but less shareable. P.S.: I believe the best option is a mix of both when using Next.js, but it seemed more complex to structure.
0@brunomoletaPosted 3 months ago@Dantalian5
Hi Marcos, thanks for replying and sharing the knowledge about Next.js.
I think sometimes we forget documenting because we do the initialization time and time again (and again and again) so it does not feel like it's part of the code itself, right. I feel that way.
I'll be less present in the near future around here, but I'll come back, eventually :D
Best regards from Brazil, Bruno :)
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord