DEV Community

Cover image for Blog APP by using MongoDB +NextJs
Sooraj s
Sooraj s

Posted on


Blog APP by using MongoDB +NextJs


Blog App ❤️(Next.js + MongoDB)

Environmental variables

Environmental variables in this project include:

  • MONGODB_URI The MongoDB Connection String (with credentials and database name)
  • WEB_URI The URL of your web app.
  • CLOUDINARY_URL (optional, Cloudinary only) Cloudinary environment variable for configuration. See this.
  • NODEMAILER_CONFIG (optional, if using nodemailer only) JSON stringified nodemailer config. eg. {"service":"Gmail","auth":{"user":"","pass":"sgbxGJjklmYunbbcGHJaSDROpLKg"}}


Start the development server by running yarn dev or npm run dev. Getting started by create a .env.local file with the above variables. See Environment Variables.


This project can be deployed anywhere Next.js can be deployed. Make sure to set the environment variables using the options provided by your cloud/hosting providers.

After building using npm run build, simply start the server using npm run start.

You can also deploy this with serverless providers given the correct setup.


Please see my




Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.