React & Redux Desktop shopping basket
application
Composes a large number of components into pages and manages complexity.
โ Implement the ๏ธ 'Desktop Target' web app and think about the 'UI/UX considering revisiting' without interruption leading to purchases.
โ Use 'Redux' based on 'Flux Architecture' for ๏ธ status management.
โ Consider switching multiple pages using the ๏ธ 'Router'.
โ Refer to the ๏ธ Baemin Chamber of Commerce Service
๐ How to run the Server
# npm
cd server
npm install
npm run server
๐ How to run the Client
# npm
cd client
npm install
npm run dev
{
"response" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg"
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg"
}
]
}
method
uri
POST
/products
{
"requestBody" : {
"products" : {
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg"
}
}
}
method
uri
GET
/products/{id}
{
"response" : {
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg"
}
}
method
uri
DELETE
/products/{id}
Check shopping basket item list
{
"response" : {
"id" : 1 ,
"product" : {
"name" : " test" ,
"price" : 1234 ,
"imageUrl" : " test.com" ,
"id" : 1
},
},
{
"id" : 5 ,
"product" : {
"name" : " tes11111t" ,
"price" : 1234 ,
"imageUrl" : " test.com" ,
"id" : 10
}
},
}
Add shopping basket items
{
"requestBody" : {
"product" : {
"id" : 10 ,
"name" : " tes11111t" ,
"price" : 1234 ,
"imageUrl" : " test.com"
}
}
}
Single Delete Shopping Basket Item
method
uri
DELETE
/carts/{cartId}
Add Order (to place an order)
{
"requestBody" : {
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
}
}
Order list (details) inquiry
{
"response" : [
{
"id" : 1 ,
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
},
{
"id" : 2 ,
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
}
]
method
uri
GET
/orders/{id}
{
"response" : {
"id" : 1 ,
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
}
}
React & Redux ๋ฐ์คํฌํ ์ฅ๋ฐ๊ตฌ๋ ์ ํ๋ฆฌ์ผ์ด์
๋ค์์ ์ปดํฌ๋ํธ๋ฅผ ํ์ด์ง๋ก ๊ตฌ์ฑํ๊ณ ๋ณต์กํด์ง ์ํ๋ฅผ ๊ด๋ฆฌํฉ๋๋ค.
โ๏ธ ๋ฐ์คํฌํ ํ๊ฒ
์ ์น ์ฑ์ ๊ตฌํํ๋ฉฐ ๊ตฌ๋งค๋ก ์ด์ด์ง๋ ๊ฒ์ ๋๊น์ด ์๊ณ ์ฌ๋ฐฉ๋ฌธ์ ๊ณ ๋ คํ UI/UX
์ ๋ํด ๊ณ ๋ฏผํด๋ด
๋๋ค.
โ๏ธ ์ํ ๊ด๋ฆฌ๋ฅผ ์ํด Flux Architecture
๊ธฐ๋ฐ์ Redux
๋ฅผ ํ์ฉํฉ๋๋ค.
โ๏ธ Router
๋ฅผ ํ์ฉํด ์ฌ๋ฌ ํ์ด์ง ์ ํ์ ๊ณ ๋ คํฉ๋๋ค.
โ๏ธ ๋ฐฐ๋ฏผ์ํ ์๋น์ค ์ฐธ๊ณ
๐ Server ์คํ ๋ฐฉ๋ฒ
react-shopping-cart/client ๋๋ ํ ๋ฆฌ์์ ์คํํด์ฃผ์ธ์.
# npm
npm run server:first
# yarn
yarn server:first
# npm
npm run server
# yarn
yarn server
{
"response" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg"
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg"
}
]
}
method
uri
POST
/products
{
"requestBody" : {
"products" : {
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg"
}
}
}
method
uri
GET
/products/{id}
{
"response" : {
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg"
}
}
method
uri
DELETE
/products/{id}
์ฅ๋ฐ๊ตฌ๋ ์์ดํ
๋ชฉ๋ก ์กฐํ
{
"response" : {
"id" : 1 ,
"product" : {
"name" : " test" ,
"price" : 1234 ,
"imageUrl" : " test.com" ,
"id" : 1
},
},
{
"id" : 5 ,
"product" : {
"name" : " tes11111t" ,
"price" : 1234 ,
"imageUrl" : " test.com" ,
"id" : 10
}
},
}
์ฅ๋ฐ๊ตฌ๋ ์์ดํ
์ถ๊ฐ
{
"requestBody" : {
"product" : {
"id" : 10 ,
"name" : " tes11111t" ,
"price" : 1234 ,
"imageUrl" : " test.com"
}
}
}
์ฅ๋ฐ๊ตฌ๋ ์์ดํ
๋จ์ผ ์ญ์
method
uri
DELETE
/carts/{cartId}
์ฃผ๋ฌธ ์ถ๊ฐ(์ฃผ๋ฌธํ๊ธฐ)
{
"requestBody" : {
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
}
}
์ฃผ๋ฌธ ๋ชฉ๋ก(๋ด์ญ) ์กฐํ
{
"response" : [
{
"id" : 1 ,
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
},
{
"id" : 2 ,
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
}
]
method
uri
GET
/orders/{id}
{
"response" : {
"id" : 1 ,
"orderDetails" : [
{
"id" : 1 ,
"price" : 10000 ,
"name" : " ์นํจ" ,
"imageUrl" : " http://example.com/chicken.jpg" ,
"quantity" : 5
},
{
"id" : 2 ,
"price" : 20000 ,
"name" : " ํผ์" ,
"imageUrl" : " http://example.com/pizza.jpg" ,
"quantity" : 3
}
]
}
}