Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • AngularJS Tutorial
  • AngularJS Directives
  • AngularJS Functions
  • AngularJS Filters
  • AngularJS Examples
  • AngularJS Interview Questions
  • Angular ngx Bootstrap
  • AngularJS Cheat Sheet
  • AngularJS PrimeNG
  • JavaScript
  • Web Technology
Open In App
Next Article:
Dice Rolling App Using Angular
Next article icon

Portfolio Website Using Angular

Last Updated : 14 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Building a portfolio website is a fantastic way to highlight your skills and showcase your work. This guide will walk you through creating a modern portfolio site using Angular, enhanced with Tailwind CSS for styling. We’ll cover setting up the project, integrating Tailwind CSS, and building out your site with step-by-step instructions.

Project Preview

Rushik-Portfolio
Project Preview

Prerequisites

  • Angular CLI
  • TypeScript
  • Tailwind CSS

Approach

  • Set up a new Angular project.
  • Integrate Tailwind CSS for styling.
  • Create and configure necessary components.
  • Implement routing for navigation.
  • Style components using Tailwind CSS.

Steps to Create the Application

Step 1: Install Angular CLI

Open your terminal and run:

npm install -g @angular/cli

Step 2: Create a New Angular Project

ng new portfolio-website

Step 3: Navigate to Your Project Directory

cd portfolio-website

Step 4: Install Tailwind CSS

Install Tailwind CSS and its dependencies:

npm install tailwindcss postcss autoprefixer

Initialize Tailwind CSS:

npx tailwindcss init

This creates a tailwind.config.js file.

Step 5: Configure Tailwind CSS

Update tailwind.config.js to include paths to your Angular files:

JavaScript
/** @type {import('tailwindcss').Config} */ module.exports = {     content: [         "./src/**/*.{html,ts}",     ],     theme: {         extend: {},     },     plugins: [], } 

Add Tailwind’s directives to your global stylesheet (src/styles.css):

CSS
@tailwind base; @tailwind components; @tailwind utilities; 

Dependencies

"dependencies": {
"@angular/animations": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/platform-server": "^18.0.0",
"@angular/router": "^18.0.0",
"@angular/ssr": "^18.0.0",
"autoprefixer": "^10.4.20",
"express": "^4.18.2",
"postcss": "^8.4.41",
"rxjs": "~7.8.0",
"tailwindcss": "^3.4.9",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
}

Folder Structure

Rushik-Ghuntala-Portfolio-Folder-Structure
Folder Structure

Step 6: Create Components

ng generate component home
ng generate component projects
ng generate component about
ng generate component contact

Home Component Code

Below mentioned is the HTML and TypeScript code of Home Component of Portfolio Website. This Home Component will be covering a section of the Portfolio Website in bg-gray-100 and displaying the content of H1 and <p> tag.

HTML
<!-- src/app/home/home.component.html --> <section class="text-center py-16 bg-gray-100">     <h1 class="text-2xl text-gray-800">Welcome to My Portfolio</h1>     <p class="text-4xl font-bold text-gray-600 mt-4">Hi, I'm Rushik Ghuntala 👋🏻</p> </section> 
JavaScript
//src/app/home/home.component.ts import { Component } from '@angular/core';  @Component({     selector: 'app-home',     standalone: true, // This line declares the component as standalone     templateUrl: './home.component.html',     styleUrls: ['./home.component.css'], }) export class HomeComponent { } 

About Component Code

Below mentioned is the HTML and TypeScript Code of the About Component of Portfolio Website.This Component will be covering 'About Me' Section of Portfolio Website and will be displaying the content of <p> tag.

HTML
<!-- src/app/about/about.component.html --> <section class="py-16 bg-white">     <h2 class="text-3xl font-bold text-gray-800 text-center">About Me</h2>     <p class="text-lg text-gray-600 mt-4 max-w-2xl mx-auto text-center">         I'm a seasoned full stack developer specializing in Next.js, React.js,       and Node.js, with a knack for seamless         database         integration. Beyond development, I excel in design, crafting captivating       animations and visually stunning user         interfaces that elevate digital experiences. With over 2 years in web       application creation, my passion for         innovation         remains as strong as ever.     </p> </section> 
JavaScript
// src/app/about/about.component.ts import { Component } from '@angular/core';  @Component({     selector: 'app-about',     templateUrl: './about.component.html',     styleUrls: ['./about.component.css'],     standalone: true, }) export class AboutComponent { } 

