Giter VIP home page Giter VIP logo

watch-atlas's Introduction

watch-atlas

Web スクレイピングで各ブランドの機械式時計の情報を取得するスクリプト群

インフラ構成図

aws-infra

Get Started

パッケージのインストール

yarn, node.js をインストール後、以下のコマンドを実行してパッケージをインストール。

yarn

AWS へのデプロイ(Stack の構築)

以下のコマンドを実行して、AWS CDK を使って AWS へデプロイ。

yarn deploy:prod

[注意] GitHub Actions 経由の CI/CD デプロイフロー

AWS の credential 情報を GitHub の Secrets として保存する。
キー名は以下の名前で保存。

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

上記の設定後、main ブランチへマージすると、GitHub Actions 経由で AWS へデプロイされる。

AWS へデプロイしたものを削除(Stack の削除)

yarn destroy:prod

パッケージのアップグレード(AWS CDK を含む)

# ncu で最新パッケージかどうかチェック
yarn nuc

# すべてのパッケージをアップグレード
yarn ncu:u

# 特定のパッケージをアップグレード
yarn ncu:u <package_name>

TODO

データ構造(作成中)

列名 具体例
Brand Baume & Mercier
Family Baume
Reference Baume 10604
Name Baume 10604
Detail Baume 10604
Movement RONDA 6004 D
MovementEnergy クオーツ
PowerReserve 38 時間

Additional 24 Hour Hand (adjustable), Hours, Minutes, Small Seconds | Date | Chronograph Limited: No Case Material: Stainless Steel Glass: Sapphire Back: Closed Shape: Round Diameter: 42.00 mm Height: 13.00 mm W/R: 30.00 m Dial Color: White Indexes: Mixed Hands: Feuille

トラブルシューティング

puppeteer を lambda layer に含めるとバンドルサイズの上限 250 MB を超えてしまう

puppeteer 本体に入っている chromium ではなく、chrome-aws-lambda を使う。
つまり、puppeteer-corechrome-aws-lambdadependencies を追加して lambda layer を作成する。

puppeteer と puppeteer-core の使い分け

開発環境で puppeteer を使い、lambda 上で puppeteer-core + chrome-aws-lambda を使う。 最初は、puppeteer を読み込もうとし、パッケージがない場合、puppeteer-core を読み込む仕様になっている。

puppetter を jest でテストするには

jest-puppeteer が必要。TypeScript では以下のパッケージも加えてインストール。

yarn add --dev \
jest-puppeteer \
@types/puppeteer \
@types/jest-environment-puppeteer \
@types/expect-puppeteer

参考文献

watch-atlas's People

Contributors

imamachi-n avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.