EthicsComputerCourses
Join training +91 90532 10052

What Is the MEVN Stack?

MEVN Stack · Lesson 1 of 20 Intermediate 11 min read Updated

By the end of this lesson you will be able to name the job of each part of the MEVN stack, trace one click in the browser all the way to the database and back, and say when MEVN is a good choice and when it is not. You will also meet NoteNest, the small notes app that every lesson in this course keeps building.

What you should know first: basic HTML, CSS and JavaScript, and a little of one back-end language. You do not need to know Vue, Express or MongoDB yet. Each part has its own full course on this site: Vue Introduction, Node.js Introduction and MongoDB Introduction. This course does not repeat them. It teaches how the parts fit together.

The four letters

A stack is a set of tools that work together to build one app. MEVN is named after its four main tools:

LetterToolVersion taughtRuns whereIts job in NoteNest
MMongoDB9.0Database serverStores every note as a document
EExpress5Inside Node.js, on the serverReceives HTTP requests and sends JSON back
VVue3.5In the user's browserDraws the screens and reacts to clicks
NNode.js26 LTSOn the serverRuns JavaScript outside the browser

Think of a busy dhaba on a highway near Rohtak. The menu card and the waiter are what the customer sees: that is Vue. The order counter decides what each order needs and passes it on: that is Express. The kitchen building with its power and gas, where all the work happens, is Node.js. The store room full of labelled containers is MongoDB. The customer never walks into the store room. They only talk to the waiter.

Two more words you will see often. The front end (or client) is the part that runs in the browser. The back end (or server) is the part that runs on a computer you control. In MEVN, Vue is the front end, and Express on Node.js with MongoDB is the back end.

Node.js and Express are easy to mix up. Node.js is the runtime: the program that runs JavaScript files on a server. Express is a library: code you install into a Node.js project to handle web requests more easily. You can run Node.js without Express, but not Express without Node.js.

One language, one data shape

The biggest reason people choose MEVN is that one language and one data shape run through every layer. You write JavaScript in the Vue components, in the Express routes and even in the MongoDB shell. Data travels as JSON (JavaScript Object Notation), the text format that looks like a JavaScript object.

A note in NoteNest looks like this when the API sends it to the browser:

JSON
{
  "id": "6afa8c734da7997d42e1a368",
  "title": "DBMS viva questions",
  "body": "Normal forms, keys, ACID",
  "tags": ["college"],
  "pinned": true,
  "createdAt": "2026-11-16T04:54:11.222Z",
  "updatedAt": "2026-11-16T04:54:11.222Z"
}

MongoDB stores almost the same shape. It uses BSON, a binary form of JSON with extra types such as dates and ObjectId. There is no translation into rows and columns, as there would be with MySQL. The tags array is stored as an array, and Vue loops over it with v-for.

This does not mean "no rules". A database that accepts any shape will happily store a note without a title. That is why this course uses Mongoose, a library that adds a schema (a list of allowed fields and types) on the server. You will build it in MongoDB & Mongoose Models.

Follow one request

Here is what happens when Priya opens NoteNest and filters her notes by the tag "college":

Text
Browser (Vue)                    Server (Node.js + Express)             MongoDB
-------------                    --------------------------             -------
1. Priya clicks the tag
2. fetch('/api/notes?tag=college')
       |--------- HTTP GET ------------>  3. Route GET /api/notes
                                            reads req.query.tag
                                          4. Note.find({ tags: 'college' }) ---->
                                                                         5. finds the
                                                                            matching
                                          6. gets the documents <---------  documents
       <-------- JSON response -------  7. res.json({ notes })
8. Vue stores the notes in a ref
9. the list on screen updates

The browser never talks to MongoDB directly. It only sends HTTP requests to your API. This is a security rule, not a style choice. To connect to a database you need its address and password, and anything you ship to the browser can be read by any visitor. So the password stays on the server, inside an environment variable.

Here is the real request and response from step 2 and step 7, captured from the finished NoteNest server of this section:

HTTP
GET /api/notes?tag=college HTTP/1.1
Host: localhost:3000
Output
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"notes":[{"id":"6afa8c734da7997d42e1a368","title":"DBMS viva questions","body":"Normal forms, keys, ACID","tags":["college"],"pinned":true,"createdAt":"2026-11-16T04:54:11.222Z","updatedAt":"2026-11-16T04:54:11.222Z"}]}

