Skip to content

Commit

Permalink
Merge pull request #112 from mercari-build/add-todo-2024
Browse files Browse the repository at this point in the history
Update 2024 contents
  • Loading branch information
momom-i authored Feb 2, 2024
2 parents 7c65939 + 6e96195 commit 09fc11c
Show file tree
Hide file tree
Showing 21 changed files with 83 additions and 109 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build@Mercari Training Program 2023
# Build@Mercari Training Program

This is @<your github id>'s build training repository.

Expand Down
Binary file modified data/text_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/text_ja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions document/01-git.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ In this step, we will learn how to use Git and Github.



## Fork this **mercari-build-training-2023** repository
## Fork this **mercari-build-training** repository

* Fork [mercari-build-training-2023](https://github.com/mercari-build/mercari-build-training-2023)
* You will see be able to see `https://github.com/<your github id>/mercari-build-training-2023` if successful.
* Fork [mercari-build-training](https://github.com/mercari-build/mercari-build-training)
* You will see be able to see `https://github.com/<your github id>/mercari-build-training` if successful.


## Install Git
Expand All @@ -35,26 +35,26 @@ In this step, we will learn how to use Git and Github.

## Use basic commands in Git

1. **Clone** `https://github.com/<your github id>/mercari-build-training-2023` onto your local using the following command.
1. **Clone** `https://github.com/<your github id>/mercari-build-training` onto your local using the following command.
```shell
$ cd <your working space>
$ git clone https://github.com/<your github id>/mercari-build-training-2023
$ git clone https://github.com/<your github id>/mercari-build-training
```

**:bangbang: Caution**

Please definitely run the following command after cloning repository.
```
cd mercari-build-training-2023
cd mercari-build-training
git config --local core.hooksPath .githooks/
```
This is required to use githooks in mercari-build-training-2023 repository.
This is required to use githooks in mercari-build-training repository.

2. Make a new branch named `first-pull-request` and **checkout** into this branch
2. Make a new branch named `first-pull-request` and **switch** into this branch
```shell
$ cd <your working space>/mercari-build-training-2023
$ cd <your working space>/mercari-build-training
$ git branch first-pull-request
$ git checkout first-pull-request
$ git switch first-pull-request
```
3. Replace `@<your github id>` on README.md with your Github ID.
4. **commit** the changes you made with the following commands.
Expand All @@ -67,7 +67,7 @@ This is required to use githooks in mercari-build-training-2023 repository.
```shell
$ git push origin first-pull-request:first-pull-request
```
6. Open `https://github.com/<your github id>/mercari-build-training-2022` and make a **Pull Request** (PR).
6. Open `https://github.com/<your github id>/mercari-build-training` and make a **Pull Request** (PR).
- base branch: `main`
- target branch: `first-pull-request`

Expand Down
22 changes: 11 additions & 11 deletions document/01-git.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

* (EN)[Git basics](https://www.atlassian.com/git)
* (EN)[Udemy Business - GitHub Ultimate: Master Git and GitHub - Beginner to Expert](https://mercari.udemy.com/course/github-ultimate/)
## **mercari-build-training-2023** リポジトリをフォークする
## **mercari-build-training** リポジトリをフォークする

* [mercari-build-training-2023](https://github.com/mercari-build/mercari-build-training-2023)
* [mercari-build-training](https://github.com/mercari-build/mercari-build-training)
をあなたのGithubにForkします。
* Forkに成功すると `https://github.com/<your github id>/mercari-build-training-2023`
* Forkに成功すると `https://github.com/<your github id>/mercari-build-training`
というようなリポジトリができます。

## Gitをインストールする
Expand All @@ -33,27 +33,27 @@

## Gitの基本コマンドを使う

1. `https://github.com/<your github id>/mercari-build-training-2023`**clone**
1. `https://github.com/<your github id>/mercari-build-training`**clone**
します。 cloneすると、github上のリポジトリを自分のローカルにDownloadできます。
```shell
$ cd <your working space>
$ git clone https://github.com/<your github id>/mercari-build-training-2023
$ git clone https://github.com/<your github id>/mercari-build-training
```

**:bangbang: 注意**

cloneができたら必ず以下のコマンドを実行してください。
```shell
$ cd mercari-build-training-2023
$ cd mercari-build-training
$ git config --local core.hooksPath .githooks/
```
これは mercari-build-training-2022 が githooks という機能を使うために必要なものです。
これは mercari-build-training が githooks という機能を使うために必要なものです。

2. `first-pull-request`というブランチを作り、そのブランチに**checkout**します
2. `first-pull-request`というブランチを作り、そのブランチに**switch**します
```shell
$ cd <your working space>/mercari-build-training-2023
$ cd <your working space>/mercari-build-training
$ git branch first-pull-request
$ git checkout first-pull-request
$ git switch first-pull-request
```
3. README.md の中にある`@<your github id>` の部分をあなたのgithub idに書き換えてください
4. 書き換えた内容を **commit**します
Expand All @@ -66,7 +66,7 @@ $ git config --local core.hooksPath .githooks/
```shell
$ git push origin first-pull-request:first-pull-request
```
6. `https://github.com/<your github id>/mercari-build-training-2022`を開き、**Pull Request**(PR)を作ります。
6. `https://github.com/<your github id>/mercari-build-training`を開き、**Pull Request**(PR)を作ります。
- base branch: `main`
- target branch: `first-pull-request`

Expand Down
16 changes: 12 additions & 4 deletions document/02-local-env.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Choose either Python or Go and build your local environment.
## Building Python environment

### 1. Install Python
* If your local version is below Python3.7, install Python3.10.
* If you have Python3.7 or above, you can skip the installation step.
* If your local version is below Python3.8, install Python3.10.
* If you have Python3.8 or above, you can skip the installation step.

### 2. Check your Python version

Expand Down Expand Up @@ -47,8 +47,11 @@ If successful, you can access the local host `http://127.0.0.1:9000` on our brow

## Building Go environment
### 1. Install Go
* If your local version is below Go1.14, install Go1.18.
* If you have Go1.14 or above, you can skip the installation step.
* If your local version is below Go1.20, install Go1.21.
* If you have Go1.20 or above, you can skip the installation step.

Download it from [this link](https://go.dev/dl/)!
※ If you are using a Mac and are unsure whether to download the `x86-64` or `ARM64` version, click on the Apple logo at the top left corner > select "About This Mac". If the chip is listed as "Apple" choose `ARM64`; if it's "Intel" select `x86-64`.

### 2. Check your Go version

Expand All @@ -65,6 +68,11 @@ If the version does not correspond to the Python version you installed, double c

* [GOROOT and GOPATH](https://www.jetbrains.com/help/go/configuring-goroot-and-gopath.html)

Recommendation web page about Go
* [A Tour of Go](https://go.dev/tour/welcome/)
* [Go: The Complete Developer's Guide (Golang)](https://mercari.udemy.com/course/go-the-complete-developers-guide/)
* Section11 is closely related to the content of this training and is particularly recommended as a reference.

### 3. Install dependencies

In Go, dependent libraries are managed in a file called `go.mod`.
Expand Down
17 changes: 13 additions & 4 deletions document/02-local-env.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ PythonかGoから1つの言語を選び、環境を作りましょう。
## Pythonの環境を作る

### 1. Pythonをインストールする
* Python3.7以上がインストールされていない場合、Python3.10をインストールします
* すでに3.7以上がインストール済みの方はskipして問題ないです
* Python3.8以上がインストールされていない場合、Python3.10をインストールします
* すでに3.8以上がインストール済みの方はskipして問題ないです

### 2. Pythonのバージョンをチェックする

Expand Down Expand Up @@ -48,8 +48,11 @@ $ uvicorn main:app --reload --port 9000

## Goの環境を作る
### 1. Goをインストールする
* Go1.14以上がインストールされていない場合、Go1.18をインストールします
* すでに1.14以上がインストール済みの方はskipして問題ないです
* Go1.20以上がインストールされていない場合、Go1.21をインストールします
* すでに1.20以上がインストール済みの方はskipして問題ないです

https://go.dev/dl/ このリンクからダウンロードしてください。
※ Macの方で`x86-64``ARM64`どちらをダウンロードすればいいかわからない場合は、左上の🍎マーク > 「このMacについて」を開き、チップが「Apple」になっていたら`ARM64`を「Intel」であれば`x86-64`を選択してください。

### 2. Goのバージョンをチェックする

Expand All @@ -65,6 +68,12 @@ $ go version

* [PATHを通すとは?- 初心者でも分かる解説](https://hara-chan.com/it/programming/environment-variable-path/)

Go関連のおすすめサイト
* [A Tour of Go](https://go.dev/tour/welcome/)
* [Go: The Complete Developer's Guide (Golang)](https://mercari.udemy.com/course/go-the-complete-developers-guide/)
* ↑英語ですが、字幕もあり聞き取りやすいです。Section11はこのtrainingの内容と近く特に参考になると思います。


### 3. 依存ライブラリをインストールする

Goでは、`go.mod`というファイルで依存しているライブラリを管理しています。
Expand Down
8 changes: 4 additions & 4 deletions document/05-docker.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In this step, we will learn how to use Docker.


## 2. Run Docker commands
**Make sure that you're in `mercari-build-training-2023/` directory, and run the following command.**
**Make sure that you're in `mercari-build-training/` directory, and run the following command.**

```shell
$ docker run -v $(pwd)/data/text_en.png:/tmp/img.png wakanapo/tesseract-ocr tesseract /tmp/img.png stdout -l eng
Expand Down Expand Up @@ -78,9 +78,9 @@ Make sure you understand the following commands and when to use them.
## 4. Building a Docker Image
**Build the docker file under the directory `python/` if you're using Python and `go/` if you're using Go.**

* Set the name of the image to be `build2022/app` with `latest` tag.
* Set the name of the image to be `build2024/app` with `latest` tag.

Check that you can now see `build2022/app` in the list of images.
Check that you can now see `build2024/app` in the list of images.


**:book: Reference**
Expand Down Expand Up @@ -114,7 +114,7 @@ The environment within the docker image should be the same as STEP2-2 after STEP
**Mofify `dockerfile` to copy necessary files and install dependencies such that you can run the listing API on docker**


`$ docker run -d -p 9000:9000 build2022/app:latest`
`$ docker run -d -p 9000:9000 build2024/app:latest`

Check if the above command results in the same response as STEP3.

Expand Down
8 changes: 4 additions & 4 deletions document/05-docker.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

* [Docker のダウンロードとインストール](https://matsuand.github.io/docs.docker.jp.onthefly/get-started/#download-and-install-docker)
## 2. Docker を触ってみる
**`mercari-build-training-2022/` 以下にいることを確認して次のコマンドを実行してみましょう。**
**`mercari-build-training/` 以下にいることを確認して次のコマンドを実行してみましょう。**

```shell
$ docker run -v $(pwd)/data/text_en.png:/tmp/img.png wakanapo/tesseract-ocr tesseract /tmp/img.png stdout -l eng
Expand Down Expand Up @@ -78,9 +78,9 @@ docker はホスト上に存在しないイメージを使う際には、自動
## 4. Docker Image を Build する
**pythonで開発をしている人は`python/`, Goの人は`go/`以下にある`Dockerfile`をbuildしてみましょう。**

* 名前(リポジトリ名)は `build2023/app`, タグは`latest` とします。
* 名前(リポジトリ名)は `build2024/app`, タグは`latest` とします。

イメージ一覧の中に `build2023/app` という image があれば成功です。
イメージ一覧の中に `build2024/app` という image があれば成功です。


**:book: Reference**
Expand Down Expand Up @@ -112,7 +112,7 @@ STEP4-5 までで docker image の中は STEP2-2 と同じ状態になってい

**`dockerfile`を変更し、必要なファイルをコピーしたり依存ライブラリをインストールしたりして, docker image 上で 出品 API が動くようにしましょう。**

`$ docker run -d -p 9000:9000 build2023/app:latest`
`$ docker run -d -p 9000:9000 build2024/app:latest`

を実行しSTEP3と同様にしてAPIを叩ければ成功です。

Expand Down
2 changes: 1 addition & 1 deletion document/06-ci.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The file `.github/workflows/build.yml` already contains a workflow that pushes y

Remove the comment out from the Step and push the docker image via CI.

If the Workflow is successful, the generated image will be pushed to the URL: `ghcr.io/<github-id>/mercari-build-training-2023:<branch-name>`.
If the Workflow is successful, the generated image will be pushed to the URL: `ghcr.io/<github-id>/mercari-build-training:<branch-name>`.
Pull the image locally and run it.

Reference
Expand Down
2 changes: 1 addition & 1 deletion document/06-ci.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ GithubはGithub Actionsと呼ばれるCIサービスを提供しています。
```
のStepのコメントアウトを外し、CI経由でdocker imageをpushさせてみましょう。

うまくいくと `ghcr.io/<github-id>/mercari-build-training-2023:<branch-name>`
うまくいくと `ghcr.io/<github-id>/mercari-build-training:<branch-name>`
というURLにimageがpushされるので、ローカルでそのimageをpullして実行してみましょう。

Reference
Expand Down
6 changes: 3 additions & 3 deletions document/07-frontend.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@


## 1. Build local environment
Install Node v16 from below.
(16.15.0 LTS is recommended as of May 2022)
Install Node v20 from below.
(20.11.0 LTS is recommended as of Jan 2024)

https://nodejs.org/en/

If you would like to install multiple versions of Node, use [nvs](https://github.com/jasongin/nvs).

Run `node -v` and confirm that `v16.0.0` or above is displayed.
Run `node -v` and confirm that `v20.0.0` or above is displayed.

Move to the following directory and install dependencies with the following command.
```shell
Expand Down
6 changes: 3 additions & 3 deletions document/07-frontend.ja.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# STEP7: Webのフロントエンドを実装する

## 1. 環境構築
以下からv16のNodeをインストールしてください
2022年5月現在16.15.0 LTSを推奨)
以下からv20のNodeをインストールしてください
2024年1月現在20.11.0 LTSを推奨)

https://nodejs.org/en/

複数のバージョンをインストールしたい場合は[nvs](https://github.com/jasongin/nvs)を推奨します。

`node -v` を実行して `v16.0.0` 以上のバージョンが表示されれば正しくインストールできています。
`node -v` を実行して `v20.0.0` 以上のバージョンが表示されれば正しくインストールできています。

まずはディレクトリに移動して、必要なライブラリをインストールします。
```shell
Expand Down
8 changes: 4 additions & 4 deletions document/08-docker-compose.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ In this step, we will learn how to use docker-compose.

You have a sample `Dockerfile` In `typescript/simple-mercari-web`. Modify this file to run frontend on Docker.

* Set the name of the repository as `build2023/web` and tag as `latest`.
* Set the name of the repository as `build2024/web` and tag as `latest`.

Run the following and check if you can successfully open [http://localhost:3000/](http://localhost:3000/) on your browser.

`$ docker run -d -p 3000:3000 build2023/web:latest`
`$ docker run -d -p 3000:3000 build2024/web:latest`


## 2. Installing Docker Compose
Expand All @@ -46,12 +46,12 @@ Let's check if you can answer the following questions.
**Referring to the tutorial material, run the frontend and API using Docker Compose**


Set up `docker-compose.yml` under `mercari-build-training-2023/`
Set up `docker-compose.yml` under `mercari-build-training/`

Make a new file `docker-compose.yml` considering the following points.

* Docker image to use
* (Option 1: Difficulty ☆) Use `build2023/app:latest` and `build2023/web:latest` made in STEP4 and STEP6-1
* (Option 1: Difficulty ☆) Use `build2024/app:latest` and `build2024/web:latest` made in STEP4 and STEP6-1
* (Option 2: Difficulty ☆☆☆) Build from `{go|python}/Dockerfile` and `typescript/simple-mercari-web/Dockerfile`
* Port numbers
* API : 9000
Expand Down
8 changes: 4 additions & 4 deletions document/08-docker-compose.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

`typescript/simple-mercari-web`以下にフロントエンド用の `Dockerfile` がすでに用意されています。これを変更しフロントエンドが docker 上で立ち上がるようにしましょう。

* 名前(リポジトリ名)は `build2023/web`, タグは`latest` とします。
* 名前(リポジトリ名)は `build2024/web`, タグは`latest` とします。

`$ docker run -d -p 3000:3000 build2023/web:latest`
`$ docker run -d -p 3000:3000 build2024/web:latest`

を実行し、ブラウザから[http://localhost:3000/](http://localhost:3000/)が正しく開ければ成功です。

Expand All @@ -44,12 +44,12 @@
## 4. Docker ComposeでAPIとフロントエンドを動かす
**チュートリアルを参考にしながら、今回作成したサービスのフロントエンドとバックエンドのAPIをDocker Composeで動かせるようにしましょう**

`docker-compose.yml``mercari-build-training-2023/` 以下に作成することにします。
`docker-compose.yml``mercari-build-training/` 以下に作成することにします。

以下の点を参考にしながら `docker-compose.yml` を作成しましょう。

* 使用する docker image
* (Option 1: 難易度 ☆) STEP4 と STEP6-1 でそれぞれ build した `build2023/app:latest``build2023/web:latest` を使う
* (Option 1: 難易度 ☆) STEP4 と STEP6-1 でそれぞれ build した `build2024/app:latest``build2024/web:latest` を使う
* (Option 2: 難易度 ☆☆☆) `{go|python}/Dockerfile``typescript/simple-mercari-web/Dockerfile` から build するようにする
* 使用する port
* API : 9000
Expand Down
23 changes: 0 additions & 23 deletions document/10-team-hackathon.en.md

This file was deleted.

Loading

0 comments on commit 09fc11c

Please sign in to comment.