MERN Stack

A Comprehensive Index to Mastering MERN Stack: Your Ultimate Resource Guide

By the Domain India teamPublished 8 min read
Knowledge base article
Contents (8 sections)

The MERN stack (MongoDB, Express, React and Node.js) lets you build a complete web application in one language, JavaScript, from the database query to the button on the screen. This page is a roadmap and resource index: what each part does, what to learn first, how to set up a modern project in 2026, which tutorials on this knowledge base to follow, and where to run the finished app.

Key takeaways

Learn JavaScript properly first, then React (with Vite, not Create React App), then Node.js with Express 5, then MongoDB with Mongoose. Build one small full-stack app end to end before anything bigger. For hosting, the Domain India App Platform runs Node.js apps and detects them automatically but includes PostgreSQL rather than MongoDB, so pair it with a hosted MongoDB such as Atlas; on a VPS you can run everything yourself.

1. What each part of MERN does

LayerTechnologyIts job
DatabaseMongoDB (usually with Mongoose)Stores data as JSON-like documents
APIExpress on Node.jsReceives HTTP requests, applies rules, reads and writes the database
RuntimeNode.jsRuns JavaScript on the server
InterfaceReactBuilds the pages and components the user sees in the browser

A typical request flows like this: the React app calls an API route such as /api/orders, Express checks the user and the input, Mongoose queries MongoDB, and the result goes back to React as JSON.

2. Is MERN the right choice?

MERN suits
  • Teams that want one language across front end and back end
  • Apps with flexible or changing data shapes
  • Interactive dashboards, internal tools and single-page apps
  • Real-time features, using WebSockets alongside the API
Consider something else when
  • Your data is strongly relational (accounts, invoices, stock): PostgreSQL or MySQL is usually a better fit
  • Search engines must see every page's content: a framework with server rendering, such as Next.js, helps
  • The site is mostly content: a CMS or a static site is simpler

Swapping MongoDB for PostgreSQL gives you a "PERN" stack with the same Express and React skills. Choosing between PostgreSQL, MySQL, SQLite and MongoDB compares them.

3. What to learn, in order

  1. HTML, CSS and JavaScript.
    Solid JavaScript comes first: functions, arrays and objects, modules, and especially promises and async/await. Follow the JavaScript roadmap from fundamentals to expert.
  2. The command line and Git.
    You will use a terminal and version control every day.
  3. React.
    Components, props, state, hooks, forms and fetching data from an API. Create projects with Vite.
  4. Node.js and Express.
    Routes, middleware, error handling, environment variables and a clean folder structure.
  5. MongoDB and Mongoose.
    Documents and collections, schemas, validation, indexes and relationships between documents.
  6. Authentication.
    Password hashing, sessions or tokens, and role checks on the server.
  7. Deployment.
    Environment variables, builds, logs and a production database.

Build something small at each step. A to-do list, a notes app or an event list covers most of what you need before you attempt a larger project.

4. Setting up a modern MERN project

Install the current Node.js LTS release (Node.js 24 in September 2026) from nodejs.org or with a version manager such as nvm. Then create the API and the React app in one project:

bash
mkdir my-app && cd my-app
npm init -y
npm install express mongoose
npm create vite@latest client -- --template react

A minimal Express server that reads its settings from the environment:

javascript
// server.js (add "type": "module" to package.json)
import express from 'express';
import mongoose from 'mongoose';

const app = express();
app.use(express.json());

app.get('/api/health', (req, res) => res.json({ ok: true }));

await mongoose.connect(process.env.MONGODB_URI);
const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => console.log(`API on port ${port}`));

For the database, a free MongoDB Atlas cluster is the quickest start; MongoDB Community Edition on your own computer also works. Keep the connection string in an environment variable, never in your code or in Git.

Create React App is deprecated, so don't follow tutorials that start with npx create-react-app. Express 5 is the current major version, and its route syntax differs slightly from Express 4, so check that a tutorial's examples match.

5. Tutorials on this knowledge base

Work through these in order:

Going further: modern Next.js App Router patterns for server rendering, and modern Node.js with Hono and Bun for lighter APIs.

6. Production checklist

Before real users arrive:

  • Configuration: every secret and connection string in environment variables; NODE_ENV=production.
  • Security: validate all input on the server, hash passwords with bcrypt or argon2, set secure HTTP headers (for example with Helmet), restrict CORS to your own domain, and rate-limit login routes.
  • Database: add indexes for the fields you query, restrict database access to your app, and set up backups (check which backups your Atlas tier includes; on your own server, schedule mongodump).
  • Front end: serve the built React files, not the development server.
  • Operations: log errors somewhere you will read them, and on a VPS keep the app running with a process manager such as PM2 or systemd.

7. Where to run a MERN app on Domain India

OptionNode.js appMongoDBBest for
App PlatformDetected automatically from package.json; deploy with Deploy Now or a deploy tokenNot included (PostgreSQL is); use a hosted MongoDB such as AtlasMost MERN apps
VPSYou install and run itYou install and run it on the same serverFull control, background services, your own database
cPanel or DirectAdmin shared hostingThe panel's Node.js tool, for small appsNot provided; ask support before relying on an external databaseSmall APIs next to an existing website

On the App Platform, your app must listen on the PORT environment variable and bind to 0.0.0.0, as in the example above. Atlas accepts connections only from addresses on its access list; ask support which outbound address to allow. A VPS is self-managed and comes without a control panel. Jailed SSH access is available on every shared hosting plan (cPanel, DirectAdmin, Webuzo); it is off by default, so ask support to enable it for your account.

App Developer
₹250/mo + GST
  • 512 MB RAM per app
  • 1.5 GB RAM total
  • 2 vCPU
  • 10 GB NVMe SSD
See plan details
VPS Starter
₹552.65/mo + GST
  • 1 vCPU
  • 2 GB DDR4 RAM
  • 64 GB NVMe SSD Storage
  • 2 TB Monthly Bandwidth
See plan details

Prices on the cards are Domain India list prices and exclude 18% GST.

Frequently asked questions

What is the MERN stack?

MERN stands for MongoDB, Express, React and Node.js. MongoDB stores the data, Express on Node.js provides the API, and React builds the interface in the browser, so the whole application is written in JavaScript.

What should I learn before the MERN stack?

Learn HTML, CSS and JavaScript well first, especially functions, arrays and objects, modules and async/await. Basic command-line skills and Git are also needed before you start with React, Express and MongoDB.

Should I use Create React App for a new MERN project?

No. Create React App is deprecated. Create the React part of a new project with Vite instead, or use a framework such as Next.js if you need server rendering.

Can I host a MERN app on the Domain India App Platform?

Yes. The App Platform detects Node.js apps automatically and serves them over HTTPS. It includes a PostgreSQL database rather than MongoDB, so use a hosted MongoDB such as MongoDB Atlas and put its connection string in an environment variable.

Can I run MongoDB on Domain India shared hosting?

MongoDB is not provided on shared hosting. Use a VPS, where you can install MongoDB yourself, or a hosted MongoDB service with the App Platform.

Is MongoDB always the right database for a MERN app?

No. MongoDB suits flexible, document-shaped data. For strongly relational data such as accounts, invoices and stock, PostgreSQL or MySQL is usually a better fit, and Express and React work the same way with them.

Ready to build? Start with the event management MERN tutorial, then deploy it on the App Platform or a VPS.

Deploy your MERN app

Node.js apps are detected and built automatically, with free SSL and zero-downtime deploys.

See the App Platform

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
MERN Stack Roadmap 2026: Learn, Build and Deploy