(The server also sends security headers and a few others; they are left out here to keep it short.)

The list of URLs, methods and JSON shapes that the front end and back end agree on is called the API contract. Most bugs in a full stack app happen at this boundary: the server sends _id but Vue reads id, or the server sends an error as plain text while Vue expects JSON. This course writes the contract down early and keeps both halves faithful to it.

Meet NoteNest

NoteNest is a personal notes app. Each note has a title, a body, a list of tags and a pinned flag. Pinned notes always appear first. By the end of the course it will also have accounts, login, image attachments, tests and a live deployment.

The API grows lesson by lesson:

Method and pathWhat it doesBuilt in
GET /api/healthSays the server is upSet Up Your MEVN Environment
GET /api/notesLists notes, pinned first, optional ?tag=Build a REST API with Express 5
GET /api/notes/:idReturns one noteBuild a REST API with Express 5
POST /api/notesCreates a noteBuild a REST API with Express 5
PATCH and DELETE /api/notes/:idEdits or removes a noteCRUD Endpoints & Validation
/api/auth/...Sign up, log in, log outAuthentication with JWT & Cookies

You can already try the front half. The example below is a tiny Vue page. Instead of calling a real server, it fetches a data: URL that holds exactly the JSON the NoteNest API returns. Everything after the fetch is the same code a real client would run.

