A Next.js application for viewing blog posts exported from Webflow with intelligent semantic linking between related content. Import CSV data, analyze relationships between posts, and export approved links.
- 🔗 Semantic Linking: AI-powered analysis finds related content
- 📊 CSV Import: Dedicated import page with preview and validation
- 💾 Local Database: SQLite storage with Prisma ORM
- 📱 Responsive Viewer: Clean interface with sidebar navigation
- ✅ Link Review: Approve/reject suggested links
- 📥 Export Links: Download approved links as CSV
- 🔄 Database Reset: Clean slate option in header menu
- ⌨️ Keyboard Navigation: Arrow keys for browsing
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Database: SQLite with Prisma ORM
- Styling: Tailwind CSS
- UI Components: Custom components with Lucide icons
- AI Integration: OpenAI for semantic analysis
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone https://github.com/Dot-Fun/semantic-linking-webflow-export.git
cd semantic-linking-webflow-export/blog-viewer- Install dependencies:
npm install- Set up the database:
npx prisma migrate dev- Configure environment variables:
# Create .env file with:
OPENAI_API_KEY=your_api_key_here- Run the development server:
npm run devOpen http://localhost:3000 to view the application.
blog-viewer/
├── src/
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── components/ # React components
│ │ └── page.tsx # Main page
│ └── lib/
│ ├── db.ts # Prisma client
│ └── utils.ts # Utility functions
├── prisma/
│ └── schema.prisma # Database schema
├── scripts/
│ └── import-csv.ts # CSV import script
└── database/
└── blog.db # SQLite database (generated)
- Click Import Data in the header
- Configure the base URL for your blog posts
- Choose import mode: Replace (clear existing) or Append
- Upload your CSV file with drag-and-drop
- Preview the data before importing
- Click Import to process the file
Once posts are imported, the system automatically analyzes content to find semantic relationships between posts.
- View suggested links in the main interface
- Click Approve or Reject for each suggestion
- Use Approve All High Confidence for bulk approval
- Export approved links via Export CSV button
GET /api/blogs/count- Get total post countGET /api/blogs/[index]- Get post by index (0-based)GET /api/blogs/post/[id]- Get post by IDGET /api/blogs/list- Get all posts (minimal data)POST /api/import/csv- Import CSV filePOST /api/import/csv/preview- Preview CSV before importGET /api/analysis/status- Check analysis statusPOST /api/analysis/start- Start semantic analysisGET /api/links/[id]- Get links for a postPATCH /api/links/[id]- Update link statusPOST /api/database/reset- Reset database
# Run development server
npm run dev
# Type checking
npm run type-check
# Linting
npm run lint
# Format code
npm run formatMIT