Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beaniejoy/do-it-quant
π ννΈ ν¬μμ κΈ°λ°ν μ’
λͺ© ranking μλΉμ€ (react-native, spring boot, python)
https://github.com/beaniejoy/do-it-quant
Last synced: 1 day ago
JSON representation
π ννΈ ν¬μμ κΈ°λ°ν μ’ λͺ© ranking μλΉμ€ (react-native, spring boot, python)
- Host: GitHub
- URL: https://github.com/beaniejoy/do-it-quant
- Owner: beaniejoy
- Created: 2020-06-29T07:23:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T23:19:07.000Z (almost 2 years ago)
- Last Synced: 2023-03-05T19:17:39.443Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 9.11 MB
- Stars: 10
- Watchers: 1
- Forks: 4
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Do It Quant
[![Build Status](https://travis-ci.org/hanbinleejoy/do-it-quant.svg?branch=master)](https://travis-ci.org/hanbinleejoy/do-it-quant)
## π‘ Introduction
- μ£Όμ ν¬μλ₯Ό λμμ£Όλ Quant κΈ°λ° μ’ λͺ© μΆμ² λͺ¨λ°μΌ μ±μ λλ€.
- 7κ° μ€μ ν¬μμ§νλ₯Ό ν λλ‘ μ¬μ©μκ° λΉμ€μΉλ₯Ό μ§μ μ λ ₯νλ©΄ μ΄ λΉμ€μΉλ€μ κΈ°μ€μΌλ‘ κ³μ°νμ¬
1 ~ 10μ κΉμ§μ μ’ λͺ©μ μ μν΄μ£Όλ μ±μ λλ€.
- μ΄λ₯Ό ν΅ν΄ μ£Όκ΄μ μΈ νλ¨μ μν ν¬μκ° μλ κΈ°κ³μ μΌλ‘ ν¬μν μ μκ² λμμ£Όλ μλΉμ€λ₯Ό μ 곡ν©λλ€.
- μ 립μ μ£Όμ ν¬μ, λ€μν ν¬μ ν¬νΈν΄λ¦¬μ€ κ΅¬μ± λ± μ¬λ¬ λΆλ¬Έμ νμ©ν μ μμ κ²μΌλ‘ κΈ°λν©λλ€.
## π€ Team
- Front, Mobile: [`feelcard`](https://github.com/feelcard)
- Back, Cloud: `hanbinleejoy`
- Data Crawling: [`SeoYeonii`](https://github.com/SeoYeonii)
## π Stack
- Front(Mobile): React-Native, Android
- Back: Spring Boot `2.2.6` (Java 8)
- Test: JUnit4
- Build: Gradle `5.6.4`
- DB: MariaDB(AWS RDS)
- Cloud: AWS EC2
- Crawling: python
## π μλΉμ€ ꡬ쑰
## π λλλ§ νλ©΄
## π API μꡬμ¬ν(DB Table ꡬμ±)
- **company_data** (λΆκΈ°λ§λ€ μλ update)
- `per`
- `pbr`
- `roa`
- `roe`
- `debt_ratio`(λΆμ±λΉμ¨)
- `operating_profit_ratio`(μμ μ΄μ΅λ₯ )
- `reserve_ratio`(μ 보μ¨)- **company_detail** (λΆκΈ°λ§λ€ μλ update)
- `code`(μ’ λͺ©μ½λ)
- `cmp_name`(μ’ λͺ©λͺ /κΈ°μ μ΄λ¦)
- `total_asset`(μ΄μμ°)
- `total_equity`(μ΄μλ³Έ)
- `total_debt`(μ΄λΆμ±)
- `sales`(맀μΆμ‘)
- `operating_profit`(μμ μ΄μ΅)
- `net_income`(λΉκΈ°μμ΄μ΅)
- `retained_earnings`(μ΄μ΅ μμ¬κΈ)
- `description`(κΈ°μ μμΈμ€λͺ )
- `market`(μ μ’ )- **daily_price** (λ§€μΌ μ₯λ§κ° κΈ°μ€μΌλ‘ μλ update)
- `code`(μ’ λͺ©μ½λ)
- `end_price`(μ’ κ°)
## π μμ€ν μλ μ€λͺ
### Scheduling μ€μ
> 1. `daily_price`: λ§€μΌ 16:00μ DB μ λ°μ΄νΈ
> 2. `quant_data`, `company_detail`: λΆκΈ°λ§λ€ DB μ λ°μ΄νΈ(2, 5, 8, 11μ κΈ°μ€ 15μΌλ‘ μ€μ )
#### AWS Linux μλ² λ΄ Scheduling μ€μ
```cmd
$crontab -e0 0 15 2,5,8,11 * python3 /home/ec2-user/app/diq/web_crawling_general.py
0 16 * * 1-5 python3 /home/ec2-user/app/diq/web_crawling_Jongga.py
```
1. `daily_price`: λ§€μΌ 16μ 0λΆμ λͺ λ Ή μλ μ€ν,
- `dailyUpdateData.json` νμΌ λ°ν
2. `quant_data`, `company_detail`: 2, 5, 8, 11μ 15μΌ 0μ 0λΆμ λͺ λ Ή μλ μ€ν
- `QuantDataTable.json`, `CompanyDetailTable.json` νμΌ λ°ν
#### Spring Boot μ€μ
```java
@SpringBootApplication
@EnableScheduling
public class QuantApplication {public static void main(String[] args) {
SpringApplication.run(QuantApplication.class, args);
}
}
```
- `@EnableScheduling` μ€μ μ ν΅ν΄ Spring Bootμ Scheduler λ±λ‘```java
// QuantDataController.java, CompanyDetailController.java
@Scheduled(cron = "0 30 0 * 2,5,7,11 *", zone = "Asia/Seoul")
public ResponseEntity bulkUpdate()
throws JsonParseException, JsonMappingException, IOException {
//ν΄λΉ Logic...
}// DailyPriceController.java
@Scheduled(cron = "0 30 16 * * 1-5", zone = "Asia/Seoul")
public ResponseEntity bulkUpdate()
throws JsonParseException, JsonMappingException, IOException {
//ν΄λΉ Logic...
}
```
1. python μ½λ μ€νμ΄ μλ£λλλ° 20 ~ 30λΆμ λ μμλλ―λ‘ Spring Bootμμλ Linuxμλ² μ€μ λ³΄λ€ 30λΆ λ¦κ² Scheduling μ€μ
2. python μ½λλ‘ crawlingλ λ°μ΄ν°λ€μ λ΄μ json νμΌμ WASμμ λ°μμ μ²λ¦¬νλ€.
- `dailyUpdateData.json` > `DailyPriceController.java`
- `QuantDataTable.json` > `QuantDataController.java`
- `CompanyDetailTable.json` > `CompanyDetailController.java`
### React-Native λ΄ Async Storage μ¬μ©
μ¬μ©μκ° Modify νμ΄μ§λ₯Ό ν΅ν΄ 7κ° μ§νμ λν λΉμ€μΉλ₯Ό μμ ν λλ§λ€ ν΄λΌμ°λ μλ² DBμ μμ²νλ€λ©΄ λΉν¨μ¨μ μ΄λΌκ³ μκ°νμ΅λλ€.
μ΄μ μ±μ μ²μ μμνμ λ React-Nativeμμ μ§μνλ Async Storageμ μλ² DB λ°μ΄ν°λ€μ ν λ² λκΈ°ννλ€λ©΄ μλ²μ λΆλ΄μ μ€μΌ μ μμ κ²μ΄λΌ νλ¨νκ³ κ°λ°μ μ§ννμ΅λλ€.