GitXplorerGitXplorer
r

YelpCamp-Nextjs

public
0 stars
1 forks
0 issues

Commits

List of commits on branch main.
Unverified
0493393cd5c1c871d0499ebe97ff8a03687b771d

update schema

rragizaki committed 2 years ago
Unverified
7251c049b8a05fe0036ff7c54e01637f70231f6f

abstract Profile view into its own component

rragizaki committed 2 years ago
Unverified
a63acdacd9fe279d4d70ae94e0d372d83d95d9a9

delete migrations

rragizaki committed 2 years ago
Unverified
295bb32dc876ab3f0fa59c5072bccdadf64b6d58

switch localhost for nextauth url

rragizaki committed 2 years ago
Unverified
2fd5d7f04da778b857aad088138975da11420c31

redeploy

rragizaki committed 2 years ago
Unverified
503252bbd5dbf9f7882ddb4b22f965bb033179f8

delete secret

rragizaki committed 2 years ago

README

The README file for this repository.

Yelp Camp (Next.js, TypeScript, Prisma, SQL Stack)

This is a remastered version of my original Yelp Camp application, using Next.js, Prisma and Next-Auth to learn the stack. I've rarely used ORM's before, particularly Prisma, but the idea of mapping databases to JavaScript objects really interested me and I wanted to give it a try. I'll be updating this README occasionally with updates of my ideas, what I think of Prisma, and incoming features.

Features

  • Full authentication flow with NextAuth and client credentials
  • CRUD functionality for campsites
  • Deleting, creating and reading reviews
  • Image uploading with Upload.io

Users have the ability to:

  • Create, update and delete campsites
  • Leave comments and rate other campsites
  • Access a list of their posts
  • Register / login seamlessly

What I Learned

  • Handle image uploads with Next.js
  • Authenticate and authorize users
  • ORM for the database
  • Typesafe database queries with Prisma
  • Deployment with Vercel

Prisma

This project was one of my first times using ORM's at all, and I really enjoyed Prisma. It gives fully type-safe queries and an intuitive way of thinking of relations with objects. The autocompletion is really nice and I caught a lot of dev mistakes early with TypeScript.

Nextjs

Next has been really nice to work with. The performance time is incredible, and the reload and compile times during development are noticeably better than CRA. Furthermore, due to its popularity, I found a lot of good documentation and compatability with external libraries, like Chakra UI and Next-Auth. The routing is really intuitive, and creating dynamic routes are seamless too. It definitely makes creating fullstack apps easier than vanilla React. There's some nuanced syntax you have to get used to, like getStaticProps, but overall it was a great experience.

NextAuth

I have mixed feelings with NextAuth. This tool does not having amazing support / documentation for client credentials (username and password registration). For this reason, I would suggest only using this authentication library if you intend to support social providers (i.e. Google, Github, Facebook SSO). Otherwise, the client and server functions are easy to use and straightforward, and making checking authentication and getting sessions extremely easy.

Incoming

I want to migrate this project over to Next.js 13 to test out the new app directory. Particularly, I'm interested in using React Server Components to render data on the server for quicker loading times and caching. I also want to try out the new routing system, to have easier loading and error states.