Project Component Code

Below mentioned is the HTML and TypeScript Code of Project Component of Portfolio Website. This Component will be covering the 'My Projects' section in this the projects will be displayed in grid layout followed by the description of the respective project.

HTML
<!-- src/app/projects/projects.component.html --> <section class="py-16 bg-gray-100">     <h2 class="text-3xl font-bold text-gray-800 text-center">My Projects</h2>     <div class="mt-8 grid gap-8 grid-cols-1 sm:grid-cols-2 md:grid-cols-3">         <div class="bg-white p-6 rounded-lg shadow-lg">             <h3 class="text-xl font-semibold text-gray-800">Project 1</h3>             <p class="text-gray-600 mt-2">Description of project 1.</p>         </div>         <div class="bg-white p-6 rounded-lg shadow-lg">             <h3 class="text-xl font-semibold text-gray-800">Project 2</h3>             <p class="text-gray-600 mt-2">Description of project 2.</p>         </div>         <div class="bg-white p-6 rounded-lg shadow-lg">             <h3 class="text-xl font-semibold text-gray-800">Project 3</h3>             <p class="text-gray-600 mt-2">Description of project 3.</p>         </div>     </div> </section> 
JavaScript
import { Component } from '@angular/core';  @Component({     selector: 'app-projects',     templateUrl: './projects.component.html',     styleUrls: ['./projects.component.css'],     standalone: true, // Mark this component as standalone }) export class ProjectsComponent { } 

Contact Component Code

Below mentioned is the HTML and TypeScript Code of Contact Component of Portfolio Website. This Component will be having a Contact Us form.

HTML
<!-- src/app/contact/contact.component.html --> <section class="py-16 bg-white">     <h2 class="text-3xl font-bold text-gray-800 text-center">Contact Me</h2>     <form class="max-w-lg mx-auto mt-8">         <div class="mb-4">             <label class="block text-gray-700 font-bold">Name</label>             <input type="text" class="w-full p-2 border border-gray-300 rounded-lg" />         </div>         <div class="mb-4">             <label class="block text-gray-700 font-bold">Email</label>             <input type="email" class="w-full p-2 border border-gray-300 rounded-lg" />         </div>         <div class="mb-4">             <label class="block text-gray-700 font-bold">Message</label>             <textarea class="w-full p-2 border border-gray-300 rounded-lg"></textarea>         </div>         <button type="submit" class="w-full py-2 px-4 bg-blue-600 text-white font-bold rounded-lg">             Send         </button>     </form> </section> 
JavaScript
import { Component } from '@angular/core';  @Component({     selector: 'app-contact',     templateUrl: './contact.component.html',     styleUrls: ['./contact.component.css'],     standalone: true, // Mark this component as standalone }) export class ContactComponent { } 

App Component Code

Below mentioned app component which is the first component which gets loaded when an angular application is made.App Component covers all the components will which be executed when angular application runs.

HTML
<!-- src/app/app.component.html --> <div class="container mx-auto px-4">     <app-home></app-home>     <app-about></app-about>     <app-projects></app-projects>     <app-contact></app-contact> </div> 
JavaScript
//src/app/app.component.ts import { Component } from '@angular/core'; import { HomeComponent } from './home/home.component'; import { AboutComponent } from './about/about.component'; import { ProjectsComponent } from './projects/projects.component'; import { ContactComponent } from './contact/contact.component';  @Component({     selector: 'app-root',     templateUrl: './app.component.html',     styleUrls: ['./app.component.css'],     imports: [HomeComponent, AboutComponent, ProjectsComponent, ContactComponent],     standalone: true, }) export class AppComponent { } 
JavaScript
//src/app/app.routes.ts import { Routes } from '@angular/router'; import { HomeComponent } from './home/home.component'; import { AboutComponent } from './about/about.component'; import { ProjectsComponent } from './projects/projects.component'; import { ContactComponent } from './contact/contact.component';  export const routes: Routes = [     { path: '', component: HomeComponent },     { path: 'about', component: AboutComponent },     { path: 'projects', component: ProjectsComponent },     { path: 'contact', component: ContactComponent }, ]; 
JavaScript
// src/app/app.config.ts import { provideRouter } from '@angular/router'; import { routes } from './app.routes';  export const appConfig = [     provideRouter(routes),     // add other providers here ]; 
JavaScript
//src/app/app.config.server.ts import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; import { provideServerRendering } from '@angular/platform-server'; import { appConfig } from './app.config';  // Create a server-specific configuration with the providers array export const serverConfig: ApplicationConfig = {     providers: [         provideServerRendering(),         // other server-specific providers     ], };  // Wrap the appConfig in an ApplicationConfig object export const fullAppConfig: ApplicationConfig = {     providers: appConfig, };  // Merge the fullAppConfig and serverConfig into a single config export const config = mergeApplicationConfig(fullAppConfig, serverConfig); 
JavaScript
//src/main.ts import { bootstrapApplication } from '@angular/platform-browser'; import { AppComponent } from './app/app.component'; import { appConfig } from './app/app.config';  bootstrapApplication(AppComponent, {     providers: appConfig, }).catch((err) => console.error(err)); 

Running the Application

To start the application run the following command

ng serve --open

The application should now be accessible at http://localhost:4200.

Output

Rushik-Portfolio
Portfolio Website Output

Next Article
Dice Rolling App Using Angular

R

rushisoni2003
Improve
Article Tags :
  • Web Technologies
  • AngularJS
  • Angular-Projects

Similar Reads

  • How to Create Todo List in Angular 7 ?
    The ToDo app is used to help us to remember some important task. We just add the task and when accomplished, delete them. This to-do list uses various Bootstrap classes that make our web application not only attractive but also responsive. Approach: Create a new angular app using following command:
    2 min read
  • Build a Simple Web App with Express & Angular
    Building a simple web app using Express and Angular is a great way to understand the fundamentals of full-stack development. Express, a minimalist web framework for Node.js, handles the backend, while Angular, a powerful front-end framework, provides the structure for the client-side application. In
    5 min read
  • How to build progressive web app(PWA) in Angular 9 ?
    In this article, we will develop a PWA (Progressive Web App) using Angular. What is PWA ? Progressive Web Apps (PWAs) are web applications that have been designed so that they are capable, reliable, and installable. PWA are built and enhanced with modern APIs to deliver enhanced capabilities, reliab
    7 min read
  • Routing in Angular 9/10
    Routing in Angular allows the users to create a single-page application with multiple views and allows navigation between them. Users can switch between these views without losing the application state and properties. Approach: Create an Angular app that to be used.Create the navigation links inside
    3 min read
  • How to create a To-Do list using Drag and Drop in Angular 7 ?
    We can easily create a To-Do list using Drag-Drop module provided by angular Component Development Kit (CDK). First of all, create an angular component by using the following command- ng g c To-Do Now import CdkDragDrop, moveItemInArray, transferArrayItem from @angular/cdk/drag-drop to our to-Do com
    2 min read
  • How to make a multi-select dropdown using Angular 11/10 ?
    In this article, we will learn to build the multiple selection drop-down menu in Angular. To accomplish this task, we require Angular 10 or the Angular 11 version. Sometimes we need to display dynamically fetched multi-selected data in a drop-down menu, for this, we will use the npm @ng-select/ng-se
    3 min read
  • How to set focus on input field automatically on page load in AngularJS ?
    We can focus on any input field automatically using the angular directives. Here we create a custom directive that can auto-focus on any field in the form. Creating a custom directive is just like creating an Angular component. To create a custom directive we have to replace @Component decorator wit
    3 min read
  • How to Scroll to an Element on click in Angular ?
    In this article, we will see how to scroll to an element on click in Angular. Here, we will create a component that enables scrolling to specific targets when a button is pressed within the document from one target to another. Steps for Installing & Configuring the Angular ApplicationStep 1: Cre
    4 min read
  • AngularJS $locationProvider
    The $locationProvider facilitates the configuration of the application by implementing the deep linking paths that are stored. Here are some of the things that can be made with the $locationProvider service: Set the html5Mode property to true to enable HTML5 mode, which uses the history.pushState AP
    4 min read
  • AngularJS $location Service
    The $location in AngularJS basically uses a window.location service. The $location is used to read or change the URL in the browser and it is used to reflect that URL on our page. Any change made in the URL is stored in the $location service in AngularJS. There are various methods in the $location s
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences