π 곡λΆνλ μ§μ§μνμΉ΄λ μ²μμ΄μ§?
[E-Commerce App with Fullstack] (5) React Setup λ³Έλ¬Έ
π©π» λ°±μλ(Back-End)/Node js
[E-Commerce App with Fullstack] (5) React Setup
μ§μ§μνμΉ΄ 2023. 5. 1. 23:53728x90
λ°μν
<λ³Έ λΈλ‘κ·Έλ Techinfo YT μ μ νλΈλ₯Ό μ°Έκ³ ν΄μ 곡λΆνλ©° μμ±νμμ΅λλ€ :-)>
=> Mern stack Ecommerce App Lets Build And Deploy Mern Stack Project full-stack development
βοΈ React Setup
npx create-react-app client
cd client
npm start
π publish/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
π src/components/Layout/Footer.js
import React from "react";
const Footer = () => {
return (
<>
<h1>Footer</h1>
</>
);
};
export default Footer;
π src/components/Layout/Header.js
import React from "react";
const Header = () => {
return (
<>
<h1>Header</h1>
</>
);
};
export default Header;
π src/components/Layout/Layout.js
import React from "react";
import Header from "./Header";
import Footer from "./Footer";
const Layout = (porps) => {
return (
<div>
<Header />
<main>{porps.childeren}</main>
<Footer />
</div>
);
};
export default Layout;
π src/App.js
import "./App.css";
import Layout from "./components/Layout/Layout";
function App() {
return (
<>
<Layout>
<h1>Ecommerce App</h1>
</Layout>
</>
);
}
export default App;
π src/index.css
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&display=swap');
* {
margin:0;
padding:0;
box-sizing: border-box;
}
π Routes Componentλ₯Ό ꡬν
npm i react-router-dom
728x90
λ°μν
'π©βπ» λ°±μλ(Back-End) > Node js' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[E-Commerce App with Fullstack] (7) Category API (0) | 2023.05.15 |
---|---|
[E-Commerce App with Fullstack] (6) Client Setup (1) | 2023.05.15 |
[E-Commerce App with Fullstack] (4) Admin Check (0) | 2023.04.30 |
[E-Commerce App with Fullstack] (3) Login API (0) | 2023.04.30 |
[E-Commerce App with Fullstack] (2) MongoDB Setup & Register API (0) | 2023.04.28 |
Comments