Skip to content

Commit

Permalink
Merge pull request #1 from Climier-code/develop
Browse files Browse the repository at this point in the history
Publish WegoUp v1.0
  • Loading branch information
Climier-code authored Jun 16, 2021
2 parents 4f9429b + 74b7b61 commit 22fb2f7
Show file tree
Hide file tree
Showing 59 changed files with 3,160 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# API KEY
/src/key
196 changes: 150 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
<details>
<summary>접기/펼치기 버튼</summary>
<div markdown="1">
"typescript": "^4.1.2"<br/>
"react": "^17.0.2"<br/>
"@types/react": "^17.0.0" <br/>
"axios": "^0.21.1"<br/>
"redux": "^4.1.0" <br/>
"react-redux": "^7.2.4"<br/>
"@types/react-redux": "^7.1.16"<br/>
"redux-saga": "^1.1.3"<br/>
"typesafe-actions": "^5.1.0"<br/>
"react-router-dom": "^5.2.0"<br/>
"@types/react-router-dom": "^5.1.7"<br/>
"react-icons-kit": "^1.3.1"<br/>
"apexcharts": "^3.27.1"<br/>
"react-apexcharts": "^1.3.9"<br/>
"react-moment": "^1.1.1"<br/>
"@emotion/core": "^11.0.0"<br/>
"@emotion/styled": "^11.3.0"<br/>
"http-proxy-middleware": "^2.0.0"<br/>
</div>
</details>

- API
<details>
<summary>접기/펼치기 버튼</summary>
<div markdown="1">
<a href="https://marketstack.com/documentation" target="_blank">Market Stack API</a>(실시간 국내 주가)<br/>
<a href="https://iexcloud.io/docs/api/" target="_blank">IEX OPEN API</a>(실시간 해외 주가)<br/>
<a href="https://upbit.com/service_center/open_api_guide" target="_blank">Upbit Open API</a>(실시간 비트코인 캔들 차트)<br/>
<a href="https://newsapi.org/" target="_blank">News API</a>(국내, 해외 경제관련 뉴스)<br/>
<a href="https://api.qwer.pw/docs/helpful_text" target="_blank">한국 명언 API</a>(한강물 측정기 개발자 분께 직접 API 요청 및 개발)<br/>
<a href="https://api.adviceslip.com/advice" target="_blank">Advice Slip JSON API</a>(해외 명언)<br/>
</div><br/>
</details>

## Technical Issue

// 업데이트 예정
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,42 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.6.2",
"@emotion/core": "^11.0.0",
"@emotion/styled": "^11.3.0",
"@react-financial-charts/core": "^1.3.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/antd": "^1.0.0",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-redux": "^7.1.16",
"@types/react-router-dom": "^5.1.7",
"antd": "^4.16.2",
"apexcharts": "^3.27.1",
"axios": "^0.21.1",
"canvasjs-react-charts": "^1.0.5",
"http-proxy-middleware": "^2.0.0",
"krx-stock-api": "^1.0.0",
"moment": "^2.29.1",
"react": "^17.0.2",
"react-apexcharts": "^1.3.9",
"react-dom": "^17.0.2",
"react-financial-charts": "^1.3.0",
"react-icons-kit": "^1.3.1",
"react-moment": "^1.1.1",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-use": "^17.2.4",
"react-xml-parser": "^1.1.8",
"redux": "^4.1.0",
"redux-devtools-extension": "^2.13.9",
"redux-saga": "^1.1.3",
"typesafe-actions": "^5.1.0",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/uparrowicon.png" />
<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" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/uparrowicon.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/
Expand All @@ -24,7 +24,7 @@
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>
<title>We go Up!</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
Binary file added public/uparrowicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 14 additions & 16 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import UsBusiness from './containers/UsBusiness';
import Main from './containers/Main';
import Header from './containers/Header';
import KrBusiness from './containers/KrBusiness';
import About from './containers/About';
import Bitcoin from './containers/Bitcoin';
import {Route} from 'react-router-dom';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div>
<Header />
<Route path="/" component={Main} exact/>
<Route path="/about" component={About} />
<Route path="/krbusiness" component={KrBusiness} />
<Route path="/usbusiness" component={UsBusiness} />
<Route path="/bitcoin" component={Bitcoin} />
</div>
);
}
Expand Down
28 changes: 28 additions & 0 deletions src/api/bitcoin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import axios from 'axios';


export async function getBitCandle(bitcoinname :string) {

const response = await axios.get<BitcoinCandles> (
`https://api.upbit.com/v1/candles/minutes/1?market=${bitcoinname}&count=200`

);

return response.data;
}

export type BitcoinCandles = BitcoinCandle[]

export interface BitcoinCandle {
market: string;
candle_date_time_utc: Date;
candle_date_time_kst: Date;
opening_price: number;
high_price: number;
low_price: number;
trade_price: number;
timestamp: number;
candle_acc_trade_price: number;
candle_acc_trade_volume: number;
unit: number;
}
49 changes: 49 additions & 0 deletions src/api/krstocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import axios from 'axios';
import {KRStockAPIKEY} from '../key/apikey';

export async function getKRStocks(krstock: string) {


const response = await axios.get<KRStocks>(
`http://api.marketstack.com/v1/eod?access_key=${KRStockAPIKEY}&symbols=${krstock}.XKRX`
);

return response.data;
}

export interface KRStocks {
pagination: Pagination;
data: Datum[];
}

export interface Datum {
open: number;
high: number;
low: number;
close: number;
volume: number;
adj_high: null;
adj_low: null;
adj_close: number;
adj_open: null;
adj_volume: null;
split_factor: number;
symbol: Symbol;
exchange: Exchange;
date: string;
}

export enum Exchange {
Xkrx = "XKRX",
}

export enum Symbol {
The035420Xkrx = "035420.XKRX",
}

export interface Pagination {
limit: number;
offset: number;
count: number;
total: number;
}
Loading

0 comments on commit 22fb2f7

Please sign in to comment.