{"id":20656787,"url":"https://github.com/pitang1965/contact-form","last_synced_at":"2025-12-05T15:05:34.139Z","repository":{"id":221928705,"uuid":"753100598","full_name":"pitang1965/contact-form","owner":"pitang1965","description":"htmxを用いたコンタクトフォームの実験","archived":false,"fork":false,"pushed_at":"2024-02-25T07:07:37.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T11:27:11.533Z","etag":null,"topics":["expressjs","google-spreadsheet-api","htmx","vercel"],"latest_commit_sha":null,"homepage":"https://contact.over40web.club/","language":"JavaScript","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/pitang1965.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-05T13:24:41.000Z","updated_at":"2024-02-11T13:57:07.000Z","dependencies_parsed_at":"2024-02-25T07:31:30.516Z","dependency_job_id":"69cf00a5-5b2c-44c8-b171-80fda7d89a4f","html_url":"https://github.com/pitang1965/contact-form","commit_stats":null,"previous_names":["pitang1965/contact-form"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitang1965%2Fcontact-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitang1965%2Fcontact-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitang1965%2Fcontact-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitang1965%2Fcontact-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pitang1965","download_url":"https://codeload.github.com/pitang1965/contact-form/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242762736,"owners_count":20181267,"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":["expressjs","google-spreadsheet-api","htmx","vercel"],"created_at":"2024-11-16T18:17:16.805Z","updated_at":"2025-12-05T15:05:34.133Z","avatar_url":"https://github.com/pitang1965.png","language":"JavaScript","readme":"# contact-form\n\n* [htmx](https://htmx.org/)を用いたコンタクトフォームの実験\n* 問い合わせ内容をGoogleスプレッドシートに記録します。\n* [Google Sheets API](https://developers.google.com/sheets/api/guides/concepts?hl=ja)を使用。\n* APIは[Express](https://expressjs.com/ja/)で実装。\n* [Vercel](https://vercel.com/)にサーバーレスファンクションを用いてデプロイ。\n  * [Using Express.js with Vercel](https://vercel.com/guides/using-express-with-vercel)\n\n![animation](https://github.com/pitang1965/contact-form/assets/47315420/c7fa87be-a989-40ca-b2ba-0cea654cc4fc)\n\n## 必要な作業\n1. `server\\inquiryProcessor.js`の`SPREADSHEET_ID`にGoogleスプレッドシートのIDを設定する。これは、`https://docs.google.com/spreadsheets/d/スプレッドシートID/edit`の`スプレッドシート`の部分です。\n2. Googleスプレッドシートの共有設定で、`.env`ファイルにある`client_email`のメールアドレスを編集者として設定する。\n3. 以下のような内容の`.env`ファイルが必要です。\n\n```\nGOOGLE_SERVICE_ACCOUNT_CREDENTIALS='\n{\n  \"type\": \"service_account\",\n  \"project_id\": \"contact-form-******\",\n  \"private_key_id\": \"d00be****\\n-----END PRIVATE KEY-----\\n\",\n  \"client_email\": \"contact-form-api@contact-form-******.iam.gserviceaccount.com\",\n  \"client_id\": \"********\",\n  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n  \"token_uri\": \"https://oauth2.googleapis.com/token\",\n  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/contact-form-api%40contact-form-******.iam.gserviceaccount.com\",\n  \"universe_domain\": \"googleapis.com\"\n}'\nSPREADSHEET_ID = 'xxxxx';\n```\n\n## 開発環境での実行方法\n\n1. **依存関係をインストール**\n   ```bash\n   npm install\n   ```\n\n2. **開発サーバーを起動**\n   ```bash\n   npm start\n   ```\n\n3. **ブラウザでアクセス**\n   \n   サーバーが起動したら、以下のURLでアプリケーションにアクセスできます：\n   ```\n   http://localhost:3000\n   ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitang1965%2Fcontact-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpitang1965%2Fcontact-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitang1965%2Fcontact-form/lists"}