This is a personal portfolio website built using Next.js, TypeScript, React Three Fiber, and Framer Motion to showcase professional projects, skills, and experience. The project is styled using TailwindCSS and managed with Yarn.
- Demo
- Features
- Technologies
- File Structure
- Environment Variables
- Installation
- Usage
- Deployment
- License
Check out the live demo of this portfolio project here.
- 3D Animations: Integrates React Three Fiber for interactive 3D experiences.
- Smooth Animations: Utilizes Framer Motion for seamless page transitions and animations.
- Responsive Design: Fully responsive and optimized for different screen sizes using TailwindCSS.
- TypeScript: Provides static typing for better development experience and safety.
- SEO Optimized: Built-in optimizations for search engine visibility.
- Fast Performance: Powered by Next.js for server-side rendering and optimized performance.
- DatoCMS: Headless CMS
This portfolio project is built with:
- Next.js: React framework for server-side rendering and static site generation.
- TypeScript: Superset of JavaScript that adds static typing.
- React Three Fiber: A React renderer for Three.js to create 3D visualizations.
- Framer Motion: A library for animations and page transitions.
- TailwindCSS: Utility-first CSS framework for responsive styling.
- Yarn: Dependency management for fast and reliable builds.
Hereβs an overview of the project's file structure:
portfolio/
βββ lib/ # Utility functions and libraries
βββ public/ # Static assets such as images, favicons, etc.
βββ scripts/ # Scripts for automation and setup
βββ src/ # Source code (components, pages, etc.)
βββ .env # Environment variables file (not checked into source control)
βββ .gitignore # Git ignore file
βββ .graphqlrc.js # GraphQL configuration
βββ global.d.ts # Global TypeScript declarations
βββ next-env.d.ts # Next.js TypeScript environment
βββ next.config.js # Next.js configuration
βββ package.json # Project dependencies and scripts
βββ postcss-util-hover.js # Custom PostCSS hover utilities
βββ postcss.config.js # PostCSS configuration
βββ tsconfig.json # TypeScript configuration
βββ yarn.lock # Yarn lockfile for dependencies
The project uses environment variables to handle sensitive information like API keys and endpoints. These should be stored in a .env file at the root of the project. Ensure that this file is not checked into source control.
# GraphQL API Endpoint for DatoCMS
DATO_ENDPOINT=https://graphql.datocms.com/
# API Key for DatoCMS
DATO_API_KEY=your_dato_cms_api_key_hereIn the client.ts file, the environment variables are accessed as follows:
// client.ts
import { GraphQLClient } from 'graphql-request';
import { getSdkWithHooks } from '@lib/generated/sdk';
const nextGraphQlClient = new GraphQLClient(process.env.DATO_ENDPOINT || '', {
headers: {
Authorization: `Bearer ${process.env.DATO_API_KEY}`,
},
});
// Use this server side, it directly calls the Umbraco GraphQL endpoint
export const nextClient = getSdkWithHooks(nextGraphQlClient);Make sure you add your actual DATO_API_KEY and DATO_ENDPOINT in the .env file before running the project.
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/JustinLung/Portfolio.git
-
Navigate into the project directory:
cd Portfolio -
Install dependencies using Yarn:
yarn install
-
Set up environment variables:
Create a
.envfile at the root of the project and add your API keys and other sensitive values as shown in the Environment Variables section.
To start the project in development mode:
yarn devThis will start the development server, and you can access the portfolio at http://localhost:3000.
To build the project for production:
yarn buildTo serve the production build locally:
yarn startThis project can be deployed on platforms like Vercel or Netlify.
-
Install the Vercel CLI:
yarn global add vercel
-
Run the deployment command:
vercel
Follow the prompts to deploy the project.
This project is licensed under the MIT License. See the LICENSE file for more details.