Skip to content

Commit 0562599

Browse files
committed
clean
1 parent 83c0fe9 commit 0562599

File tree

2 files changed

+116
-162
lines changed

2 files changed

+116
-162
lines changed

DEVELOPMENT.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Development Progress & Notes
2+
3+
This document tracks the development progress, TODO items, and setup instructions for the blog.
4+
5+
## TODO
6+
7+
### Improvements
8+
9+
- [x] Syntax highlight https://bionicjulia.com/blog/setting-up-nextjs-markdown-blog-with-typescript
10+
- [x] Add sitemap using [next-sitemap](https://www.tanvi.dev/blog/2-how-to-add-a-sitemap-to-your-nextjs-app)
11+
- [ ] Optimize image loading https://macwright.com/2016/05/03/the-featherweight-website
12+
- [ ] Make thoughts page faster
13+
- [ ] improve SEO
14+
- [ ] https://nextjs.org/learn/seo/introduction-to-seo
15+
16+
### New features
17+
18+
- [x] indicator for which page user is on like https://macwright.com/
19+
- [x] I'm feeling lucky feature, that randomly selects a blog
20+
- [x] dark mode with Japanese color palette
21+
- [x] basic search (keyword, semantic, and hybrid search)
22+
- [x] embeddings with VoyageAI
23+
- [x] semantic search using pgvector
24+
- [x] Create a chat interface trained on blog posts (Claude API)
25+
- [ ] expanding text
26+
- [ ] https://www.spencerchang.me/
27+
- [ ] https://www.rishi.cx/
28+
- [ ] Create pop up notes like https://www.rishi.cx/
29+
- [ ] A real-time digital clock with seconds
30+
- [ ] build a map of favorite restaurants and places like [build your corner](https://twitter.com/buildyourcorner)
31+
- [ ] Add listening and reading updates
32+
- [ ] https://dev.to/j471n/how-to-use-spotify-api-with-nextjs-50o5
33+
- [ ] https://github.com/yihui-hu/yihui-work
34+
- [ ] add hover over highlights for notes feature and expanding sidebar
35+
- [ ] https://linusrogge.com/about
36+
- [ ] hover to preview like https://stephango.com/buy-wisely
37+
- [ ] breadcrumb navigation
38+
- [ ] https://jake.isnt.online/
39+
- [ ] Setup contentlayer
40+
- [ ] https://youtu.be/nkGjob3q2GI?si=C-LTuMQNGydbxvPy&t=2847
41+
42+
## Inspirations
43+
44+
- [cnnmon/tiffanywang](https://github.com/cnnmon/tiffanywang)
45+
- [quinnha/portfolio](https://github.com/quinnha/portfolio)
46+
- [yihui-hu/yihui-work](https://github.com/yihui-hu/yihui-work)
47+
- [Linus Rogge](https://linusrogge.com/)
48+
49+
## Database Setup Instructions
50+
51+
### Setting up Planetscale for /thoughts page
52+
53+
```bash
54+
brew install planetscale/tap/pscale
55+
brew install mysql-client
56+
```
57+
58+
```bash
59+
pscale shell <DB_NAME> main
60+
```
61+
62+
Run this to create table:
63+
64+
```sql
65+
CREATE TABLE tweets (
66+
id INT AUTO_INCREMENT PRIMARY KEY,
67+
content TEXT NOT NULL,
68+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
69+
);
70+
```
71+
72+
### Setting up Neon for embedding search
73+
74+
Create pgvector extension:
75+
76+
```sql
77+
CREATE EXTENSION IF NOT EXISTS vector;
78+
```
79+
80+
Create the content_chunks table:
81+
82+
```sql
83+
CREATE TABLE content_chunks (
84+
id UUID PRIMARY KEY,
85+
post_slug TEXT NOT NULL,
86+
post_title TEXT NOT NULL,
87+
content TEXT NOT NULL,
88+
chunk_type TEXT NOT NULL,
89+
metadata JSONB NOT NULL,
90+
sequence INTEGER NOT NULL,
91+
embedding vector(1024),
92+
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
93+
);
94+
95+
-- Create a vector index for faster similarity search
96+
CREATE INDEX ON content_chunks
97+
USING ivfflat (embedding vector_cosine_ops)
98+
WITH (lists = 100);
99+
100+
-- Create additional indexes for faster filtering
101+
CREATE INDEX idx_content_chunks_post_slug ON content_chunks(post_slug);
102+
CREATE INDEX idx_content_chunks_chunk_type ON content_chunks(chunk_type);
103+
```
104+
105+
Run generate embeddings:
106+
107+
```bash
108+
npm run generate-embeddings
109+
```
110+
111+
### References
112+
113+
- [pgvector: Embeddings and vector similarity | Supabase Docs](https://supabase.com/docs/guides/database/extensions/pgvector?database-method=dashboard)
114+
- [supabase-community/nextjs-openai-doc-search](https://github.com/supabase-community/nextjs-openai-doc-search)
115+
- [transformers.js/examples/next-server](https://github.com/xenova/transformers.js/blob/main/examples/next-server/next.config.js)

README.md

Lines changed: 1 addition & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1 @@
1-
# Personal Blog
2-
3-
![home](public/images/home.jpeg)
4-
5-
test
6-
7-
A minimalistic blog built with Next.js, React, and TypeScript. It uses Markdown for content and features search functionality powered by vector embeddings.
8-
9-
Design inspired by [James Quiambao](https://www.jquiambao.com/) and [Lee Robinson](https://github.com/leerob/leerob.io).
10-
11-
## Features
12-
13-
- Markdown-based blog posts with frontmatter
14-
- Dark/light mode support
15-
- Three types of search:
16-
- Keyword search (traditional text search)
17-
- Semantic search (using vector embeddings)
18-
- Hybrid search (combination of both)
19-
- RSS feed generation
20-
- Responsive design
21-
- Automated embedding generation via GitHub Actions
22-
23-
## Development
24-
25-
To run the development server:
26-
27-
```bash
28-
npm run dev
29-
```
30-
31-
To build for production:
32-
33-
```bash
34-
npm run build
35-
```
36-
37-
## Embedding Generation
38-
39-
Post content is processed into semantic embeddings using VoyageAI's embedding model. New embeddings are generated automatically via GitHub Actions when posts are added or updated.
40-
41-
To manually generate embeddings for a specific post:
42-
43-
```bash
44-
npm run generate-embeddings [post-slug]
45-
```
46-
47-
To generate embeddings for all posts:
48-
49-
```bash
50-
npm run generate-embeddings
51-
```
52-
53-
## TODO
54-
55-
Improvements
56-
57-
- [x] Syntax highlight https://bionicjulia.com/blog/setting-up-nextjs-markdown-blog-with-typescript
58-
- [x] Add sitemap using [next-sitemap](https://www.tanvi.dev/blog/2-how-to-add-a-sitemap-to-your-nextjs-app)
59-
- [ ] Optimize image loading https://macwright.com/2016/05/03/the-featherweight-website
60-
- [ ] Make thoughts page faster
61-
- [ ] improve SEO
62-
- [ ] https://nextjs.org/learn/seo/introduction-to-seo
63-
64-
New features
65-
66-
- [x] indicator for which page user is on like https://macwright.com/
67-
- [x] I'm feeling lucky feature, that randomly selects a blog
68-
- [ ] expanding text
69-
- [ ] https://www.spencerchang.me/
70-
- [ ] https://www.rishi.cx/
71-
- [ ] Create pop up notes like https://www.rishi.cx/
72-
- [ ] A real-time digital clock with seconds
73-
- [ ] dark mode
74-
- [ ] [Dark Mode in Next JS 13 App Directory with TailwindCSS (for beginners) - YouTube](https://www.youtube.com/watch?v=optD7ns4ISQ)
75-
- [ ] basic search
76-
- [jackyzha0/quartz](https://github.com/jackyzha0/quartz/blob/v4/quartz/components/scripts/search.inline.ts)
77-
- [ ] embeddings
78-
- [ ] semantic search
79-
- [ ] https://focusreactive.com/ai-search-implementation/
80-
- [ ] https://supabase.com/blog/openai-embeddings-postgres-vector
81-
- [ ] Create a chat interface trained on my blog posts, have database for embeddings that allow daily insert on upload
82-
- [ ] refer to https://github.com/Swizec/swizbot-ui
83-
- [ ] build a map of favorite restaurants and places like [build your corner](https://twitter.com/buildyourcorner)
84-
- [ ] Add listening and reading updates
85-
- [ ] https://dev.to/j471n/how-to-use-spotify-api-with-nextjs-50o5
86-
- [ ] https://github.com/yihui-hu/yihui-work
87-
- [ ] add hover over highlights for notes feature and expanding sidebar
88-
- [ ] https://linusrogge.com/about
89-
- [ ] hover to preview like https://stephango.com/buy-wisely
90-
- [ ] breadcrumb navigation
91-
- [ ] https://jake.isnt.online/
92-
- [ ] Setup contentlayer
93-
- [ ] https://youtu.be/nkGjob3q2GI?si=C-LTuMQNGydbxvPy&t=2847
94-
95-
## Inspirations
96-
97-
- [cnnmon/tiffanywang](https://github.com/cnnmon/tiffanywang)
98-
- [quinnha/portfolio](https://github.com/quinnha/portfolio)
99-
- [yihui-hu/yihui-work](https://github.com/yihui-hu/yihui-work)
100-
- [Linus Rogge](https://linusrogge.com/)
101-
102-
## Setting up Planetscale for /thoughts page
103-
104-
```bash
105-
brew install planetscale/tap/pscale
106-
brew install mysql-client
107-
```
108-
109-
```bash
110-
pscale shell <DB_NAME> main
111-
```
112-
113-
Run this to create table
114-
115-
```sql
116-
CREATE TABLE tweets (
117-
id INT AUTO_INCREMENT PRIMARY KEY,
118-
content TEXT NOT NULL,
119-
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
120-
);
121-
```
122-
123-
## Setting up Neon for embedding search
124-
125-
Create pgvector extension
126-
127-
```sql
128-
CREATE EXTENSION IF NOT EXISTS vector;
129-
```
130-
131-
```sql
132-
CREATE TABLE content_chunks (
133-
id UUID PRIMARY KEY,
134-
post_slug TEXT NOT NULL,
135-
post_title TEXT NOT NULL,
136-
content TEXT NOT NULL,
137-
chunk_type TEXT NOT NULL,
138-
metadata JSONB NOT NULL,
139-
sequence INTEGER NOT NULL,
140-
embedding vector(1024),
141-
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
142-
);
143-
144-
-- Create a vector index for faster similarity search
145-
CREATE INDEX ON content_chunks
146-
USING ivfflat (embedding vector_cosine_ops)
147-
WITH (lists = 100);
148-
149-
-- Create additional indexes for faster filtering
150-
CREATE INDEX idx_content_chunks_post_slug ON content_chunks(post_slug);
151-
CREATE INDEX idx_content_chunks_chunk_type ON content_chunks(chunk_type);
152-
```
153-
154-
Run generate embeddings
155-
156-
```bash
157-
npm run generate-embeddings
158-
```
159-
160-
- [pgvector: Embeddings and vector similarity | Supabase Docs](https://supabase.com/docs/guides/database/extensions/pgvector?database-method=dashboard)
161-
- [supabase-community/nextjs-openai-doc-search: Template for building your own custom ChatGPT style doc search powered by Next.js, OpenAI, and Supabase.](https://github.com/supabase-community/nextjs-openai-doc-search)
162-
- [transformers.js/examples/next-server/next.config.js at main · xenova/transformers.js](https://github.com/xenova/transformers.js/blob/main/examples/next-server/next.config.js)
1+
my digital commonplace book / blog / public journal

0 commit comments

Comments
 (0)