# 5: Authentication and Image Uploading

Before you start the tutorial, follow the getting started steps below

# 5.1 Authentication

The first part of this tutorial looks at authenticating our Room Finder application using the awesome, NextAuth library. Authentication is kind of important; as such, everyone should watch this part of the tutorial.

# 5.2 Image Processing

The second part of this tutorial looks at image processing using the third-party SaS platform, Cloudinary. Image processing can be painful; this part of the tutorial demonstrates how to easily upload, process, optimise and transform images.

Before you start the tutorial, follow the getting started steps below

# Getting Started

  • git clone -b tutorial-5-starter-code https://github.com/joeappleton18/solent-room-finder tutorial-5
  • Navigate into the tutorial-5 folder
  • Install the dependencies: npm install

# Setting up the database

  • Get the connection string of your MongoDB server.In the case of MongoDB Atlas, it should be a string like this (notice how we've added rooms as the database name):

mongodb+srv://<username>:<password>@my-project-abc123.mongodb.net/rooms?retryWrites=true&w=majority

  • If you are running MongoDB locally, it will look something like this:

mongodb://127.0.0.1:27017/rooms

  • Copy the .env.local.example file in this directory to .env.local, which will be ignored by Git)

    • Set your MONGODB_URI with the the MongoDB connection string.
  • Open http://localhost:3000 (opens new window) with your browser to see the result.

  • Run the development server: npm run dev