TypeScript Portfolio Website
Aim: To create a Typescript portfolio website where an user can download my CV, access import links such as my Github/LinkedIn, access projects I have previously worked on, and be able to send me an email.
Goals:
- Learn more about Typescript
- Learn more about Tailwind CSS and how screensize influences styling
- Learn more about animation with Framer Motion [header with Intro Animation]
- Learn more about React email and Resend to have a working email form
- Learn more about hosting [using Vercel hosting]
Packages Used:
- React Icons (icons)
- Framer Motion (animations)
- React email (email components)
- Resend (email sending platform)
- React Hot Toast (react notifications)
- React Vertical Timeline (experience section)
What I've Learned:
- Framer Motion & Tailwind CSS: I had centered the header using left-1/2 however, that meant the header component started at the center mark, the item was not centered itself. Using -translate-x-1/2 I was center the component however, when I used Framer Motion, the X value was reset so needed to set the x value to "-50%" to ensure the item was centered and not off-centre. Additionally, using group so that I can animate an icon seperately when a button is hovered over.
- When working on the header and having the active section highlighted, I encountered an issue with the onClick event and scrolling inView conflicting with eachother; example being that when I selected About, since Projects were in view it was highlighting Projects instead of About. I created a useState for timeOfLastClick and setTimeOfLastClick so that I could create be more specific in my if statement that would determine which section would be active/highlighted.
- I was reusing a lot of the same code on multiple different compnents to set the active section so to reduce repition, and make my code more DRY, I decided to create a custom hook instead. I also did this for the dark/light mode, extracting the theme context provider into it's own file.
- Client & Server Components: I've learnt more about client and server components; Next.js uses server components by default however, for a lot of components, I needed to render the component on the client side, so need to add "use client" to certain components.
Set-Up:
- Add RESEND_API_KEY environment variable in .env.local (Resend)
- In the actions/send-email.ts file, change the "to" email to your own email
Get the App Running:
- Within the portfolio folder, type into the terminal:npm install
- Run the application npm run dev
Testing Using Cypress to improve my testing skills and ensure that the webpage functioning as intended.
Resources Referenced ByteGrad's video on creating a Fresh React Portfolio Website.