/blog

writing = thinking

Primary LanguageTypeScript

Blog

home

A minimalistic blog made with Next.js and Tailwind CSS.

Design inspired by James Quiambao and Lee Robinson

Tutorial on how to build this blog can be found here.

OpenAI code taken from magic-text

TODO

Improvements

New features

Inspirations

Setting up Planetscale for /thoughts page

brew install planetscale/tap/pscale
brew install mysql-client
pscale shell <DB_NAME> main

Run this to create table

CREATE TABLE tweets (
  id INT AUTO_INCREMENT PRIMARY KEY,
  content TEXT NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Setting up Neon for embedding search

Create pgvector extension

CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE content_chunks (
    id UUID PRIMARY KEY,
    post_slug TEXT NOT NULL,
    post_title TEXT NOT NULL,
    content TEXT NOT NULL,
    chunk_type TEXT NOT NULL,
    metadata JSONB NOT NULL,
    sequence INTEGER NOT NULL,
    embedding vector(1024),
    created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

-- Create a vector index for faster similarity search
CREATE INDEX ON content_chunks
USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);

-- Create additional indexes for faster filtering
CREATE INDEX idx_content_chunks_post_slug ON content_chunks(post_slug);
CREATE INDEX idx_content_chunks_chunk_type ON content_chunks(chunk_type);

Run generate embeddings

npm run generate-embeddings