A fullstack app built with the MERN stack: actually a tutorial from YouTube, Net Ninja: MERN-STACK TUTORIAL.
This project consists of a frontend built with react and the backend folder consists of a backend server and a database server.
To get started, first install the dependencies separately for both the frontend and backend folders with:
npm i
You can setup the database server online for free with Mongodb Atlas or you can host one locally yourself. You can do so in a few steps.
- Download the mongodb installer for your platform (this only installs the database server). In addition, you can install the cli tool
mongosh
or the GUIMongodb Compass
. - In the root folder of this project run:
cd backend && cd backend && mongod --port 3030 # starts the database server
- Then in a new terminal run:
npm run dev # starts the backend server
At the root folder, run the following to start the react server:
npm run dev
Note: Replace the port number and the mongodb connection string with yours in order to make all this work.