diff --git a/backend/src/main/java/com/example/todoapp/config/SecurityConfig.java b/backend/src/main/java/com/example/todoapp/config/SecurityConfig.java
index 0c91b4f..326888d 100644
--- a/backend/src/main/java/com/example/todoapp/config/SecurityConfig.java
+++ b/backend/src/main/java/com/example/todoapp/config/SecurityConfig.java
@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@@ -49,8 +50,10 @@ public class SecurityConfig {
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeHttpRequests()
- .requestMatchers("/auth/**").permitAll() // 認証エンドポイントは認証不要
- .anyRequest().authenticated(); // その他のエンドポイントは認証必要
+ // .requestMatchers("/auth/**").permitAll() // 認証エンドポイントは認証不要
+ // .anyRequest().authenticated()
+ .anyRequest().permitAll();
+ ; // その他のエンドポイントは認証必要
// JWTフィルターを認証フィルターの前に追加
http.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
diff --git a/backend/src/main/java/com/example/todoapp/controller/ToBuysController.java b/backend/src/main/java/com/example/todoapp/controller/ToBuysController.java
new file mode 100644
index 0000000..7b81ea3
--- /dev/null
+++ b/backend/src/main/java/com/example/todoapp/controller/ToBuysController.java
@@ -0,0 +1,140 @@
+//--------------------------------
+// ToBuysController.java
+//
+// 更新履歴:2025/06/05 新規作成
+// Copyright(c) 2025 IVIS All rights reserved.
+//--------------------------------------------
+
+package com.example.todoapp.controller;
+
+import com.example.todoapp.dto.DeleteToBuyRequest;
+import com.example.todoapp.dto.ToBuyResponse;
+import com.example.todoapp.dto.ToBuysDTO;
+import com.example.todoapp.model.ToBuys;
+import com.example.todoapp.model.User;
+import com.example.todoapp.repository.UserRepository;
+import com.example.todoapp.service.ToBuysService;
+import jakarta.validation.Valid;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 購入リストに関するRESTコントローラー
+ *
+ * このコントローラーは、購入リスト (to_buys) へのアイテム追加機能を提供します。
+ * リクエストボディには ToBuyDTO 形式のデータが期待されます。
+ *
+ */
+@RestController
+@RequestMapping("/tobuy")
+public class ToBuysController {
+
+ @Autowired
+ private ToBuysService toBuysService;
+
+ @Autowired
+ private UserRepository userRepository;
+
+ /**
+ * 新しい購入アイテムを追加する
+ *
+ * @param dto 追加する購入アイテムのデータ(DTO)
+ * @return 成功時のレスポンスメッセージ
+ */
+
+ @PostMapping("/add")
+ public ResponseEntity addToBuys(
+ @Valid @RequestBody ToBuysDTO dto,
+ Authentication authentication) {
+ toBuysService.addToBuys(dto, authentication);
+ return ResponseEntity.ok("Item added to 'To Buys' successfully");
+ }
+
+ @PutMapping("/update")
+ public ResponseEntity updateToBuys(
+ @Valid @RequestBody ToBuysDTO dto,
+ Authentication authentication) {
+ toBuysService.updateToBuys(dto, authentication);
+ return ResponseEntity.ok("Item updated to 'To Buys' successfully");
+ }
+
+
+
+ /**
+ * 指定されたユーザーIDに基づいてすべての「買うもの」リストを取得する
+ *
+ * @param userId ユーザーID
+ * @return ユーザーに紐づく「買うもの」リスト
+ */
+ @GetMapping("/get")
+ public ResponseEntity> getAllToBuysByUserId(Authentication authentication) {
+
+ // 認証されたユーザー名を取得
+ String username = authentication.getName();
+
+ // ユーザー情報を取得
+ User user = userRepository.findByUsername(username)
+ .orElseThrow(() -> new UsernameNotFoundException("User not found"));
+
+ List toBuysList = toBuysService.getToBuysByUserId(user.getId());
+
+ // DTO形式に変換して返す
+ List responseList = toBuysList.stream()
+ .map(toBuy -> {
+ ToBuyResponse resp = new ToBuyResponse();
+ resp.setTobuy_id(toBuy.getTobuy_id());
+ resp.setStuff_id(toBuy.getStuffs().getStuff_id());
+ resp.setStuff_name(toBuy.getStuffs().getStuff_name());
+ resp.setAmount(toBuy.getAmount());
+ resp.setShop(toBuy.getStore());
+ return resp;
+ })
+ .collect(Collectors.toList());
+
+ Map responseBody = new HashMap<>();
+ responseBody.put("tobuy_array", responseList);
+
+ return ResponseEntity.ok(responseList);
+ }
+
+ /**
+ * ユーザーが指定したIDの「買うもの」を削除する
+ *
+ * @param request 削除する「買うもの」の情報を含むリクエストボディ
+ * @return 削除が成功した場合にtrueを含むレスポンス
+ */
+ @DeleteMapping("/delete")
+ public ResponseEntity