{"id":27715687,"url":"https://github.com/seino914/dotnet_webapi","last_synced_at":"2025-04-27T01:08:43.533Z","repository":{"id":288287086,"uuid":"967514966","full_name":"seino914/dotnet_webapi","owner":"seino914","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-16T15:22:41.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-27T01:08:40.258Z","etag":null,"topics":["csharp"],"latest_commit_sha":null,"homepage":"","language":"C#","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/seino914.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,"zenodo":null}},"created_at":"2025-04-16T15:13:45.000Z","updated_at":"2025-04-16T15:22:44.000Z","dependencies_parsed_at":"2025-04-16T22:28:17.439Z","dependency_job_id":"2ffa2186-253f-44dc-a371-eea697a685c4","html_url":"https://github.com/seino914/dotnet_webapi","commit_stats":null,"previous_names":["seino914/dotnet_webapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seino914%2Fdotnet_webapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seino914%2Fdotnet_webapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seino914%2Fdotnet_webapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seino914%2Fdotnet_webapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seino914","download_url":"https://codeload.github.com/seino914/dotnet_webapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251073636,"owners_count":21532019,"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":["csharp"],"created_at":"2025-04-27T01:08:43.057Z","updated_at":"2025-04-27T01:08:43.510Z","avatar_url":"https://github.com/seino914.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TodoApi - ASP.NET Core Web API\n\nこのプロジェクトは、ASP.NET Core 8.0 を使用した Todo リスト管理 API です。JWT 認証を実装し、ユーザーごとの Todo 管理を可能にします。\n\n## 機能\n\n- ユーザー認証（JWT）\n  - ユーザー登録\n  - ログイン\n- Todo リスト管理\n  - Todo 一覧の取得\n  - 個別 Todo の取得\n  - Todo の作成\n  - Todo の更新\n  - Todo の削除\n\n## 必要条件\n\n- .NET 8.0 SDK\n- SQL Server（LocalDB も可）\n- Entity Framework Core Tools\n  ```bash\n  dotnet tool install --global dotnet-ef\n  ```\n\n## セットアップ\n\n1. リポジトリのクローン\n\n```bash\ngit clone \u003crepository-url\u003e\ncd backend\n```\n\n2. 開発環境の設定\n\n```bash\n# appsettings.Development.jsonの作成\ncp appsettings.Development.template.json appsettings.Development.json\n```\n\n必要に応じて`appsettings.Development.json`の設定を編集してください。\n\n3. 依存関係のインストール\n\n```bash\ndotnet restore\n```\n\n4. データベースの更新\n\n```bash\n# マイグレーションの作成（初回のみ）\ndotnet ef migrations add InitialCreate\n\n# データベースの更新\ndotnet ef database update\n```\n\n5. アプリケーションの実行\n\n```bash\ndotnet run\n```\n\nアプリケーションは以下の URL で実行されます：\n\n- API: http://localhost:5065\n- Swagger UI: http://localhost:5065/swagger\n\n## API エンドポイント\n\n### 認証\n\n- POST /api/auth/register\n\n  - 新規ユーザー登録\n\n  ```json\n  {\n    \"username\": \"string\",\n    \"password\": \"string\"\n  }\n  ```\n\n- POST /api/auth/login\n  - ログイン\n  ```json\n  {\n    \"username\": \"string\",\n    \"password\": \"string\"\n  }\n  ```\n\n### Todo 管理（要認証）\n\n- GET /api/todo\n\n  - すべての Todo を取得\n\n- GET /api/todo/{id}\n\n  - 特定の Todo を取得\n\n- POST /api/todo\n\n  - 新しい Todo を作成\n\n  ```json\n  {\n    \"title\": \"string\",\n    \"description\": \"string\",\n    \"isCompleted\": false\n  }\n  ```\n\n- PUT /api/todo/{id}\n\n  - Todo を更新\n\n  ```json\n  {\n    \"title\": \"string\",\n    \"description\": \"string\",\n    \"isCompleted\": \"boolean\"\n  }\n  ```\n\n- DELETE /api/todo/{id}\n  - Todo を削除\n\n## 認証\n\nAPI は JWT Bearer トークン認証を使用します。`/api/auth/login`エンドポイントで取得したトークンを、以降のリクエストの Authorization ヘッダーに含める必要があります：\n\n```\nAuthorization: Bearer \u003cyour-token\u003e\n```\n\n## 開発環境\n\n- Visual Studio Code または Visual Studio 2022\n- Swagger UI: http://localhost:5065/swagger\n\n## WSL 環境での注意点\n\nWSL 環境では、HTTPS の設定が複雑になる場合があるため、開発環境では HTTP を使用するように設定されています。\n本番環境にデプロイする際は、適切な HTTPS 設定を行ってください。\n\n## トラブルシューティング\n\n### データベース接続エラー\n\n- SQL Server が実行されていることを確認してください\n- `appsettings.Development.json`の接続文字列が正しいことを確認してください\n\n### マイグレーションエラー\n\n- Entity Framework Core Tools がインストールされていることを確認してください\n- 以下のコマンドでマイグレーションをリセットできます：\n  ```bash\n  dotnet ef database drop\n  dotnet ef migrations remove\n  dotnet ef migrations add InitialCreate\n  dotnet ef database update\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseino914%2Fdotnet_webapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseino914%2Fdotnet_webapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseino914%2Fdotnet_webapi/lists"}