User Account Area
Relevant source files
The following files were used as context for generating this wiki page:
- marketplace-frontend/src/app/modules/market-account/market-account.component.ts
- marketplace-frontend/src/app/modules/market-account/components/account-card/account-card.component.ts
- marketplace-frontend/src/app/modules/market-account/services/yury.service.ts
- marketplace-frontend/src/app/components/market-header/market-header.component.html
- marketplace-frontend/src/app/modules/market-account/market-account.module.ts
- marketplace-frontend/src/app/constants/validators.ts
The User Account Area provides authenticated users with tools to manage their personal profiles and view account-specific information. It serves as a centralized hub for account management within the marketplace application.
High-Level Architecture
The User Account Area is implemented as a dedicated Angular module (MarketAccountModule) that encapsulates account-related components and services. Users access this area through the main application header once they are authenticated.
The diagram shows the navigation flow from the application header to the account module and its internal components.
Sources: marketplace-frontend/src/app/modules/market-account/market-account.module.ts, marketplace-frontend/src/app/components/market-header/market-header.component.html:36-40
Core Components
Market Account Component
This is the primary container for the account section. It coordinates data retrieval and displays account-related information to the user.
Sources: marketplace-frontend/src/app/modules/market-account/market-account.component.ts
Account Card Component
The AccountCardComponent is a presentation component used within the account area to display specific segments of user data or metrics.
Sources: marketplace-frontend/src/app/modules/market-account/components/account-card/account-card.component.ts
Data Management and Services
The YuryService handles data operations for the account area. While the specific implementation details of its methods are localized to the service, it provides the necessary data bridge between the backend and the frontend account components.
Sources: marketplace-frontend/src/app/modules/market-account/services/yury.service.ts
Authentication and Access
Access to the account area is guarded by user session state. The header component dynamically displays user information and navigation links based on the presence of a customerInfo object.
| Feature | Description |
|---|---|
| Customer Info | Displays "Hi, {{userName}}" when the user is logged in. |
| Account Link | Navigates the user to the MarketAccountComponent. |
| Logout | Terminates the user session and triggers the _logout() function. |
Sources: marketplace-frontend/src/app/components/market-header/market-header.component.html:26-50
Validation Logic
User account data, specifically during creation or modification, must adhere to strict validation rules defined in the application constants.
| Parameter | Validation Rule | Constant Reference |
|---|---|---|
| Username | 8-16 characters, alphanumeric, periods/underscores allowed (not at start/end) | USERNAME_VALIDATOR |
| Password | Minimum 8, Maximum 16 characters; must contain uppercase, lowercase, and numbers | PASSWORD_VALIDATOR |
| First Name | Maximum 20 characters, alphabetic and hyphens only | FIRST_NAME_VALIDATOR |
Sources: marketplace-frontend/src/app/constants/validators.ts:1-10
User Navigation Flow
The following sequence diagram illustrates how a user interacts with the application header to enter the User Account Area.
This diagram represents the user's path from the header menu to the account page.
Sources: marketplace-frontend/src/app/components/market-header/market-header.component.html:27-44
Summary
The User Account Area provides a structured environment for users to view and manage their profiles. It utilizes a modular Angular architecture, ensuring that account management logic is isolated and maintainable. Security is enforced through dynamic UI rendering in the header and strict input validation defined in the system constants.