Overview
The portfolio uses Angular’s modern standalone components architecture, eliminating the need for NgModules. Each component is self-contained with its own TypeScript class, HTML template, CSS styles, and unit tests.Standalone Components
Starting with Angular 14+, standalone components allow you to build applications without NgModules. This portfolio leverages this modern approach for a simpler, more maintainable architecture.Notice the absence of
standalone: true in the Header component. In Angular 19+, components are standalone by default. The standalone: true flag is only needed if explicitly declaring it for backward compatibility or clarity.Component Structure
Each component follows a consistent four-file structure:1. TypeScript Class (.ts)
Contains the component logic, state, and methods.
Location pattern: src/app/components/[component-name]/[component-name].ts
Example:
src/app/components/header/header.tssrc/app/components/hero/hero.tssrc/app/components/about/about.ts
2. HTML Template (.html)
Defines the component’s view structure.
Location pattern: src/app/components/[component-name]/[component-name].html
3. CSS Styles (.css)
Component-scoped styles using Tailwind CSS utility classes.
Location pattern: src/app/components/[component-name]/[component-name].css
4. Unit Tests (.spec.ts)
Jasmine/Karma test specifications.
Location pattern: src/app/components/[component-name]/[component-name].spec.ts
Available Components
The portfolio contains six main components:Header
Navigation bar with menu toggle and CV download functionalityLocation:
src/app/components/header/Hero
Landing section with introduction and call-to-actionLocation:
src/app/components/hero/About
Personal information and skills overviewLocation:
src/app/components/about/Projects
Portfolio showcase with project cards and detailsLocation:
src/app/components/projects/Contact
Contact form and social media linksLocation:
src/app/components/contact/Footer
Footer with links and copyright informationLocation:
src/app/components/footer/Root Application Component
TheApp component serves as the root component that composes all other components together.
- Explicit imports: All components are imported directly in the
importsarray - Signal-based state: Uses Angular signals for reactive state management (
title) - Dark mode toggle: Manipulates the
darkclass on the root element - Single template: Renders all components in a single-page layout
Component Communication
Parent to Child
Components can receive data through@Input() decorators (when needed).
Child to Parent
Components can emit events through@Output() decorators with EventEmitter (when needed).
Shared State
The application can use Angular signals for reactive state management across components.Since this is a single-page portfolio without complex state management needs, most components are self-contained without extensive parent-child communication.
Benefits of Standalone Components
Simpler Architecture
Simpler Architecture
No need to declare, import, or export components in NgModules. Each component is self-contained.
Better Tree Shaking
Better Tree Shaking
Unused components and dependencies are more easily eliminated during the build process.
Improved Developer Experience
Improved Developer Experience
Less boilerplate code and easier to understand component dependencies.
Faster Compilation
Faster Compilation
The Angular compiler can optimize standalone components more efficiently.
Testing Components
Each component includes a.spec.ts file for unit testing: