From 487ef64d67e49bdfb439b7b6e9b3e5b5424d70e8 Mon Sep 17 00:00:00 2001 From: Climier-code Date: Wed, 16 Jun 2021 17:22:53 +0900 Subject: [PATCH] Revise name moudles->modules & Update README.md --- README.md | 196 ++++++++++++++----- src/components/Bitcoin/ChartCandlesInfo.tsx | 5 +- src/components/News/NewsList.tsx | 4 +- src/components/Stocks/KRStockLoader.tsx | 4 +- src/components/Stocks/StockInfo.tsx | 10 +- src/components/Stocks/USStockLoader.tsx | 4 +- src/index.tsx | 2 +- src/logo.svg | 1 - src/{moudles => modules}/bitcoin/actions.ts | 0 src/{moudles => modules}/bitcoin/index.ts | 0 src/{moudles => modules}/bitcoin/reducer.ts | 0 src/{moudles => modules}/bitcoin/saga.ts | 0 src/{moudles => modules}/bitcoin/types.ts | 0 src/{moudles => modules}/index.ts | 0 src/{moudles => modules}/krstocks/actions.ts | 0 src/{moudles => modules}/krstocks/index.ts | 0 src/{moudles => modules}/krstocks/reducer.ts | 0 src/{moudles => modules}/krstocks/saga.ts | 0 src/{moudles => modules}/krstocks/types.ts | 0 src/{moudles => modules}/news/actions.ts | 0 src/{moudles => modules}/news/index.ts | 0 src/{moudles => modules}/news/reducer.ts | 0 src/{moudles => modules}/news/saga.ts | 0 src/{moudles => modules}/news/types.ts | 0 src/{moudles => modules}/usstocks/actions.ts | 0 src/{moudles => modules}/usstocks/index.ts | 0 src/{moudles => modules}/usstocks/reducer.ts | 0 src/{moudles => modules}/usstocks/saga.ts | 0 src/{moudles => modules}/usstocks/types.ts | 0 29 files changed, 161 insertions(+), 65 deletions(-) delete mode 100644 src/logo.svg rename src/{moudles => modules}/bitcoin/actions.ts (100%) rename src/{moudles => modules}/bitcoin/index.ts (100%) rename src/{moudles => modules}/bitcoin/reducer.ts (100%) rename src/{moudles => modules}/bitcoin/saga.ts (100%) rename src/{moudles => modules}/bitcoin/types.ts (100%) rename src/{moudles => modules}/index.ts (100%) rename src/{moudles => modules}/krstocks/actions.ts (100%) rename src/{moudles => modules}/krstocks/index.ts (100%) rename src/{moudles => modules}/krstocks/reducer.ts (100%) rename src/{moudles => modules}/krstocks/saga.ts (100%) rename src/{moudles => modules}/krstocks/types.ts (100%) rename src/{moudles => modules}/news/actions.ts (100%) rename src/{moudles => modules}/news/index.ts (100%) rename src/{moudles => modules}/news/reducer.ts (100%) rename src/{moudles => modules}/news/saga.ts (100%) rename src/{moudles => modules}/news/types.ts (100%) rename src/{moudles => modules}/usstocks/actions.ts (100%) rename src/{moudles => modules}/usstocks/index.ts (100%) rename src/{moudles => modules}/usstocks/reducer.ts (100%) rename src/{moudles => modules}/usstocks/saga.ts (100%) rename src/{moudles => modules}/usstocks/types.ts (100%) diff --git a/README.md b/README.md index b58e0af..d47f30d 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,150 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `yarn start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -### `yarn test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `yarn build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `yarn eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). +# We go Up! + +> [한강물 측정기](https://hangang.ivlis.kr/) 홈페이지에서 영감을 받아 만든 웹페이지 + +// gif 추가 예정 + +## Project Outline + +- 국내 해외의 증권시장의 상황(주가 및 나라별 뉴스)을 한 곳에서 파악하기 위해 만든 웹 개발 프로젝트 +- 개발 인원: 1명(FrontEnd) +- 프로젝트 기획 및 개발: 2021.4 ~ 2021.6 +- 다양한 API를 활용하여 Restful한 개발 +- `React` + `Typescript` 를 기반으로 한 정적타이핑 개발 +- `Redux-saga` 를 활용한 데이터 비동기 전역 상태관리 +- `Emotion.js`을 이용한 Css-in-js 스타일링 및 반응형 웹 페이지 개발 +- `apexchart`를 이용한 실시간 Candle 차트 구현 + +## Main Feature + +- 국내, 해외, 비트코인 종목코드를 검색 시 + - 실시간 주식 가격(시가, 상한가, 하한가) 렌더링 & 빨간색, 파란색 글씨로 상승과 하락 표시 + - 실시간 비트코인 가격(200분 전 ~ 현재)의 데이터 수신 및 차트 렌더링 +- 국내 주식, 해외 주식, 비트코인 페이지를 따로 만들어 관심있는 정보를 볼 수 있도록 만듦 + - 국내, 해외 주식: 각 나라 별 명언, 주가 검색창, 뉴스 + - 비트코인: 비트코인 검색창 및 차트 +- 국내 or 해외 증권시장 오픈시간에 따라 다른 컴포넌트 구현 +- 반응형 웹 페이지 + +## Project Structure + +```bash +├── node_modules +├── public +├── build +├── src +│ ├── api +│ │ ├── bitcoin.ts +│ │ ├── krstocks.ts +│ │ ├── usstocks.ts +│ │ └── news.ts +│ ├── backgroundImg +│ │ ├── Anapji.jpg +│ │ ├── Hangang-night.jpg +│ │ ├── Hangang.jpg +│ │ ├── Jeju.jpg +│ │ └── Myeongdong.jpg +│ ├── components +│ │ ├── Advice +│ │ │ ├── KRAdvice.tsx +│ │ │ └── USAdvice.tsx +│ │ ├── Bitcoin +│ │ │ ├── ChartCandlesInfo.tsx +│ │ │ └── SearchBitcoinform.tsx +│ │ ├── News +│ │ │ ├── NewsItem.tsx +│ │ │ └── NewsList.tsx +│ │ └── Stocks +│ │ ├── KRStockLoader.tsx +│ │ ├── USStockLoader.tsx +│ │ ├── StockInfo.tsx +│ │ └── SearchStockForm.tsx +│ ├── container +│ │ ├── Main.tsx +│ │ ├── About.tsx +│ │ ├── KrBusiness.tsx +│ │ ├── UsBusiness.tsx +│ │ ├── Bitcoin.tsx +│ │ └── Header.tsx +│ ├── key +│ │ └── apikey.ts +│ ├── modules +│ │ ├── krstocks +│ │ │ ├── actions.ts +│ │ │ ├── index.ts +│ │ │ ├── reducer.ts +│ │ │ ├── saga.ts +│ │ │ └── types.ts +│ │ ├── usstocks +│ │ │ ├── actions.ts +│ │ │ ├── index.ts +│ │ │ ├── reducer.ts +│ │ │ ├── saga.ts +│ │ │ └── types.ts +│ │ ├── news +│ │ │ ├── actions.ts +│ │ │ ├── index.ts +│ │ │ ├── reducer.ts +│ │ │ ├── saga.ts +│ │ │ └── types.ts +│ │ ├── bitcoin +│ │ │ ├── actions.ts +│ │ │ ├── index.ts +│ │ │ ├── reducer.ts +│ │ │ ├── saga.ts +│ │ │ └── types.ts +│ │ └── index.ts +│ ├── App.tsx +│ ├── index.tsx +│ └── setupProxy.js +├── README.md +├── LICENSE +├── package.json +├── tsconfig.json +├── yarn.lock +└── .gitignore +``` + +## Requirements + +- Library +
+ 접기/펼치기 버튼 +
+ "typescript": "^4.1.2"
+ "react": "^17.0.2"
+ "@types/react": "^17.0.0"
+ "axios": "^0.21.1"
+ "redux": "^4.1.0"
+ "react-redux": "^7.2.4"
+ "@types/react-redux": "^7.1.16"
+ "redux-saga": "^1.1.3"
+ "typesafe-actions": "^5.1.0"
+ "react-router-dom": "^5.2.0"
+ "@types/react-router-dom": "^5.1.7"
+ "react-icons-kit": "^1.3.1"
+ "apexcharts": "^3.27.1"
+ "react-apexcharts": "^1.3.9"
+ "react-moment": "^1.1.1"
+ "@emotion/core": "^11.0.0"
+ "@emotion/styled": "^11.3.0"
+ "http-proxy-middleware": "^2.0.0"
+
+
+ +- API +
+ 접기/펼치기 버튼 +
+ Market Stack API(실시간 국내 주가)
+ IEX OPEN API(실시간 해외 주가)
+ Upbit Open API(실시간 비트코인 캔들 차트)
+ News API(국내, 해외 경제관련 뉴스)
+ 한국 명언 API(한강물 측정기 개발자 분께 직접 API 요청 및 개발)
+ Advice Slip JSON API(해외 명언)
+

