This commit introduces a dedicated user profile screen (`UserScreen`) and significantly enhances the authentication system by adding registration, auto-login, and robust form validation.
**Key Changes:**
* **feat(UserScreen):**
* Added a new `UserScreen` to display the logged-in user's profile.
* Displays user details including avatar, nickname, ID, bio, location, and email in a styled card.
* Includes a menu section for actions like "Post Management," "Settings," and "About."
* Shows a "not logged in" state to prompt users to log in.
* **feat(Auth):**
* **Registration:** Implemented a registration flow alongside the login flow on the `LoginScreen`. Users can now switch between Login and Register modes.
* **Auto-Login:** The app now automatically logs in the user on startup if a valid token or saved credentials exist, improving user experience.
* **Token Management:** Enhanced `TokenManager` to handle JWT parsing to extract `userId`, check token validity (expiration), and securely store credentials. Added `java-jwt` dependency for this.
* **Logout:** Improved the logout function to clear all stored tokens and user credentials from `SharedPreferences`.
* **feat(Validation):**
* Introduced `ValidationUtils` to provide real-time validation for phone number, password, and nickname fields on the `LoginScreen`.
* Input fields now display specific error messages to guide the user (e.g., "Password must contain a letter," "Invalid phone number format").
* **refactor(LoginScreen):**
* Redesigned the `LoginScreen` to support both login and registration (`AuthMode`) with animated transitions between modes and form fields.
* Form submission buttons are dynamically enabled based on validation results.
* After successful registration, the user is now automatically logged in.
* **refactor(UserViewModel):**
* Integrated auto-login logic (`checkAutoLogin`) that runs on initialization.
* Refactored `login` and `register` flows to handle token storage and fetch user profile data immediately after authentication.
* Added `isLoggedIn()` to provide a reliable check of the current authentication state.
* **refactor(TopBar):**
* The top bar avatar now correctly reflects the user's login state. It displays the user's avatar when logged in and a generic app icon when logged out.
* Clicking the avatar/icon now navigates to the `UserScreen` if logged in, or the `LoginScreen` if not.
This commit introduces a comprehensive set of features, establishing the core functionality of the application using an MVVM architecture with Hilt for dependency injection.
**Key Changes:**
* **UI & Navigation:**
* Implemented navigation between the main feed, post details, and login screens using Jetpack Navigation Compose.
* Added `TalkScreen` for displaying a feed of posts and `PostDetailScreen` for viewing individual posts and their comments.
* Created a `LoginScreen` with input fields and authentication logic.
* Introduced `PostCardItem` and `CommentItem` Composables for a consistent and reusable UI.
* Added shared element transitions for a smoother user experience when navigating to post details.
* **Architecture & State Management:**
* Integrated Hilt for dependency injection across ViewModels and Repositories.
* Created ViewModels (`TalkViewModel`, `PostDetailViewModel`, `UserViewModel`, `CommentViewModel`, etc.) to manage UI state and business logic.
* Implemented Repository pattern for abstracting data sources from the backend API.
* Defined UI state data classes to ensure a predictable and observable state flow.
* **Data & Models:**
* Introduced data models for `PostCard` and `CommentCard` to aggregate and display complex data structures.
* Added `PostDetailRepository` to orchestrate fetching of post and comment data concurrently.
* Refined DTOs, such as `CreateCommentDto`, for API interactions.
* **Dependencies & Tooling:**
* Added Hilt, Navigation Compose, and Lifecycle ViewModel dependencies.
* Included the `pangu-jvm` library for improved text formatting with spacing between Chinese and English characters.