Next.js and Bunny CDN: Complete Guide to Image Uploading with Server Actions

This page summarizes the projects mentioned and recommended in the original post on dev.to

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • next-bunny-cdn

    Next.js and Bunny CDN: Using server actions for image uploading

  • Since the tutorial focuses only on image uploading, server actions and using bunny CDN, I won't make a full guide on set up. You can either clone the repository or just setup everything by yourself in the way you like. Just make sure you have a Next.js with app router ready to use before diving deeper 😉

  • nanoid

    A tiny (124 bytes), secure, URL-friendly, unique string ID generator for JavaScript

  • Last thing left is to use our new upload function in our server action. Since I like to upload images in single format and have some more control over them, I will additionally use sharp library. For file name, I'll generate some random string using nanoid:

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • valibot

    The modular and type safe schema library for validating structural data 🤖

  • I'll use Valibot library, which is a pretty new and cool library for schema validation, similar to Zod.

  • sharp

    High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.

  • Last thing left is to use our new upload function in our server action. Since I like to upload images in single format and have some more control over them, I will additionally use sharp library. For file name, I'll generate some random string using nanoid:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Creating Image Optimizer With Rio

    3 projects | dev.to | 6 Dec 2022
  • Sharp – fast image conversion in Node.js

    1 project | news.ycombinator.com | 26 Mar 2024
  • Optimizing Image Display with Blur Placeholder and Lazyload

    1 project | dev.to | 7 Mar 2024
  • Organize the mess of your photo folders with Node

    2 projects | dev.to | 21 Nov 2023
  • Creating Chess Board SVGs, PNGs, and GIFs

    3 projects | dev.to | 10 Nov 2023