Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

Comments - TS | NextJS | trpc | prisma | mySQL | zustand | NextAuth

next, typescript, zustand, mysql
Maksim Baravy•220
@maximkatut
A solution to the Interactive comments section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Fully working comments section with CRUD functionality based on NextJS with TS.

  • Ability to add, edit, delete comments, reply to comments
  • Change ratings on comments that are not yours. Changed approach with rating functionality: you can rate +1 or -1 now.
  • All changes go to DB, such as comments, users, and rates through Prisma and trpc on the backend
  • Used Zustand for global storage
  • Added NextAuth authentication with Google and GitHub providers and the information of the user also goes to DB.

Very interesting project, with many new tools, which took a lot of time exploring documentation and examples. This was my first experience working with the database. And I've learned so many things.

Question:

  • When trpc SSR is true, can't get user and that broke render flow. Should I get user in getServerSideProps?
Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Maksim Baravy's solution.

Join 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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License