+
+ +## Technical Issue + +// 업데이트 예정 diff --git a/src/components/Bitcoin/ChartCandlesInfo.tsx b/src/components/Bitcoin/ChartCandlesInfo.tsx index 013925e..5f5e6db 100644 --- a/src/components/Bitcoin/ChartCandlesInfo.tsx +++ b/src/components/Bitcoin/ChartCandlesInfo.tsx @@ -1,7 +1,7 @@ import React, {useEffect, useState} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {RootState} from '../../moudles'; -import {getBitcoinAsync} from '../../moudles/bitcoin'; +import {RootState} from '../../modules'; +import {getBitcoinAsync} from '../../modules/bitcoin'; import ReactApexChart from 'react-apexcharts'; import moment from 'moment'; import SearchBitcoinForm from './SearchBitcoinform'; @@ -35,6 +35,7 @@ function ChartCandlesInfo() { useEffect(() => { dispatch(getBitcoinAsync.request("KRW-BTC")); + // eslint-disable-next-line react-hooks/exhaustive-deps },[]) const onSubmitBitcoincode = (Bitcoincode:string) => { diff --git a/src/components/News/NewsList.tsx b/src/components/News/NewsList.tsx index fb09c21..0754242 100644 --- a/src/components/News/NewsList.tsx +++ b/src/components/News/NewsList.tsx @@ -1,7 +1,7 @@ import React,{useEffect} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {RootState} from '../../moudles'; -import {getNewsAsync} from '../../moudles/news'; +import {RootState} from '../../modules'; +import {getNewsAsync} from '../../modules/news'; import NewsItem from '../../components/News/NewsItem'; import styled from '@emotion/styled'; diff --git a/src/components/Stocks/KRStockLoader.tsx b/src/components/Stocks/KRStockLoader.tsx index 19bc823..b0ff295 100644 --- a/src/components/Stocks/KRStockLoader.tsx +++ b/src/components/Stocks/KRStockLoader.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {RootState} from '../../moudles'; +import {RootState} from '../../modules'; import StockInfo from './StockInfo'; -import { getKRStockAsync } from '../../moudles/krstocks'; +import { getKRStockAsync } from '../../modules/krstocks'; import SearchStockForm from './SearchStockForm'; import {Spin} from 'antd'; import { AdviceandStockBlock } from './USStockLoader'; diff --git a/src/components/Stocks/StockInfo.tsx b/src/components/Stocks/StockInfo.tsx index d39f11a..66df92f 100644 --- a/src/components/Stocks/StockInfo.tsx +++ b/src/components/Stocks/StockInfo.tsx @@ -1,15 +1,7 @@ /** @jsxImportSource @emotion/react */ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/react'; -const riseorfallBlock = styled.div` - -`; - - - - type StockInfoProps = { companyName: string; @@ -21,7 +13,7 @@ type StockInfoProps = { function StockInfo ({companyName, nowPrice, highPrice, lowPrice, closePrice}:StockInfoProps) { - const riseorfall = closePrice > nowPrice ? 'red' : 'blue' + const riseorfall:string = closePrice > nowPrice ? 'red' : 'blue' return (

{companyName}

diff --git a/src/components/Stocks/USStockLoader.tsx b/src/components/Stocks/USStockLoader.tsx index 4a82f80..ccba971 100644 --- a/src/components/Stocks/USStockLoader.tsx +++ b/src/components/Stocks/USStockLoader.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {RootState} from '../../moudles'; +import {RootState} from '../../modules'; import StockInfo from './StockInfo'; -import {getUSStockAsync} from '../../moudles/usstocks'; +import {getUSStockAsync} from '../../modules/usstocks'; import SearchStockForm from './SearchStockForm'; import {Spin} from 'antd'; import styled from '@emotion/styled'; diff --git a/src/index.tsx b/src/index.tsx index af4e8cc..9db8010 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -8,7 +8,7 @@ import {Provider} from 'react-redux'; import {createStore, applyMiddleware} from 'redux'; import {composeWithDevTools} from 'redux-devtools-extension'; import createSagaMiddleware from 'redux-saga'; -import rootReducer, {rootSaga} from './moudles'; +import rootReducer, {rootSaga} from './modules'; const sagaMiddleware = createSagaMiddleware(); diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/moudles/bitcoin/actions.ts b/src/modules/bitcoin/actions.ts similarity index 100% rename from src/moudles/bitcoin/actions.ts rename to src/modules/bitcoin/actions.ts diff --git a/src/moudles/bitcoin/index.ts b/src/modules/bitcoin/index.ts similarity index 100% rename from src/moudles/bitcoin/index.ts rename to src/modules/bitcoin/index.ts diff --git a/src/moudles/bitcoin/reducer.ts b/src/modules/bitcoin/reducer.ts similarity index 100% rename from src/moudles/bitcoin/reducer.ts rename to src/modules/bitcoin/reducer.ts diff --git a/src/moudles/bitcoin/saga.ts b/src/modules/bitcoin/saga.ts similarity index 100% rename from src/moudles/bitcoin/saga.ts rename to src/modules/bitcoin/saga.ts diff --git a/src/moudles/bitcoin/types.ts b/src/modules/bitcoin/types.ts similarity index 100% rename from src/moudles/bitcoin/types.ts rename to src/modules/bitcoin/types.ts diff --git a/src/moudles/index.ts b/src/modules/index.ts similarity index 100% rename from src/moudles/index.ts rename to src/modules/index.ts diff --git a/src/moudles/krstocks/actions.ts b/src/modules/krstocks/actions.ts similarity index 100% rename from src/moudles/krstocks/actions.ts rename to src/modules/krstocks/actions.ts diff --git a/src/moudles/krstocks/index.ts b/src/modules/krstocks/index.ts similarity index 100% rename from src/moudles/krstocks/index.ts rename to src/modules/krstocks/index.ts diff --git a/src/moudles/krstocks/reducer.ts b/src/modules/krstocks/reducer.ts similarity index 100% rename from src/moudles/krstocks/reducer.ts rename to src/modules/krstocks/reducer.ts diff --git a/src/moudles/krstocks/saga.ts b/src/modules/krstocks/saga.ts similarity index 100% rename from src/moudles/krstocks/saga.ts rename to src/modules/krstocks/saga.ts diff --git a/src/moudles/krstocks/types.ts b/src/modules/krstocks/types.ts similarity index 100% rename from src/moudles/krstocks/types.ts rename to src/modules/krstocks/types.ts diff --git a/src/moudles/news/actions.ts b/src/modules/news/actions.ts similarity index 100% rename from src/moudles/news/actions.ts rename to src/modules/news/actions.ts diff --git a/src/moudles/news/index.ts b/src/modules/news/index.ts similarity index 100% rename from src/moudles/news/index.ts rename to src/modules/news/index.ts diff --git a/src/moudles/news/reducer.ts b/src/modules/news/reducer.ts similarity index 100% rename from src/moudles/news/reducer.ts rename to src/modules/news/reducer.ts diff --git a/src/moudles/news/saga.ts b/src/modules/news/saga.ts similarity index 100% rename from src/moudles/news/saga.ts rename to src/modules/news/saga.ts diff --git a/src/moudles/news/types.ts b/src/modules/news/types.ts similarity index 100% rename from src/moudles/news/types.ts rename to src/modules/news/types.ts diff --git a/src/moudles/usstocks/actions.ts b/src/modules/usstocks/actions.ts similarity index 100% rename from src/moudles/usstocks/actions.ts rename to src/modules/usstocks/actions.ts diff --git a/src/moudles/usstocks/index.ts b/src/modules/usstocks/index.ts similarity index 100% rename from src/moudles/usstocks/index.ts rename to src/modules/usstocks/index.ts diff --git a/src/moudles/usstocks/reducer.ts b/src/modules/usstocks/reducer.ts similarity index 100% rename from src/moudles/usstocks/reducer.ts rename to src/modules/usstocks/reducer.ts diff --git a/src/moudles/usstocks/saga.ts b/src/modules/usstocks/saga.ts similarity index 100% rename from src/moudles/usstocks/saga.ts rename to src/modules/usstocks/saga.ts diff --git a/src/moudles/usstocks/types.ts b/src/modules/usstocks/types.ts similarity index 100% rename from src/moudles/usstocks/types.ts rename to src/modules/usstocks/types.ts