GitPedia

Nelsonlai.dev

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

From nelsonlaidev·Updated June 17, 2026·View on GitHub·

Welcome to my personal blog and portfolio website! This repository contains a modern Next.js application where I share my thoughts, projects, and insights. The project is written primarily in TypeScript, distributed under the MIT License license, first published in 2022. Key topics include: blog, drizzle-orm, i18n, mdx, monorepo.

<div align="center"> <a href="https://nelsonlai.dev"> <picture> <source media="(prefers-color-scheme: dark)" srcset="public/images/dark-header.png"> <img alt="Project Cover" src="public/images/light-header.png"> </picture> </a> <h1 align="center"> nelsonlai.dev </h1> <img src="https://img.shields.io/badge/Next.js-000000.svg?style=for-the-badge&logo=Next.js&labelColor=000" alt="Framework" /> <img src="https://img.shields.io/github/languages/top/nelsonlaidev/nelsonlai.dev?style=for-the-badge&labelColor=000" alt="Language" /> <img src="https://img.shields.io/github/license/nelsonlaidev/nelsonlai.dev?style=for-the-badge&labelColor=000" alt="License" /> </div>

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

  • Base 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 testing
  • Playwright for E2E testing
  • ESLint configuration
  • Prettier code formatting
  • Lefthook
  • Conventional commit

Authentication & Data

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

Email Templates

Comment Notification

<div align="center"> <img alt="Comment notification template" src="public/images/comment-notification-email.png"> </div>

Reply Notification

<div align="center"> <img alt="Reply notification template" src="public/images/reply-notification-email.png"> </div>

Getting Started

Prerequisites

Project Structure

nelsonlai.dev/
├── public/           # Static assets (images, fonts, videos)
├── src/
│   ├── app/          # Next.js app router pages
│   ├── components/   # React components
│   ├── constants/    # Application constants
│   ├── content/      # MDX blog posts and content
│   ├── contexts/     # React contexts
│   ├── db/           # Database schema and migrations
│   ├── emails/       # Email templates
│   ├── hooks/        # Custom React hooks
│   ├── i18n/         # Internationalization
│   ├── lib/          # Utility libraries
│   ├── mdx-plugins/  # Custom Rehype and Remark plugins
│   ├── orpc/         # oRPC API routes
│   ├── styles/       # Global styles
│   ├── tests/        # Unit and E2E tests
│   └── 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:
bash
git clone https://github.com/nelsonlaidev/nelsonlai.dev
  1. Navigate to the project directory:
bash
cd nelsonlai.dev
  1. Install dependencies using bun:
bash
bun install

Environment Setup

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

The services will be available at the following URLs:

ServiceURL
Applocalhost:3000
React Emaillocalhost:3001
Cosmoslocalhost:3002
Databaselocalhost:5432
Redislocalhost:6379
Redis serverlesslocalhost:8079

Available Scripts

bash
# Development bun dev # Start development server bun email:dev # Run email preview server bun cosmos # Start Cosmos component playground # Build & Production bun run build # Build for production (includes cosmos:export) bun start # Start production server bun analyze # Analyze bundle size # Quality & Testing bun check # Run all quality checks (lint, typecheck, format, etc.) bun lint # Run ESLint bun typecheck # Run TypeScript type checking bun format # Format code with Prettier bun knip # Find unused dependencies/exports bun test:unit # Run unit tests bun test:e2e # Run Playwright E2E tests # Database bun db:migrate # Run database migrations bun db:seed # Seed the database bun db:push # Push schema changes directly to DB bun db:reset # Reset database bun 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.


<p align="center"> Made with ❤️ in Hong Kong </p>

Contributors

Showing top 6 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from nelsonlaidev/nelsonlai.dev via the GitHub API.Last fetched: 6/19/2026