![]() |
VOOZH | about |
In this article, we’ll walk through the step-by-step process of creating a News Media Platform using the MERN (MongoDB, ExpressJS, React, NodeJS) stack. This project will showcase how to set up a full-stack web application where users can view a news article, add a new news article, and delete one.
Preview of final output: Let us have a look at how the final application will look like.
Step 1: Create a directory for project
mkdir Backend
cd Backend
Step 2: Initialized the Express app and installing the required packages
npm init -y
npm i express mongoose cors nodemon
The package.json file of backend will look like:
"dependencies": {
"cors": "^2.8.5",
"express": "^4.18.2",
"mongoose": "^8.2.0",
"nodemon": "^3.1.0"
}
Example : Below is an example of creating a server for New Media platform.
Start your server using the following command.
node index.jsStep 1: Initialized the React App with Vite and installing the required packages
npm create vite@latest -y
->Enter Project name: "Frontend"
->Select a framework: "React"
->Select a Variant: "Javascript"
cd Frontend
npm install
The package.json file of frontend will look like:
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.56",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"vite": "^5.1.4"
}
}
Example: Below is an example of creating a frontend of News Media platform.
Start your frontend application using the following command.
npm run devOutput: