| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
A modern, high-performance full-stack blog built with Next.js, featuring 50+ in-depth articles with Mermaid diagrams, an AI-powered RAG chatbot, Supabase-backed view tracking, MDX content, PWA support, and a rich ecosystem of libraries including Pinecone, Google Gemini, Framer Motion, KaTeX, and more.
This repository hosts a Next.js-based blog that uses MDX to write rich, interactive content. The app combines server-side rendering, static site generation, and client-side rendering to deliver fast and SEO-friendly pages. It also includes modern features such as PWA support, image optimization, and seamless animations using Framer Motion.
The blog currently features 50 comprehensive articles covering a wide range of topics in computer science and software engineering -- from agentic AI and LLM observability to distributed systems, database design, and frontend frameworks. Every article includes Mermaid diagrams (600+ charts across the library), code examples, and proper heading structure for table-of-contents navigation.
An AI-powered RAG chatbot allows readers to ask questions about any article. It uses Pinecone as a vector database and Google Gemini for embeddings and answer generation, with bracket-style citations linking back to source articles.
View counts are tracked per article via a Supabase-backed system, with session-deduplicated tracking and server-rendered counts displayed on article cards and detail pages.
graph TD
subgraph Browser
UI[React UI] --> CARDS[Article Cards]
UI --> CHAT[RAG Chatbot]
UI --> FAV[Favorites]
end
subgraph Next.js App
SSG[SSG / ISR Pages] --> MDX[MDX Content - 50 articles]
API_CHAT[api/chat] --> RAG[RAG Pipeline]
API_VIEW[api/track-view] --> SUPA_RPC[Supabase RPC]
end
subgraph External Services
PINE[(Pinecone Vector DB)]
GEMINI[Google Gemini]
SUPA[(Supabase - Auth + Views + Favorites)]
end
CHAT --> API_CHAT
RAG --> PINE
RAG --> GEMINI
CARDS --> SUPA
FAV --> SUPA
API_VIEW --> SUPA
To add more content, simply create new MDX files in the content directory and follow the existing structure. The blog is designed to be scalable, maintainable, and extensible, making it a great platform for sharing knowledge and insights within the tech community.
Feel free to contribute your own articles, improve the existing content, or customize the blog to suit your needs. Refer to the Contributing section for guidelines on how to contribute to this project.
Note
All articles are written in MDX and stored in the content directory. The Next.js app compiles these MDX files into static pages at build time, while also extracting metadata for features like the article list, related posts, and the RAG chatbot. Articles must have substantial content (not just a placeholder) and should include proper headings (h1, h2, h3) + Mermaid diagrams to be considered valid for the main article library.
The blog is deployed on Vercel and can be accessed at https://devverse-swe.vercel.app/.
Feel free to explore the content and features of the blog!
Note
The Supabase BaaS might be down sometimes due to inactivity. Please let me know in that case so that I can get it back up ASAP!
and many more pages...
DevVerse is packed with modern dev & user-centric features to enhance both the developer and user experience:
graph LR
AUTHOR[Author writes MDX] --> CONTENT[content/*.mdx]
CONTENT --> BUILD[Next.js Build]
BUILD --> SSG[Static HTML Pages]
SSG --> CDN[Vercel CDN]
CDN --> BROWSER[User Browser]
CONTENT --> VECTOR[Vectorize for RAG]
VECTOR --> PINE[(Pinecone)]
graph TD
ARTICLE[Current Article] --> T[Topic Overlap x3]
ARTICLE --> TI[Title Similarity x2]
ARTICLE --> D[Description Similarity x1]
ARTICLE --> C[Content Similarity x1]
ARTICLE --> R[Reading Time Proximity x0.5]
ARTICLE --> RE[Recency Bonus x0.3]
T --> SCORE[Combined Score]
TI --> SCORE
D --> SCORE
C --> SCORE
R --> SCORE
RE --> SCORE
SCORE --> RANK[Rank and return top 8]
graph LR
BOOT[Inline boot script in layout.tsx] --> CHECK[Read localStorage or prefers-color-scheme]
CHECK --> CLASS[Set html.dark class]
CLASS --> CSS[CSS variables switch via .dark selector]
CSS --> PROVIDER[DarkModeProvider hydrates React state]
PROVIDER --> TOGGLE[User toggles via navbar]
TOGGLE --> CLASS
DevVerse includes an AI-powered chatbot that lets readers ask questions about any article in the blog.
sequenceDiagram
participant User
participant ChatUI as Chat UI
participant API as /api/chat
participant Pine as Pinecone
participant Gemini as Google Gemini
User->>ChatUI: Ask question
ChatUI->>API: POST with query + history
API->>Gemini: Embed query to 768-dim vector
Gemini-->>API: Query embedding
API->>Pine: Similarity search top-K chunks
Pine-->>API: Relevant article chunks + metadata
API->>Gemini: Generate answer with context + citations
Gemini-->>API: Answer with bracket citations
API-->>ChatUI: Answer + sources array
ChatUI-->>User: Formatted answer with clickable citations
Vectorization: The scripts/vectorize_articles.mjs script reads all 50 MDX articles, chunks them, generates 768-dimensional embeddings via Google Gemini's embedding model, and upserts them into a Pinecone index (devverse-articles). Each vector includes enriched metadata: title, author, date, topics, reading time, and URL.
Retrieval: When a user asks a question, the /api/chat route embeds the query, performs a vector similarity search against the Pinecone index, and retrieves the most relevant article chunks.
Generation: The retrieved chunks, along with conversation history, are passed to Google Gemini's generative model, which produces an answer with bracket-style citations (e.g., [1], [2]).
Citations: The UI parses the citations and links them to the source articles, displayed as clickable references below each response.
Fallback: If vector search is unavailable (e.g., missing API keys), a local lexical fallback (lib/rag-local.ts) performs TF-IDF-style scoring against the raw MDX files.
# Requires PINECONE_API_KEY and GEMINI_API_KEY in .env or .env.local
npm run vectorize:articlesThis command reads all .mdx files in content/, chunks and embeds them, and upserts the vectors into Pinecone. Re-run this after adding or modifying articles.
PINECONE_API_KEY=your_pinecone_api_key
GEMINI_API_KEY=your_gemini_api_key
PINECONE_INDEX=devverse-articles # optional, defaults to "devverse-articles"All 50 articles include Mermaid diagrams (600+ charts total) to visualize architectures, workflows, data flows, and decision trees. Mermaid charts are rendered client-side using the mermaid npm package via a custom MermaidChart component (ui/MermaidChart.tsx).
graph LR
MDX[MDX Article] --> COMPILER[Next.js MDX Compiler]
COMPILER --> PRE[pre element with language-mermaid]
PRE --> INTERCEPT[mdx-components.tsx intercepts]
INTERCEPT --> MERMAID[MermaidChart Component]
MERMAID --> IMPORT[Dynamic import mermaid lib]
IMPORT --> INIT[Initialize with theme - light or dark]
INIT --> RENDER[mermaid.render produces SVG]
RENDER --> DOM[Inject SVG into DOM]
Mermaid diagrams are written as fenced code blocks with the mermaid language tag inside MDX files. The custom MDX components layer (mdx-components.tsx) detects the language and renders a MermaidChart component instead of a static code block.
Each article's view count is tracked via Supabase and displayed on both article cards and article detail pages.
graph TD
VISIT[User visits article] --> TRACKER[ArticleVisitTracker]
TRACKER --> DEDUP{Already tracked this session?}
DEDUP -->|Yes| SKIP[Skip]
DEDUP -->|No| POST[POST /api/track-view]
POST --> RPC[Supabase increment_view_count RPC]
RPC --> DB[(article_views table)]
subgraph Server-Side Rendering
PAGE[Article Page SSR] --> FETCH[Fetch view count from Supabase]
HOME[Home Page ISR] --> BATCH[Batch fetch all view counts]
FETCH --> META[ArticleMeta - reading time + views]
BATCH --> CARDS[InteractiveCard - views on each card]
end
devverse-cs-swe-blog/ โโโ app/ โ โโโ globals.css # Global CSS styles and dark mode variables โ โโโ page.tsx # Landing page (/) โ โโโ layout.tsx # Root layout with dark mode boot script โ โโโ not-found.tsx # 404 page component โ โโโ home/ โ โ โโโ page.tsx # Article index page (/home) โ โโโ chat/ โ โ โโโ page.tsx # RAG chatbot page (/chat) โ โ โโโ chat.module.css # Chat page styles โ โโโ favorites/ โ โ โโโ page.tsx # Favorites page (/favorites) โ โโโ api/ โ โ โโโ chat/ โ โ โ โโโ route.ts # RAG chat API (Pinecone + Gemini) โ โ โโโ track-view/ โ โ โ โโโ route.ts # View count increment endpoint โ โ โโโ rss/ โ โ โ โโโ route.ts # RSS feed endpoint โ โ โโโ atom/ โ โ โ โโโ route.ts # Atom feed endpoint โ โ โโโ reset-password/ โ โ โ โโโ route.ts # Password reset API route โ โ โโโ verify-email/ โ โ โโโ route.ts # Email verification API route โ โโโ auth/ โ โ โโโ login/ โ โ โ โโโ page.tsx # Login page โ โ โโโ register/ โ โ โ โโโ page.tsx # Register page โ โ โโโ reset/ โ โ โโโ page.tsx # Reset password page โ โโโ articles/[slug]/ โ โ โโโ page.tsx # Dynamic article pages โ โโโ feed.json/ โ โโโ route.ts # JSON feed endpoint โโโ components/ โ โโโ ArticleContent.tsx # Article content renderer with MDX โ โโโ ArticleMeta.tsx # Portal-based reading time + view count below article date โ โโโ ArticlesList.tsx # Article list with search, filtering, and pagination โ โโโ ArticleVisitTracker.tsx # Session-deduplicated view tracking component โ โโโ BackToTopButton.tsx # Scroll-to-top button โ โโโ ConditionalMain.tsx # Conditional main wrapper โ โโโ ConditionalNavbar.tsx # Conditional navbar (hidden on landing page) โ โโโ CustomProgressBar.tsx # Route transition progress bar โ โโโ FavButton.tsx # Favorite button on article detail pages โ โโโ FavoritesList.tsx # Favorites list with search and filtering โ โโโ FavStar.tsx # Star icon on article cards with portal tooltip โ โโโ Footer.tsx # Site footer โ โโโ HomePageContent.tsx # Home page hero, stats, and article grid โ โโโ InteractiveCard.tsx # Article card with accent stripe, icons, pills, views, star โ โโโ LandingPage.tsx # Landing page hero with gradient, stats, and CTAs โ โโโ Loading.tsx # Loading spinner โ โโโ MdxLayout.tsx # MDX layout wrapper โ โโโ Navbar.tsx # Navigation bar with tooltips โ โโโ RelatedPosts.tsx # 6-signal related articles with show more โ โโโ RouteProgress.tsx # NProgress route progress bar โ โโโ RSSButton.tsx # RSS feed button โ โโโ TableOfContents.tsx # Auto-generated TOC from h2/h3 headings โ โโโ Tooltip.tsx # Reusable portal-based tooltip component โ โโโ TopicsList.tsx # Redesigned topics section with colored pills โ โโโ TranslateMenu.tsx # Google Translate popup trigger โ โโโ TranslateMenuProvider.tsx # Context provider for translate menu state โ โโโ TriggerReload.tsx # Reload trigger utility โ โโโ UserMenu.tsx # User menu dropdown โ โโโ ViewCount.tsx # View count display component for cards โโโ ui/ โ โโโ CodeBlock.tsx # Syntax-highlighted code block โ โโโ InlineCode.tsx # Inline code component โ โโโ MermaidChart.tsx # Dark-mode-aware Mermaid diagram renderer โ โโโ PreBlock.tsx # Preformatted block (routes mermaid to MermaidChart) โ โโโ InteractiveCard.css # Card styles โโโ lib/ โ โโโ articles.ts # MDX module metadata loader (used by favorites) โ โโโ chat-citations.ts # Citation parsing/linking for chat UI โ โโโ jsonfeed.ts # JSON feed generator โ โโโ rag.ts # Pinecone + Gemini RAG pipeline โ โโโ rag-local.ts # Local lexical fallback for chat retrieval โ โโโ rss.ts # RSS/Atom feed generator and MDX parser โโโ supabase/ โ โโโ supabaseClient.ts # Supabase browser client configuration โ โโโ auth.ts # Authentication helper functions โ โโโ avatar.ts # Avatar upload/download functions โ โโโ favorites.ts # Favorites CRUD operations โ โโโ profile.ts # Profile management functions โ โโโ views.ts # View count queries (single, batch, all) โ โโโ article_views.sql # View count table, RPC function, and seed data โ โโโ articles.sql # Articles table schema โ โโโ favorites.sql # Favorites table schema โ โโโ profiles.sql # Profiles table schema โ โโโ devverse_full_schema.sql # Complete database schema reference โโโ scripts/ โ โโโ vectorize_articles.mjs # Pinecone vectorization pipeline โ โโโ generate_sitemap.js # Sitemap generator โ โโโ check_content_contract.py # MDX content contract validator โโโ utils/ โ โโโ getAllPosts.js # Function to fetch all MDX posts โโโ provider/ โ โโโ DarkModeProvider.tsx # Dark mode context with delayed render โโโ content/ # 50 MDX articles (canonical content source) โโโ public/ # Static files (images, fonts, PWA manifest, etc.) โโโ images/ # Screenshots for README โโโ tests/ # Jest test suite โโโ mocks/ # Jest mocks โโโ .devcontainer/ โ โโโ devcontainer.json # VS Code Dev Container configuration โโโ Dockerfile # Docker image configuration โโโ docker-compose.yml # Docker Compose for containerized development โโโ package.json # Project manifest with scripts and dependencies โโโ tsconfig.json # TypeScript configuration โโโ next.config.mjs # Next.js configuration with MDX, KaTeX, and GFM plugins โโโ next-sitemap.config.js # Sitemap generation configuration โโโ mdx-components.tsx # Custom MDX components (routes mermaid to MermaidChart) โโโ tailwind.config.js # Tailwind CSS configuration โโโ jest.config.js # Jest configuration โโโ babel.jest.js # Babel configuration for Jest โโโ (... and more)
Clone the Repository:
git clone https://github.com/hoangsonww/DevVerse-SWE-Blog.git
cd DevVerse-CS-SWE-BlogInstall Dependencies:
npm installSet Up Environment Variables:
Create a .env.local file in the root directory. See Environment Variables for the full list.
Run the Development Server:
npm run devOpen http://localhost:3000 in your browser to view the app.
Create a .env or .env.local file in the project root with the following variables:
# Supabase (required for auth, favorites, view counts)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# RAG Chat (required for AI chatbot)
PINECONE_API_KEY=your_pinecone_api_key
GEMINI_API_KEY=your_gemini_api_key
PINECONE_INDEX=devverse-articles
# Site URL (used by feeds and local RAG)
NEXT_PUBLIC_SITE_URL=https://devverse-swe.vercel.app
SITE_URL=https://devverse-swe.vercel.appNote
The app runs without the RAG environment variables -- the chatbot will gracefully fall back to local lexical search. Supabase variables are needed for auth, favorites, and view tracking.
A docker-compose.yml file is provided to facilitate containerized development.
Build and Start the Container:
docker-compose upAccess the App:
The application will be available at http://localhost:3000.
If you use Visual Studio Code, you can open the project in a Dev Container:
The blog uses Supabase for user authentication, file storage, database services, and article view tracking. To set up the backend services, follow these steps:
Create a Supabase Account:
Sign up for a free account on Supabase.
Create a New Project:
Create a new project in the Supabase dashboard.
Set Up Authentication:
Enable authentication in the project settings.
Create a .env (or .env.local) File:
Create a .env (or .env.local) file in the root directory of the project with the following environment variables:
NEXT_PUBLIC_SUPABASE_URL=YOUR_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY=YOUR_SUPABASE_SERVICE_ROLE_KEYReplace YOUR_SUPABASE_URL and YOUR_SUPABASE_ANON_KEY with your Supabase project URL and anonymous key, respectively. Also, replace YOUR_SUPABASE_SERVICE_ROLE_KEY with your Supabase service role key, obtained from the project settings.
Set Up Database:
Create the necessary tables in the Supabase dashboard by running the following SQL. You can also find individual migration files in the supabase/ directory.
-- Core tables
CREATE TABLE IF NOT EXISTS articles (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
title TEXT NOT NULL,
slug TEXT NOT NULL,
content TEXT NOT NULL,
author TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT now()
);
CREATE TABLE IF NOT EXISTS profiles (
id UUID PRIMARY KEY
REFERENCES auth.users(id) ON DELETE CASCADE,
avatar_url TEXT,
updated_at TIMESTAMPTZ DEFAULT now()
);
CREATE TABLE IF NOT EXISTS favorite_articles (
id SERIAL PRIMARY KEY,
user_id UUID
REFERENCES auth.users(id) ON DELETE CASCADE,
article_slug TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT now(),
UNIQUE (user_id, article_slug)
);
-- Article view counts (see supabase/article_views.sql for full migration with RPC + seed)
CREATE TABLE IF NOT EXISTS article_views (
slug TEXT PRIMARY KEY,
view_count BIGINT NOT NULL DEFAULT 0,
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);For the complete view count setup including the atomic increment RPC function and seed data for all 50 articles, run the full supabase/article_views.sql migration in the SQL editor. For a more complex and full-fledged schema, visit supabase/devverse_full_schema.sql.
Set Up Storage:
Enable storage in the project settings to store images and other files.
Set Up User Roles:
Create a new service role in the project settings with the following permissions:
This role will be used to access the articles, storage, and view count services from the blog.
Or, for development purposes, you can use the public role with the same permissions, or just allow all permissions for simplicity (not recommended for production).
Run the Application:
Start the development server using npm run dev and test the user authentication, article services, and view tracking.
The Next.js API routes are as follows:
/api/chat
/api/track-view
/api/reset-password
/api/verify-email
/api/rss
/api/atom
/feed.json
The password reset flow is: First, call /api/verify-email to verify the user's email address exists. Then, call /api/reset-password to reset the user's password associated with that email address.
All other routes are standard Supabase routes for user authentication and profile/favorites management.
FROM node:18-bullseye-slim
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- .:/app:cached
command: npm run dev
environment:
- NODE_ENV=development{
"name": "devverse-cs-swe-blog",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"editor.formatOnSave": true
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-vscode.vscode-typescript-next",
"eamodio.gitlens"
],
"postCreateCommand": "npm install",
"remoteUser": "node",
"forwardPorts": [3000]
}This project uses Jest for testing. The test suite covers API routes, content parsing, citation logic, and utility functions.
# Run all tests
npm run test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run coverageFor constrained environments (CI, low-memory), use:
env JEST_USE_WATCHMAN=0 npm test -- --runInBand --watchman=falseTest files are located in the tests/ directory:
The blog supports RSS, Atom, and JSON feeds for syndication. You can access the feeds at the following URLs:
These feeds are automatically generated based on the MDX content in the content directory. You can subscribe to the feeds using your favorite feed reader to stay updated with the latest articles.
This project includes a GitHub Actions CI pipeline to ensure code quality and consistency. The pipeline runs the following checks on every push and pull request:
You can view the CI pipeline in the Actions tab. Click on any workflow run to see the details of the checks performed (and the cool charts and graphs!).
Contributions are welcome! Please follow these guidelines when contributing:
Ensure that your code adheres to our coding standards and includes tests where applicable.
To add more MDX content, create a new .mdx file in the content directory. Each article should follow this structure:
export const metadata = {
title: "Your Article Title",
description: "A brief description of the article.",
topics: ["Topic1", "Topic2", "Topic3"],
};
# Your Article Title
### Author: Your Name
> Date: YYYY-MM-DD
Article content here...
## Section Heading
Content with Mermaid diagrams:
```mermaid
graph TD
A[Start] --> B[Process]
B --> C[End]After adding or modifying articles, consider re-running npm run vectorize:articles to update the Pinecone index for the RAG chatbot.
We welcome contributions that expand the content and cover a wide range of topics in computer science and software engineering! I hope this project can serve as a platform for sharing knowledge and insights within the tech community.
All new articles must have:
This project is licensed under the MIT License.
Reach out to me at @hoangsonww for any questions or feedback. I'd love to hear from you!
This project is powered by Next.js and serves as a testament to the framework's capabilities in building modern, scalable, and high-performance web applications. Happy coding!
| Back | FazBrowse Home | New Git URL |