A modern personal blog built with Next.js, TypeScript, and Tailwind CSS.
- 🚀 Next.js 16 - Modern React framework with App Router
- 📝 TypeScript - Type-safe code
- 🎨 Tailwind CSS - Beautiful, responsive designs
- 📱 Responsive - Works on all devices
- 🔐 Admin Dashboard - Full-featured admin panel for managing posts and users
- 👥 User Management - Create and manage admin users
- ✏️ Rich Text Editor - TipTap-powered editor for creating beautiful posts
- 💬 Comments System - Allow readers to comment on blog posts
- 📧 Email Service - Integrated Resend for subscriptions and notifications
- 🔒 Authentication - Secure NextAuth.js integration
- 🗄️ PostgreSQL Database - Robust data management
- Node.js 20+ installed
- npm or yarn package manager
- PostgreSQL database
- Clone the repository:
git clone https://github.com/Chijex5/Blog.git
cd Blog- Install dependencies:
npm install- Set up your environment variables:
Create a
.env.localfile in the root directory with the following:
# Database
DATABASE_USER=your_database_user
DATABASE_PASSWORD=your_database_password
DATABASE_HOST=your_database_host
DATABASE_PORT=5432
DATABASE_NAME=your_database_name
# NextAuth
NEXTAUTH_SECRET=your_nextauth_secret
NEXTAUTH_URL=http://localhost:3000
# Email Service (Resend)
RESEND_API_KEY=your_resend_api_key
FROM_EMAIL=onboarding@resend.dev
NEXT_PUBLIC_SITE_URL=http://localhost:3000- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
npm run dev- Start the development servernpm run build- Build the application for productionnpm run start- Start the production servernpm run lint- Run ESLint to check code qualitynpm run db:seed-admin- Create a new admin user (requires database setup)npm run db:migrate-slug- Add slug column and generate slugs for existing postsnpm run db:migrate-comments- Add comments table for the comments featurenpm run db:migrate-letters- Create letters table for Letters featurenpm run db:optimize- Optimize database with performance indexes
The blog includes a full-featured admin dashboard for managing posts and users. See ADMIN_DASHBOARD.md for detailed documentation.
- Set up your PostgreSQL database (see AUTHENTICATION_SETUP.md)
- Create your first admin user:
npm run db:seed-admin
- Log in at http://localhost:3000/admin/login
- Access the dashboard at http://localhost:3000/admin/dashboard
- View all posts - See all blog posts in one place
- Create/Edit posts - Rich text editor for beautiful content
- Delete posts - Remove posts you created
- Filter & Search - Find posts quickly
- Add admins - Create new admin users
- Secure - Role-based access control
The blog includes a complete email service powered by Resend. See EMAIL_SERVICE.md for detailed documentation.
- Subscription Management - Users can subscribe to receive post notifications
- New Post Alerts - Automatic emails to subscribers when you publish
- Admin Onboarding - Welcome emails with credentials for new admins
- Easy Unsubscribe - One-click unsubscribe with confirmation
- Sign up at Resend and get your API key
- Add environment variables to
.env.local:RESEND_API_KEY=your_api_key_here FROM_EMAIL=onboarding@resend.dev NEXT_PUBLIC_SITE_URL=http://localhost:3000
- The subscription form is already integrated in the footer!
The blog includes a complete comments system for reader engagement. See COMMENTS_FEATURE.md for detailed documentation.
- Reader Comments - Allow readers to comment on blog posts
- Form Validation - Client and server-side validation
- Email Privacy - Email addresses are stored but never displayed
- Moderation Ready - Soft delete support for moderation
- Responsive Design - Works beautifully on all devices
- Run the comments migration:
npm run db:migrate-comments
- Comments section appears automatically on all blog posts!
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── about/ # Public about page
│ │ ├── admin/ # Admin dashboard pages
│ │ ├── api/ # API routes
│ │ ├── post/ # Blog post routes (post/[slug])
│ │ ├── unsubscribe/ # Unsubscribe routes
│ │ ├── layout.tsx # Root layout
│ │ └── globals.css # Global styles
│ ├── components/ # React components
│ │ ├── ui/ # UI components
│ │ ├── Header.tsx # Navigation header
│ │ ├── Footer.tsx # Page footer
│ │ └── ... # Other components
│ └── lib/ # Utility functions and configs
├── scripts/ # Database and utility scripts
├── public/ # Static assets
└── ... # Config files
Blog posts are accessible via SEO-friendly slug URLs:
- Format:
/post/[slug](e.g.,/post/getting-started-with-nextjs) - Slugs are automatically generated from post titles
- Each slug is unique and indexed in the database for fast lookups
Use the admin dashboard to create and manage blog posts:
- Log in to the admin dashboard at
/admin/login - Navigate to
/admin/dashboard - Click "Create New Post"
- Use the rich text editor to write your content
- Add tags, categories, and other metadata
- Publish your post
Posts are stored in the PostgreSQL database and can be managed entirely through the admin interface.
- Site Title: Update in
src/app/layout.tsxmetadata - Header/Footer: Modify
src/components/Header.tsxandsrc/components/Footer.tsx - Colors: Customize in
src/app/globals.cssand Tailwind classes - About Page: Edit content through the admin dashboard or directly in the route files
The easiest way to deploy is using Vercel:
You can also deploy to:
- Netlify
- AWS Amplify
- Cloudflare Pages
- Any platform that supports Next.js
- Next.js 16 - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- NextAuth.js - Authentication
- PostgreSQL - Database
- TipTap - Rich text editor
- Resend - Email service
- @tailwindcss/typography - Typography styles
- Framer Motion - Animations
This is a personal blog project. Feel free to use it as inspiration for your own blog!
Chijioke Uzodinma - uzodinma.tech
Built with ❤️ using Next.js, TypeScript, and Tailwind CSS Design inspired by Memoir