Skip to content

Conversation

@iloveuhyeon
Copy link
Collaborator

๐Ÿ’ก ๊ฐœ์š”

  • User Api๋ฅผ ์—ฐ๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค
  • ๊ฐ๊ฐ์˜ ํŽ˜์ด์ง€์— ๋งž๋Š” API๋ฅผ ์—ฐ๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค
  • ๋””์ž์ธ์— ๋งž๊ฒŒ ์ฝ”๋“œ๋ฅผ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค

๐Ÿ“ƒ ์ž‘์—…๋‚ด์šฉ

  • Retrofit์„ ์‚ฌ์šฉํ•ด์„œ user service๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค
  • ๊ฐ๊ฐ์— ๋งž๋Š” data, domain์„ ํด๋ฆฐ ์•„ํ‚คํ…์ณ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉฐ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค
  • ๊ฐ๊ฐ์˜ ํŽ˜์ด์ง€์— Riverpods์„ ์‚ฌ์šฉํ•˜์—ฌ ์ƒํƒœ๊ด€๋ฆฌ๋ฅผ ์ง„ํ–‰ํ•˜์˜€์Šต๋‹ˆ๋‹ค

๐Ÿ”€ ๋ณ€๊ฒฝ์‚ฌํ•ญ

๐Ÿ™‹โ€โ™‚๏ธ ์งˆ๋ฌธ์‚ฌํ•ญ

๐Ÿด ์‚ฌ์šฉ๋ฐฉ๋ฒ•

๐ŸŽธ ๊ธฐํƒ€

Ensures that generated Dart files are excluded from version control, preventing unnecessary tracking of build artifacts.
Configures dependency injection using GetIt for Dio, CookieJar,
APIs, DataSources, and Repositories.

This centralizes dependency management and improves testability.
Prevents the app from crashing when the base URL is not defined in the .env file.

Logs an error message instead of throwing an exception.
Uses an empty string as the base URL if it is null.
Moves the router and menu bottom files to the core directory to better organize the project structure and improve maintainability.
Refactors import paths for data models to align with the project's domain-driven structure.
This change improves code organization and maintainability by ensuring components import data models from the correct domain layer.
Updates imports to reflect changes in folder structure.

Refactors dependency injection initialization.
Updates dependencies to their latest versions, including dio, retrofit and go_router.

Adds retrofit_generator, json_serializable, build_runner, and freezed dependencies for code generation.

Introduces freezed_annotation dependency and adjusts retrofit version for compatibility.
Defines the user API using Retrofit for handling sign-in, sign-up, email sending, and email verification functionalities.
This API will serve as the interface for interacting with the user authentication backend.
Defines data transfer objects (DTOs) for user sign-in and sign-up requests. These DTOs facilitate communication between the client and server for user authentication purposes.
The DTOs are generated using Freezed for immutability and JSON serialization.
Defines an abstract class and its implementation for handling user authentication and email verification operations. This introduces a layer of abstraction for accessing user-related data.
Defines the UserRepository interface with methods for sign-in, sign-up, email verification, and sending email.

Implements the UserRepositoryImpl class, which provides concrete implementations of the methods defined in the UserRepository interface, utilizing a UserDataSource for data access.
Moves the asset entity to the domain layer for better separation
of concerns.

Adds .gitkeep files to the my_capital repositories and use_cases
directories to ensure they are included in the repository.
Refactors file structure for better organization and readability.
Implements new screens for password creation and school selection during user sign-up.
Updates routing logic to accommodate new user flows.
Improves UI consistency across the app.
Updates various dependencies to their latest versions, including fl_chart, go_router, retrofit_generator, riverpod, flutter_riverpod and rxdart.
Configures the analyzer to exclude generated files and ignore specific annotation errors, improving code analysis efficiency and reducing noise.
This commit moves the router and menu bottom widget to the config directory.
This change aims to improve the project's organization and maintainability by centralizing configuration-related files.
Changes the logging mechanism from 'log' to 'print'
for Dio error messages. This simplifies debugging and
ensures error messages are consistently displayed in
the console.
Adds a Dio interceptor that logs the request body to the console.

This aids in debugging network requests by providing visibility into the data being sent to the server.
Sets up dependency injection for sign-in and sign-up features.

