How tuandtit/shopapp-angular works
Main Components
• Frontend (Angular Application): The entire application is client-side, serving as the user interface.
• Components: Break down the application into its various Angular components. For example:
• Header (src/app/header)
• Footer (src/app/footer)
• Home (src/app/home)
• Detail Product (src/app/detail-product)
• Login (src/app/login)
• Register (src/app/register)
• Order & Order Confirmation (src/app/order and src/app/order-confirm)
• Routing Module: The app-routing.module.ts shows how navigation within the single page app is structured.
• Entry Point: index.html and main.ts, which bootstrap the Angular application.
File Structure
• The top-level structure includes configuration files like angular.json and package.json, indicating build and dependency management.
• The src directory is where the application lives:
• The public folder likely contains static files.
• The src/app folder includes all the key Angular components.
• The modular nature of Angular is evident – every functional area (e.g., login, register) has its own folder containing HTML, SCSS, and TypeScript files.
Architectural Patterns or Design Principles
• Component-based architecture: Each UI segment (header, footer, etc.) is encapsulated in its own component, contributing to the separation of concerns.
• Routing: The use of a dedicated routing module (app-routing.module.ts) represents the navigational structure, mapping URLs to components.
• Angular CLI’s default project structure promotes modularization, easy component scalability, and separation of UI, styling, and business logic.
• Use clear labels for each component, e.g., “Header Component”, “Login Component”, etc.
• Bootstrapping flow: index.html → main.ts → App Module.
• Navigation flow between components via the routing module (ex: Home → Detail Product, Home → Login).