Ben Keirl logo

NextJS User CRUD

User management system built with NextJS, NextAuth.js and MongoDB.

NextJS User CRUD icon

OVERVIEW

Shortly after I started learning NextJS, I knew that the technology would be perfect for web apps. Being fast, modern and great for complex interactions, I started to think of ideas I could build with it.

Most of these ideas involved a user CRUD aspect. A user would need to be able to login to an account area, save data about themselves and be able to log out or delete their data.

I found there weren't really any pre-built solutions that existed so that lead me to create this project. I built it with a boilerplate-type of use case in mind, so the final visuals and aesthetics aren't as polished as I would normally make them. It is just intended to establish most of the backend functionality, so that it can be copied for future projects and styled according to the individual project.

A user is able to:

  • Sign up
  • Login
  • Save information about themselves (text and date inputs, and an image upload for their profile picture)
  • Delete their account
  • Log out
  • See other user profiles (restricted access if they don't have administrator privileges)

This project was an important first-step to allow bigger projects to be created. Using this as a base for a user CRUD system means it's quicker for me to setup and start working on new web apps which require user logins.

I used NextAuth.js which handled a lot of the user login and session persistence needed for this project. User data is stored in MongoDB and passwords are hashed for protection. User-uploaded profile images are stored in Imagekit which offers free hosting for files and a React API.

Skills

NextJS

Industry

Web Development

Deliverables

Web app

Date

June 2023

Slide gallery thumbnail

Slide gallery thumbnail

Login form

Slide gallery thumbnail

User profile

Slide gallery thumbnail

Edit profile fields

Slide gallery thumbnail

Profile deletion

Slide gallery thumbnail

Manage users (admin only)

Slide gallery thumbnail

Differences between viewing another user as subscriber or admin.

Focusing on the backend functionality of a user CRUD with this project, means it will be much quicker for myself to build bigger and more polished web apps in the future.


Sticky contact icon