HTMLOpen in editor
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>NoteNest preview</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@3.5.44/dist/vue.global.prod.js"></script>
  <style>
    body { font-family: system-ui, sans-serif; margin: 16px; max-width: 32rem; }
    .note { border: 1px solid #ccc; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; }
    .pinned { border-color: #42b883; background: #f0faf5; }
    .tag { background: #eee; border-radius: 4px; padding: 0 6px; margin-right: 4px; font-size: 0.85rem; }
    button { margin-right: 6px; }
  </style>
</head>
<body>
  <div id="app">
    <h1>NoteNest</h1>
    <p>
      Filter:
      <button type="button" @click="tag = ''">All</button>
      <button type="button" v-for="t in allTags" :key="t" @click="tag = t">{{ t }}</button>
    </p>
    <p v-if="loading">Loading notes...</p>
    <article v-for="note in shown" :key="note.id" class="note" :class="{ pinned: note.pinned }">
      <h2>{{ note.pinned ? 'Pinned: ' : '' }}{{ note.title }}</h2>
      <p>{{ note.body }}</p>
      <span class="tag" v-for="t in note.tags" :key="t">{{ t }}</span>
    </article>
  </div>

  <script>
    // The same JSON shape that GET /api/notes returns
    const apiResponse = {
      notes: [
        { id: "6afa8c734da7997d42e1a368", title: "DBMS viva questions", body: "Normal forms, keys, ACID", tags: ["college"], pinned: true },
        { id: "6afa8c734da7997d42e1a369", title: "Sunday groceries", body: "Atta 5 kg, toor dal, curd", tags: ["home"], pinned: false },
        { id: "6afa8c734da7997d42e1a36a", title: "Train to Jaipur", body: "PNR 4521378690, coach B2", tags: ["travel", "home"], pinned: false }
      ]
    };
    const url = "data:application/json," + encodeURIComponent(JSON.stringify(apiResponse));

    Vue.createApp({
      data() {
        return { notes: [], tag: "", loading: true };
      },
      computed: {
        allTags() {
          return [...new Set(this.notes.flatMap((n) => n.tags))].sort();
        },
        shown() {
          return this.tag ? this.notes.filter((n) => n.tags.includes(this.tag)) : this.notes;
        }
      },
      async mounted() {
        const res = await fetch(url);
        const data = await res.json();
        this.notes = data.notes;
        this.loading = false;
      }
    }).mount("#app");
  </script>
</body>
</html>

Click "home" and two notes stay: "Sunday groceries" and "Train to Jaipur". In the real app the server filters, so the browser never downloads thousands of notes it will not show.

MEVN, MERN or MEAN?

The three stacks share MongoDB, Express and Node.js. Only the front-end framework changes.

StackFront endFeels likeGood fit
MEVNVue 3HTML templates with extra attributes such as v-if and v-forTeams who like readable templates and a gentle learning curve
MERNReactEverything in JavaScript with JSXTeams already using React, very large hiring pool
MEANAngularA full framework with TypeScript, forms and HTTP built inLarge teams who want strict structure

The back end you write in this course would work unchanged behind a React or Angular front end, because it only speaks JSON over HTTP.

MEVN is a weaker fit in two cases. If your data is strongly relational, such as invoices, ledgers and stock with many joins and strict totals, a SQL database is usually better (see the PostgreSQL tutorial). If every page must be indexed by search engines on first load, a plain single-page Vue app needs extra work, and a framework that renders on the server, such as Nuxt, helps (see Nuxt Overview).

Common mistakes

  • Connecting to MongoDB from Vue code. Any secret in browser code is public. Only the server talks to the database.
  • Thinking Express and Node.js are the same thing. Node.js runs the code; Express is a library you add for routing and middleware.
  • Believing MongoDB means "no structure". You still need rules. Mongoose schemas and server-side validation provide them.
  • Not writing down the API contract. If each half guesses the other's JSON shape, bugs appear at the boundary. Agree on paths, fields and the error shape first.

Interview questions

1. What does each letter in MEVN stand for, and where does each part run?

MongoDB is the database server, Express is the web framework, Vue is the front-end framework and Node.js is the JavaScript runtime. Vue runs in the browser. Express runs inside Node.js on the server, and MongoDB runs as its own database server that only the Node.js app connects to.

2. Why should the browser never connect to MongoDB directly?

A database connection needs credentials, and everything sent to the browser can be read by users. A direct connection would also let anyone run any query. The Express API stands in between, checks every request and exposes only the operations the app needs.

3. What is an API contract in a full stack app?

It is the agreement between front end and back end: which URLs and HTTP methods exist, what JSON each one accepts and returns, which status codes it uses and what an error looks like. Writing it down lets both halves be built and tested separately.

4. How is MEVN different from MERN?

Only the front end changes: MEVN uses Vue and MERN uses React. The Express API and MongoDB layer can be identical, because the front end only talks to the back end through HTTP and JSON.

Key points

  • MEVN is MongoDB (database), Express (web framework), Vue (front end) and Node.js (server runtime).
  • JavaScript runs in every layer and data travels as JSON, which MongoDB stores as BSON documents.
  • The browser talks only to the Express API; database credentials never leave the server.
  • The API contract (paths, methods, JSON shapes, errors) is where most full stack bugs appear, so write it down.
  • NoteNest, a notes app with tags and pinned notes, is the running example for the whole course.
  • MEVN suits document-shaped data; strongly relational data or SEO-first pages may need another stack or Nuxt.

Exercise

Ananya is building a hostel complaint app for her college in Pune with MEVN. Students post complaints with a room number, a category and a description, and the warden marks them resolved. Write down (1) which part of the stack does each of these jobs: showing the complaint form, checking that the room number is present, storing the complaint, and running the server code; (2) a first API contract with at least three endpoints; (3) the JSON for one complaint as the API would send it.

Show solution

Vue shows the form in the browser. Express checks the room number on the server (Vue may also check it, but only the server check can be trusted). MongoDB stores the complaint. Node.js runs the Express code.

Method and pathPurpose
GET /api/complaintsList complaints, newest first, optional ?status=open
POST /api/complaintsCreate a complaint
PATCH /api/complaints/:idMark a complaint resolved
JSON
{
  "complaint": {
    "id": "6afa8c734da7997d42e1a370",
    "room": "B-214",
    "category": "water",
    "description": "No water in the bathroom since morning",
    "status": "open",
    "createdAt": "2026-11-16T05:10:00.000Z"
  }
}

The response wraps the object in a complaint key, the same way NoteNest wraps a note in note, so the server can add more keys later without breaking the client.

Quick Quiz

1. In a MEVN app, which part runs in the user's browser?

2. Why does the Vue client call the Express API instead of MongoDB?

3. What is the difference between Node.js and Express?

4. What changes between MEVN and MERN?

Learn MEVN Stack with a mentor

Free lessons get you started. Our Full Stack Web Development training adds real projects and code reviews from working developers.

  • Project-based learning
  • Mentor code reviews
  • Free counselling call