Skip to content

drm317/MongoDBExpressReactNodeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDB Express React NodeJS (MERN) Reference Implementation

This is an example implementation of a restaurant review application using the Express, Node.JS, React and MongoDB (MERN) stack.

The following technologies are used:

  • MongoDB (via Docker container) for the database
  • Express and Node.JS for the backend API
  • React for the client

Prerequisites

The following are required:

  • Docker and Docker Compose
  • Node.JS (tested with v24.6.0)

Running with Docker Compose (Recommended)

The easiest way to run the entire application is using Docker Compose, which will start all services including MongoDB.

Quick Start

  1. Clone the repository
  2. Build and start all services:
docker-compose up --build

This will start:

  • MongoDB container on port 27017
  • Backend API on port 5001
  • Frontend React app on port 3000

Visit http://localhost:3000 to access the application.

Docker Services

  • MongoDB: Local MongoDB instance with persistent data storage
  • Backend: Express.js API server
  • Frontend: React development server

Stopping the Application

docker-compose down

To remove all data and start fresh:

docker-compose down -v
docker-compose up --build

Development Setup (Alternative)

For local development without Docker:

Backend Setup

cd backend
npm install

Required dependencies:

  • express
  • cors
  • mongodb
  • dotenv

Frontend Setup

cd frontend
npm install

Running Locally

  1. Start MongoDB (requires local MongoDB installation)
  2. Start the backend:
cd backend
npm start
  1. Start the frontend:
cd frontend
npm start

The backend runs on port 8000 and frontend on port 3000.

About

MongoDB, Express, Node.JS and React (MERN) reference implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published