A full-stack blog platform built with Next.js, Supabase, and Clerk authentication featuring a rich text editor and category management.
- Multi-author Support: Secure authentication and user management with Clerk
- Rich Text Editor: TipTap editor with comprehensive formatting options
- Bold, italic, underline, strikethrough
- Headings (H1, H2, H3)
- Lists (bullet and numbered)
- Code blocks with syntax highlighting
- Tables, links, and images
- Character count
- Category Management: Organize posts with categories
- Author Dashboard: Personal dashboard for content management
- RSS Feed: Auto-generated RSS feed for subscribers
- Dark Mode: Built-in dark mode support
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Type Safety: Full TypeScript support with Zod validation
- Framework: Next.js 15 (App Router)
- Runtime: Bun
- Database: Supabase (PostgreSQL)
- Authentication: Clerk
- Editor: TipTap with extensions
- Styling: Tailwind CSS v4 + shadcn/ui
- Validation: Zod
- Language: TypeScript
- Bun installed
- Supabase account
- Clerk account
git clone https://github.com/yourusername/feed.git
cd feed
bun install
Create a .env.local
file and add your credentials:
# Supabase
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
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
CLERK_WEBHOOK_SECRET=your_clerk_webhook_secret
- Create a new Supabase project
- Run the SQL schema in
supabase/schema.sql
in your Supabase SQL editor - Enable Row Level Security (RLS) policies (already included in schema)
- Create a Clerk application
- Configure the webhook endpoint:
https://your-domain.com/api/webhooks/clerk
- Set the webhook events:
user.created
,user.updated
,user.deleted
- Add your webhook secret to environment variables
bun dev
Open http://localhost:3000 to see the application.
- Sign in to your account
- Navigate to the dashboard (
/dashboard
) - Click "New Post"
- Use the rich text editor to write your content
- Select a category (or create one first)
- Choose to publish immediately or save as draft
- From the dashboard, click "Manage Categories"
- Create new categories with name and slug
- Edit or delete existing categories
- Categories are immediately available for posts
The TipTap editor supports:
- Text formatting (bold, italic, underline, strikethrough)
- Headings (H1, H2, H3)
- Lists (bullet and numbered)
- Code blocks with syntax highlighting (JavaScript, TypeScript, Python, etc.)
- Tables with customizable rows and columns
- Links and images
- Character count tracking
GET /api/posts
- List all published postsPOST /api/posts
- Create a new post (requires auth)GET /api/posts/:id
- Get a single postPUT /api/posts/:id
- Update a post (author only)DELETE /api/posts/:id
- Delete a post (author only)
GET /api/categories
- List all categoriesPOST /api/categories
- Create a category (requires auth)PUT /api/categories/:id
- Update a category (requires auth)DELETE /api/categories/:id
- Delete a category (requires auth)
GET /api/rss
- RSS feed of all published posts
The application uses the following main tables:
authors
- User profiles linked to Clerkcategories
- Post categoriesposts
- Blog posts with rich contenttags
- Post tags (optional)post_tags
- Many-to-many relationship
feed/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ │ ├── posts/ # Post CRUD endpoints
│ │ ├── categories/ # Category CRUD endpoints
│ │ ├── rss/ # RSS feed
│ │ └── webhooks/ # Clerk webhooks
│ ├── dashboard/ # Author dashboard
│ │ ├── posts/ # Post management
│ │ └── categories/ # Category management
│ ├── posts/ # Public post pages
│ └── categories/ # Categories listing
├── components/ # React components
│ ├── editor/ # TipTap editor components
│ ├── layout/ # Layout components
│ └── ui/ # shadcn/ui components
├── lib/ # Utilities and configurations
│ ├── schemas/ # Zod validation schemas
│ ├── supabase/ # Supabase clients
│ └── types/ # TypeScript types
└── supabase/ # Database configuration
└── schema.sql # Database schema
# Development
bun dev # Start development server
bun build # Build for production
bun start # Start production server
bun lint # Run ESLint
# Database
bun supabase:start # Start local Supabase
bun supabase:stop # Stop local Supabase
bun supabase:status # Check Supabase status
bun supabase:db:reset # Reset database
bun supabase:gen-types # Generate TypeScript types
- Push your code to GitHub
- Deploy to Vercel:
vercel
- Add environment variables in Vercel dashboard
- Configure Clerk webhook URL in production
- Update Supabase URL and keys for production
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is open source and available under the MIT License.