A production-ready blog platform built with Next.js 15, Prisma, PostgreSQL, and Tailwind CSS. Features include user authentication, commenting system, like/dislike functionality, admin dashboard, and SEO optimization.
- β Full-featured blog with categories and tags
- β Rich text content with code syntax highlighting
- β Featured images and post excerpts
- β Related posts recommendations
- β View counter and engagement metrics
- β User authentication (signup/login)
- β Like/dislike blog posts
- β Comment on blog posts
- β User profile with avatar
- β Role-based access control
- β Secure admin authentication with NextAuth
- β Manage blog posts (create, edit, delete)
- β Manage categories and tags
- β User management
- β Analytics dashboard
- β Dynamic sitemap.xml generation
- β Robots.txt configuration
- β JSON-LD structured data
- β Open Graph and Twitter Card meta tags
- β Mobile-responsive design
- β Server-side rendering (SSR)
- β Optimized for Google Search Console
- β Modern, clean UI with Tailwind CSS v4
- β Dark/Light theme toggle
- β Gradient accents and smooth animations
- β Professional navbar with user dropdown
- β Responsive footer with internal links
- β Mobile-first responsive design
- Framework: Next.js 15.5.6 (App Router)
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js + Custom Auth
- Styling: Tailwind CSS v4
- Icons: Lucide React
- Password Hashing: bcryptjs
- Deployment: Vercel
- Node.js 18+ installed
- PostgreSQL database (local or cloud)
- npm or yarn package manager
git clone https://github.com/YOUR-USERNAME/nextcodehub.git
cd nextcodehubnpm installCreate a .env file in the root directory:
# Database
DATABASE_URL="postgresql://postgres:password@localhost:5432/nextcodehub?schema=public"
# NextAuth
NEXTAUTH_SECRET="your-secret-key-here"
NEXTAUTH_URL="http://localhost:3000"
# Site URL
NEXT_PUBLIC_SITE_URL="http://localhost:3000"Generate NEXTAUTH_SECRET:
openssl rand -base64 32# Generate Prisma Client
npx prisma generate
# Push database schema
npx prisma db push
# Seed database with sample data
npx prisma db seednpm run devOpen http://localhost:3000 to see your application.
nextcodehub/
βββ prisma/
β βββ schema.prisma # Database schema
β βββ seed.js # Database seed file
βββ public/ # Static assets
βββ src/
β βββ app/
β β βββ layout.js # Root layout with metadata
β β βββ page.js # Home page
β β βββ blog/ # Blog pages
β β βββ about/ # About page
β β βββ contact/ # Contact page
β β βββ tools/ # Tools page
β β βββ admin/ # Admin dashboard
β β βββ api/ # API routes
β β βββ sitemap.js # Dynamic sitemap
β β βββ robots.js # Robots.txt
β βββ components/
β β βββ viewer/ # Public-facing components
β β βββ admin/ # Admin components
β β βββ ui/ # Reusable UI components
β βββ lib/
β β βββ prisma.js # Prisma client singleton
β β βββ auth.js # NextAuth configuration
β β βββ useful.js # Utility functions
β βββ styles/
β βββ globals.css # Global styles
βββ .env.example # Example environment variables
βββ vercel.json # Vercel configuration
βββ DEPLOYMENT.md # Deployment guide
βββ package.json
Default admin credentials (change after first login):
- URL:
/admin/login - Email:
admin@nextcodehub.com - Password:
admin123(stored with bcrypt hash)
/- Home page with latest posts/blog- All blog posts with filters/blog/[slug]- Individual blog post/about- About page/contact- Contact page with form/tools- Developer tools (coming soon)/privacy-policy- Privacy policy/terms-of-service- Terms of service/disclaimer- Disclaimer/admin- Admin dashboard (requires authentication)
Edit src/styles/globals.css to customize theme colors:
--blog-primary: 59 130 246; /* Blue */
--blog-secondary: 147 51 234; /* Purple */Replace logo in src/components/viewer/navbar.js and footer.js
Main models:
- User: User accounts with roles (USER/ADMIN)
- Post: Blog posts with content, metadata
- Category: Post categories (many-to-many with Post)
- Tag: Post tags (many-to-many with Post)
- Comment: User comments on posts
Detailed deployment instructions are available in DEPLOYMENT.md
- Push code to GitHub
- Import project to Vercel
- Add environment variables
- Deploy!
npm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLintContributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- Website: nextcodehub.com
- Issues: GitHub Issues
- Contact: Via contact form on website
Made with β€οΈ using Next.js & Prisma