Building a portfolio site with TypeScript, Next.js, and Tailwind CSS
Tags: nextjs, typescript, tailwindcss, portfolio
Published: 2023-03-29 20:32:52


![Site Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aecl4dm4ywlcm7avf3w6.jpg)

Portfolio sites are an expression of self, a way to represent yourself to the world as a developer. It is important to not only build a site that represents your technical abilities, but also your aesthetic ones as well. Here I'll take you through a light guide of how I got started with my portfolio site and some ideas to think about along the way. 

Before we dive in, feel free to clone [this template](https://github.com/njlawz/dev-site) on GitHub and use it as a template for your own site!

The first thing I recommend you do is get some inspiration. Now, maybe my site is inspiration enough, or maybe you want to go through some portfolio sites to get an idea of what is out there. Here are two portfolios that I drew inspiration from:

- [asrvd.me](https://asrvd.me/)

- [nexxel.dev](https://www.nexxel.dev/)

Once you have sufficient design inspiration, it's time to get your project started. 

I used [create-t3-app](https://create.t3.gg/) to bootstrap the project as that is my preference, but feel free to use [create-next-app](https://nextjs.org/docs/api-reference/create-next-app).

## With create-t3-app:


```
pnpm create t3-app@latest
```

1. Name your project

2. Select TypeScript

3. Select Tailwind

4. Select Y for Git repository

5. Select Y to run pnpm install

6. Hit Enter for default import alias


![create-t3-app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43z3h7lltn27a78i67f8.png)

Now that you have a bootstrapped project, you can start building out your portfolio! I'll walk you through some of the major components that my portfolio consists of.

## Layout

### Desktop View 


![Desktop View](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dr2gv1jhsfu2at6rp3z3.png)

### Mobile View


![Mobile View](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pizu80tllbm36gc8sg02.png)


I have a Layout.tsx component that takes in a MobileNavBar and a NavBar for the mobile and desktop views respectively. I use tailwind for media queries to display the layout in either view. This solution not only works, but is super simple and clean!

## Home Page

I like a clean design with lots of empty space. I once heard that the essence of design is to leave things out, so that is what I attempted to do, while still adding my own flair. I use axios to get my pinned repositories from GitHub and my recent blog posts from here, but using regular fetch/await would have probably been suitable as well.

## About and Current Pages

For these pages, I use markdown as they are more content heavy. I am making use of [showdown](https://www.npmjs.com/package/showdown), an npm package that will convert markdown to html for us. This means I can write my bio in markdown and use the file system and showdown to fetch the markdown file and convert it to html. Tailwind's prose class helped with the styling.


![About page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dgwu86o763w276g6qkr8.png)

## ChatBot

And probably the coolest part of the site, it comes with an integrated ChatGPT chatbot based off of ChatGPT-3.5. I will cover this component in a separate article as it is beyond the scope of this post, but feel free to interact and ask it questions!


![ChatBot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8q47ar3pl7y5zitpzhv.png)

Let me know what you think in the comments down below!