Write a prisma.io API in NextJS to register user in MySQL DB

On Google SSO (uses NextAuthJS), check if user email exists in DB if not then register user by writing to DB First Name, Last Name, Email and Avatar URL. If exists then read all user details and display.