,

Course (MERN Stack) !! The first course by Yahya Tech Down

Posted by

Welcome to the first course of MERN Stack by Yahya Tech! In this course, you will learn how to build full-stack web applications using the MERN (MongoDB, Express.js, React, Node.js) stack. This tutorial will guide you through the basics of setting up your environment and creating a simple MERN stack application. Let’s get started!

Step 1: Setting up your environment
Before you can start building MERN stack applications, you need to set up your development environment. Here are the tools you’ll need:

  1. MongoDB: Install MongoDB on your system. You can download it from the official website and follow the installation instructions.

  2. Node.js and NPM: Node.js is a JavaScript runtime that allows you to run JavaScript on the server side. NPM is a package manager for Node.js that helps you manage dependencies for your projects. You can download Node.js from the official website and it will come with NPM pre-installed.

  3. Express.js: Express.js is a web application framework for Node.js. You can install it using NPM by running the following command in your terminal:

    npm install express
  4. React: React is a JavaScript library for building user interfaces. You can create a new React project using Create React App by running the following command in your terminal:
    npx create-react-app my-app

Step 2: Creating a simple MERN stack application
Now that you have your environment set up, let’s create a simple MERN stack application. In this example, we will create a basic todo list application.

  1. Create a new directory for your project and navigate to it in your terminal:

    mkdir my-mern-app
    cd my-mern-app
  2. Create a new Express.js server in the root of your project:

    touch server.js
  3. Open server.js in your favorite code editor and add the following code to create a basic Express server:
    
    const express = require('express');
    const app = express();

app.get(‘/’, (req, res) => {
res.send(‘Hello, MERN Stack!’);
});

const PORT = process.env.PORT || 5000;
app.listen(PORT, () => {
console.log(Server is running on port ${PORT});
});


4. Install `nodemon` as a development dependency to automatically restart your server when you make changes:

npm install –save-dev nodemon


5. Update the scripts section of your `package.json` file to use `nodemon` to start your server:
```json
"scripts": {
  "start": "node server.js",
  "dev": "nodemon server.js"
}
  1. Create a new React component for your frontend by running the following command in your terminal:

    cd client
    npm start
  2. Update the src/App.js file with the following code to create a basic todo list component:
    
    import React from 'react';

function App() {
return (

My ToDo List

  • Task 1
  • Task 2
  • Task 3

);
}

export default App;


8. Finally, start your server and frontend development server by running the following command in the root of your project:

npm run dev
npm start



Congratulations! You have now created a simple MERN stack application. This is just the beginning of your journey learning MERN stack development. Stay tuned for more advanced tutorials and projects in this course!
0 0 votes
Article Rating
40 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@yehiatech
4 months ago
@salahsallami5522
4 months ago

بتعرف Elzero Web School 0$

@youssefalshfey1565
4 months ago

اي حد معاه الكورس ميستخشروش في حد مش معاه وياريت لو يدهولي يعني الحالة زي ما انت فاهم 😂

@mazencoder9976
4 months ago

غالي ياباش مهندس 😥

@osamaibrahem968
4 months ago

مش عارف اشتري الكورس
بحاول بكارت دفع من فودافون كاش ومش عارف

@English-Stories1190
4 months ago

يودمى بتقبل الفيزا المصرية … لان الفيز مقفولة للدفع بالدولار

@JAWAD-RDWAN
4 months ago

السعر 110 دولار كيف بدك حدا يشتريه احنا كلنا فقراء الكورس لازم ينزل حتى يوصل 70 دولار على الأقل ‏‪

@Dawshashow
4 months ago

لان كلو رغي كلام فاضي

@Dawshashow
4 months ago

ما انصح. بكل الكورسات

@pcglorious3183
4 months ago

صديقي لازم يكون ارخص 🥲 لانو الفئة الموجه الها طلاب وانتى ادرى بحال الطلبة .. بالعموم ربي يرزقك

@mohamedsayed3775
4 months ago

محتاجين انجولار

@Shankes7
4 months ago

اعمللنا كوبون خاصة لغزة بلكي نستغل شنشطة النزوح بحاجة تشغلنا عن هم الحرب

😅

@MOHAMED-ul3xc
4 months ago

هل ينفع ادخل بدون اساسيات م يحيي؟

@mohamedabdou4862
4 months ago

us

@user-ez3wv5eq6v
4 months ago

هل بإمكانك إهدائي هذا الكورس مجاناً وإحسبها زكاة علمك.
حاولت الوصول إليك بشتى الوسائل ولكن للأسف لم أستطع ،حتى حاولت مراسلتك في انستجرام وللاسف حسابك مش بيدعم المراسلة

@user-ez3wv5eq6v
4 months ago

أسلوبك جميل في الشرح ،دولتنا وبعض الدول بسبب الحروب لا نستطيع دفع الرسوم يا حبذا لو هو free للأشخاص المذكورين أعلاه

@loveallah_7900
4 months ago

بعد اذنك يا بشمهندس اكمل full stack ولا لأ وانا دلوقتي مخلص react بس مش متمكن اوي ك front

@XDA7M
4 months ago

بأيي لغه راح اتعلم في الكورس

@Software.x.Engineer
4 months ago

إيه الضحك ده 😂

@scoooooding
4 months ago

اخي دبنا كورس متقدم