Registers Dio instances, User and Neis APIs, data sources, repositories,
and use cases related to user authentication.
Implements the user data source and its implementation.
It introduces methods for user authentication,
email verification, and searching schools.
It also creates a remote data source to handle the
requests and responses from the APIs.
Updates the sign-up DTO to include username and school information.

Makes the SignInRequestDto constructor a const factory.
Adds data transfer objects for sign up related API requests and responses.
These DTOs are used for school search, email verification, and sending email functionalities.
They define the data structure for communication between the client and server during the sign-up process.
Implements mappers for remote requests related to user
sign-up, including sending email, verifying email, and
searching for schools. Also includes sign-in request mapper.
Removes the old UserRepository interface.

This change is part of a refactoring effort to decouple the repository interface from its implementation, enhancing separation of concerns.
Introduces the NeisApi for school search during signup.
Renames UserApi file and updates the UserApi to include methods for sending and verifying email during user registration, enhancing user authentication and validation processes.
Implements the user repository to handle sign-in, sign-up,
email verification, and school search functionalities.

Uses data sources and mappers for data transformation
between the data and domain layers.
Creates the `SignInEntity` using Freezed to handle sign-in
data. This entity includes email and password fields,
along with JSON serialization/deserialization support.
Defines the abstract `SignInRepository` class.

This interface outlines the contract for sign-in operations,
allowing for different implementations (e.g., local storage,
remote API) while maintaining a consistent interface for the
rest of the application.
Introduces an abstract class for the sign-in use case.

This defines the contract for any class that implements sign-in
functionality, promoting loose coupling and testability.
Adds the implementation for the sign-in use case,
which orchestrates the sign-in process by utilizing
the sign-in repository.
Implements a controller to handle user name input during the sign-up process.

The controller manages the text input, validates the username format (Korean characters only, minimum length of 2), and enables/disables a button based on the validation result.
It also provides appropriate error messages if the validation fails.
Implements the signup password controller using Riverpod.

This controller manages the state and logic for the password and confirm password fields in the signup process.
It includes validation for password strength and matching confirmation password.
It also handles navigation to the next step in the signup flow.
Creates the `SignupSchoolController` to handle school search and signup logic.

This controller manages the school name input, searches for schools based on user input using a debounce mechanism, and handles the signup process with the selected school. It also manages the state of the school search and selection.
Implements mappers to transform data between the presentation layer (states) and the domain layer (entities) for the sign-up feature.

Specifically, it creates mappers for email verification and school search functionalities.
Implements states for different parts of the sign-up process, including email, name, password, and school information, using the Freezed package for immutable data classes.
This provides a structured way to manage and update the UI state during the registration flow.
Adds a screen for creating a password during signup.
Includes password validation and confirmation.
Navigates to the next screen upon successful password creation.
@iloveuhyeon iloveuhyeon self-assigned this Jul 8, 2025
@iloveuhyeon iloveuhyeon added the ๊ฐœ๋ฐœ ๊ธฐ๋Šฅ์„ ๊ฐœ๋ฐœํ•˜๊ฑฐ๋‚˜ ํผ๋ธ”๋ฆฌ์‹ฑ์„ ์ง„ํ–‰ํ• ๋•Œ label Jul 8, 2025
@iloveuhyeon iloveuhyeon linked an issue Jul 8, 2025 that may be closed by this pull request
@iloveuhyeon iloveuhyeon changed the title Feature/#22 connect user api ๐Ÿ”€ :: (#22) Connect user Api Jul 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates the new User API endpoints and refactors the sign-up and sign-in flows to use Riverpod state controllers and clean architecture layers.

  • Added Retrofit, Freezed, Riverpod, and code generation dependencies.
  • Converted sign-up and sign-in screens from StatefulWidgets to ConsumerWidgets with dedicated controllers.
  • Implemented network layer (UserApi, NeisApi), data sources, repositories, use cases, and DI setup.

Reviewed Changes

