Skip to content

My personal website built with TypeScript, Next.js, and TailwindCSS

License

Notifications You must be signed in to change notification settings

nelsonlaidev/nelsonlai.dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,850 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Cover

nelsonlai.dev

Framework Language License

Welcome to my personal blog and portfolio website! This repository contains a modern Next.js application where I share my thoughts, projects, and insights.

Features

Core Technologies

  • Next.js 16 with App Router
  • TypeScript with strict configuration
  • Tailwind CSS for styling
  • MDX for content
  • Drizzle ORM
  • I18n for internationalization support

UI/UX

  • Radix UI for accessible UI components
  • Responsive design
  • Light/Dark mode
  • Image zoom in blog posts
  • Shiki for code syntax highlighting
  • Motion for animations
  • Table of contents for blog posts

Blog Features

  • Comment system
  • Like functionality
  • Post view counter
  • Blog post search
  • RSS feed
  • Sitemap

Performance & SEO

  • Lighthouse score of nearly 100
  • SEO optimized with meta tags and JSON-LD
  • Dynamic open graph images using next/og

Development Experience

  • Vitest for unit/integration testing
  • Playwright for E2E testing
  • ESLint configuration
  • Oxfmt code formatting
  • Lefthook
  • Conventional commit lint

Authentication & Data

  • Better Auth
  • Redis caching
  • Upstash for API rate limiting
  • t3-env for environment variables
  • Umami Analytics

Email Templates

Comment Notification

Comment notification template

Reply Notification

Reply notification template

Getting Started

Prerequisites

Project Structure

nelsonlai.dev/
├── public/           # Static assets (images, fonts, videos)
├── src/
│   ├── app/          # Next.js app router pages
│   ├── components/   # React components
│   ├── config/       # Configuration files
│   ├── content/      # MDX blog posts and content
│   ├── db/           # Database schema and migrations
│   ├── emails/       # Email templates
│   ├── hooks/        # Custom React hooks
│   ├── i18n/         # Internationalization
│   ├── lib/          # Utility libraries
│   ├── orpc/         # oRPC API routes
│   ├── styles/       # Global styles
│   └── utils/        # Utility functions
├── docker-compose.yml
└── package.json

Development

To run this project locally, you need to set up the development environment.

Setup

  1. Clone the repository:
git clone https://github.com/nelsonlaidev/nelsonlai.dev
  1. Navigate to the project directory:
cd nelsonlai.dev
  1. Install dependencies using pnpm:
pnpm install

Environment Setup

  1. Copy .env.example to .env.local and update the environment variables as needed.
cp .env.example .env.local
  1. Run required services using Docker:
docker compose up -d
  1. Run the database migrations:
pnpm db:migrate
  1. Seed the database:
pnpm db:seed
  1. Run the app:
pnpm dev          # Run the development server
# or
pnpm email:dev    # Run the email preview server separately

The services will be available at the following URLs:

Service URL
App localhost:3000
React Email localhost:3001
Database localhost:5432
Redis localhost:6379
Redis serverless localhost:8079

Available Scripts

pnpm dev              # Start development server
pnpm build            # Build for production
pnpm start            # Start production server
pnpm lint             # Run ESLint
pnpm typecheck        # Run TypeScript type checking
pnpm fmt              # Format code with Oxfmt
pnpm test:unit        # Run unit tests
pnpm test:e2e         # Run E2E tests
pnpm db:migrate       # Run database migrations
pnpm db:seed          # Seed the database
pnpm db:studio        # Open Drizzle Studio

Credits

This project has been made possible thanks to the wonderful open-source community. Special thanks to:

This project also uses/adapts the following open-source projects:

The following projects were referenced for inspiration:

Author

Donation

If you find this project helpful, consider supporting me by sponsoring the project.

License

This project is open source and available under the MIT License.


Made with ❤️ in Hong Kong

Sponsor this project

 

Contributors 6