{"id":20540669,"url":"https://github.com/serverless-operations/product-api-example","last_synced_at":"2025-04-14T08:38:40.751Z","repository":{"id":41852227,"uuid":"429657817","full_name":"serverless-operations/product-api-example","owner":"serverless-operations","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-04T02:29:38.000Z","size":786,"stargazers_count":1,"open_issues_count":5,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-27T22:11:12.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless-operations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-19T03:27:46.000Z","updated_at":"2022-04-28T07:04:56.000Z","dependencies_parsed_at":"2023-02-18T13:15:57.375Z","dependency_job_id":null,"html_url":"https://github.com/serverless-operations/product-api-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fproduct-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fproduct-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fproduct-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-operations%2Fproduct-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-operations","download_url":"https://codeload.github.com/serverless-operations/product-api-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248847627,"owners_count":21171216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T01:17:02.877Z","updated_at":"2025-04-14T08:38:40.728Z","avatar_url":"https://github.com/serverless-operations.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 事前にPC上にインストールが必要なもの\nローカル環境の状態に合わせて、以下のインストール状況を確認し、存在しなければインストールして下さい。\n- Python3: Python3.9以上をインストール\n- pip3: Pythonで使用するライブラリやツールを管理するパッケージマネージャー\n- nodejs: Serverless Frameworkを実行するために必要\n- yarn: Serverless Frameworkで使用するツールをインストールするために必要\n\n## 初期セットアップ\n\nソースコードを展開してください。\n```\n$ git clone git@github.com:serverless-operations/product-api-example.git\n$ cd product-api-example\n$ export NODE_ENV=test \u0026\u0026 yarn install　#Serverless Framework関連のライブラリをインストール\n$ export PYTHONPATH=./\n```\n\nPython 関連のライブラリのインストールします。venvを使用して環境を構築してください。 `requirements/dev.txt`には開発で使用するライブラリを記述します。本番で使用するライブラリは`requirements/prod.txt`にも記載してください。\n```\n$ python3 -m venv venv\n$ . venv/bin/activate\n$ pip3 install -r requirements/dev.txt\n```\n\nライブラリをインストールした際は以下の手順で`requirements`配下のファイルに記述します。\n```\n$ pip3 install flake8\n$ pip3 freeze \u003e requirements/dev.txt\n```\n\n## Lint\n\npep8というコーディング規約にそって構文チェックを行います\n```\n$ flake8\n```\n\n## テスト\n\npytestによる自動テストを行います。テストの前にDynamoDBのローカルコンテナを立ち上げてユニットテストからアクセスできるようにして下さい。\n\nコンテナの起動\n```\n$ yarn start\n```\n\nテストの実行\n```\n$ pytest -s\n```\n\n## デプロイ\n\n```\n$ yarn serverless deploy --stage `ステージ名`\n```\n\n## ローカル開発\n\nローカルサーバーを起動する。AuthorizerにはServerless Offlineが対応して使えないので注意が必要\n```\n$ yarn serverless offline --noAuth \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-operations%2Fproduct-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-operations%2Fproduct-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-operations%2Fproduct-api-example/lists"}