|
1 | | -# Personal Blog |
2 | | - |
3 | | - |
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