Copilot reviewed 56 out of 65 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pubspec.yaml Updated dependencies (Retrofit, Riverpod, Freezed, etc.)
lib/presentation/sign_up/state/sign_up_school_state.dart Added Freezed state for school selection
lib/presentation/sign_up/state/sign_up_password_state.dart Added Freezed state for password entry
lib/presentation/sign_up/state/sign_up_name_state.dart Added Freezed state for username entry
lib/presentation/sign_up/screens/password_create_screen.dart Refactored to ConsumerWidget; hooked up password controller
lib/presentation/sign_up/screens/name_input_screen.dart Refactored to ConsumerWidget; hooked up name controller
lib/presentation/sign_up/screens/find_school_screen.dart Refactored to ConsumerWidget; hooked up school controller
lib/presentation/sign_up/screens/email_auth_screen.dart Refactored to ConsumerWidget; hooked up email controller
lib/presentation/sign_up/controller/sign_up_school_controller.dart Added School search state notifier
lib/presentation/sign_up/controller/sign_up_password_controller.dart Added Password state notifier
lib/presentation/sign_up/controller/sign_up_name_controller.dart Added Username state notifier
lib/presentation/sign_up/controller/sign_up_email_controller.dart Added Email auth state notifier
lib/data/user/service/user_api.dart Defined Retrofit UserApi
lib/data/user/service/neis_api.dart Defined Retrofit NeisApi
lib/data/user/data_sources/user_data_source_impl.dart Implemented UserDataSource with both APIs
lib/data/user/repositories/user_repository_impl.dart Implemented repositories for sign-in/up and school search
lib/core/network/api/api_client.dart Configured Dio and Neis clients; added interceptors
lib/core/config/di/dependencies.dart Wire up DI for network, APIs, data sources, repos, use cases
lib/main.dart Wrapped app in ProviderScope; initialized DI
Comments suppressed due to low confidence (2)

lib/presentation/sign_up/screens/password_create_screen.dart:65

  • [nitpick] The parameter name String shadows the type and can be confusing; consider renaming it to _ or value.
                    validator: (String) => null,

lib/presentation/sign_up/screens/name_input_screen.dart:94

  • Use a specific callback type like VoidCallback instead of the generic Function for onTap parameters.
                ),

Comment on lines +20 to +26

SignupSchoolController(this._signUpUseCase) : super(SignUpSchoolState()) {
_schoolNameController.addListener(() {
_schoolNameSubject.add(_schoolNameController.text);
});

_schoolNameSubject.debounceTime(const Duration(milliseconds: 500)).listen((
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subscription from listen isn't stored; consider saving and cancelling it in dispose to avoid potential memory leaks.

Suggested change
SignupSchoolController(this._signUpUseCase) : super(SignUpSchoolState()) {
_schoolNameController.addListener(() {
_schoolNameSubject.add(_schoolNameController.text);
});
_schoolNameSubject.debounceTime(const Duration(milliseconds: 500)).listen((
StreamSubscription? _schoolNameSubscription;
SignupSchoolController(this._signUpUseCase) : super(SignUpSchoolState()) {
_schoolNameController.addListener(() {
_schoolNameSubject.add(_schoolNameController.text);
});
_schoolNameSubscription = _schoolNameSubject.debounceTime(const Duration(milliseconds: 500)).listen((

Copilot uses AI. Check for mistakes.
iloveuhyeon and others added 3 commits July 8, 2025 16:46
Removes unused imports from data layer files.
Updates color definition to use withValues method.
Ensures generated code is up-to-date during CI/CD by
incorporating the `build_runner` step. This helps prevent
analysis errors and ensures consistency.
@aiden30015
Copy link
Contributor

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค...

aiden30015
aiden30015 previously approved these changes Jul 8, 2025
@bluemoon983
Copy link
Contributor

LGTM!

DAMNyul
DAMNyul previously approved these changes Jul 8, 2025
Copy link
Collaborator

@DAMNyul DAMNyul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ข‹์€๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Adds the .fvm/ directory to .gitignore to prevent accidental commits of the FVM version cache.

Updates the .idea/Jusicool-iOS.iml file, likely due to IDE configuration changes.
@iloveuhyeon iloveuhyeon dismissed stale reviews from DAMNyul and aiden30015 via afaa6da July 8, 2025 08:26
@iloveuhyeon iloveuhyeon merged commit eb989a5 into develop Jul 8, 2025
1 check passed
@iloveuhyeon iloveuhyeon deleted the feature/#22-connect-user-api branch July 8, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

๊ฐœ๋ฐœ ๊ธฐ๋Šฅ์„ ๊ฐœ๋ฐœํ•˜๊ฑฐ๋‚˜ ํผ๋ธ”๋ฆฌ์‹ฑ์„ ์ง„ํ–‰ํ• ๋•Œ

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User API๋ฅผ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค

5 participants