A modern, high-performance tech blog built with Next.js and headless WordPress. Designed for developers and tech enthusiasts, it features a beautiful UI, blazing-fast performance, and a fully decoupled content management experience.
Code & Tech is a modern, high-performance tech blog that leverages a headless WordPress backend and a Next.js frontend. It is designed to provide a seamless, fast, and SEO-optimized reading experience for tech enthusiasts, developers, and content creators. The project decouples content management from presentation, allowing editors to use the familiar WordPress dashboard while delivering a blazing-fast, modern frontend.
Here are some screenshots of the Code & Tech blog:
Homepage
Article Page
Contact Page
- Headless Architecture: Decoupled WordPress backend and Next.js frontend for flexibility and performance.
- Static Site Generation (SSG) & Server-Side Rendering (SSR): Combines SSG for most pages and SSR for dynamic content, ensuring fast load times and great SEO.
- SEO Optimized: Automatic meta tags, Open Graph, Twitter cards, sitemaps, and structured data for maximum discoverability.
- Responsive Design: Fully mobile-friendly and accessible, with a modern UI built using Tailwind CSS.
- WordPress Backend: Content managed via the WordPress dashboard, supporting posts, categories, tags, and custom fields.
- Advanced Search: Full-text search for articles, tutorials, and insights.
- Category & Tag Filtering: Easily browse posts by category or tag, with deep linking.
- Author Pages: Dedicated author profiles with bio and post listings.
- Contact Form: Modern, validated contact form with email integration and spam protection.
- View Tracking: Tracks post popularity and displays trending articles.
- Rate Limiting: Built-in API rate limiting for spam protection.
- Newsletter Signup: Integrated newsletter form for audience growth.
- Modern UI/UX: Animations, gradients, and a clean, professional look.
- Framework: Next.js 13+ (App Router), React 18
- Styling: Tailwind CSS, custom CSS modules
- Data Fetching: Native
fetch
API, ISR/SSR, SWR (optional) - State Management: React hooks, local state
- Forms & Validation: React, custom validation, server-side validation
- Deployment: Vercel
- CMS: Headless WordPress
- API: WordPress REST API
- Plugins:
- Advanced Custom Fields (ACF)
- JWT Authentication for WP REST API (for login)
- Node.js v18.x or higher
- npm, yarn, or pnpm
- WordPress (local or remote instance)
- Required WordPress Plugins (see above)
- Ensure your WordPress site is running (locally or remotely).
- Install and activate the required plugins:
- Advanced Custom Fields (ACF)
- JWT Authentication for WP REST API
- Set Permalinks to "Post name" in WordPress settings for clean URLs.
- Configure ACF fields and custom post types as needed.
- Clone the repository:
git clone https://github.com/halil-yesilyurt/code-and-tech cd code-and-tech
- Install dependencies:
npm install # or yarn install # or pnpm install
- Copy the example environment file and configure it:
cp .env.example .env.local # Edit .env.local with your WordPress API endpoint and other secrets
Create a .env.local
file in the root directory. Example:
# WordPress REST API Endpoint (server-side)
WORDPRESS_API_URL="https://your-wordpress-site.com/wp-json"
# WordPress REST API Endpoint (client-side)
NEXT_PUBLIC_WORDPRESS_API_URL="https://your-wordpress-site.com/wp-json"
# WordPress JWT Secret (for authentication, if used)
WORDPRESS_JWT_SECRET="your-jwt-secret"
# Resend API Key (for contact form)
RESEND_API_KEY="re_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Contact Email (for receiving contact form submissions)
CONTACT_EMAIL="your-email@example.com"
WORDPRESS_API_URL
: The base URL for your WordPress REST API (server-side).NEXT_PUBLIC_WORDPRESS_API_URL
: The base URL for your WordPress REST API (client-side, exposed to browser).WORDPRESS_JWT_SECRET
: Secret key for JWT authentication (if login/auth is enabled).RESEND_API_KEY
: API key for Resend email service (contact form).CONTACT_EMAIL
: Email address to receive contact form submissions.
- Development:
npm run dev # Starts the dev server at http://localhost:3000
- Build:
npm run build # Builds the production app
- Start:
npm run start # Starts the production server
- Vercel:
- Push your repo to GitHub.
- Import into Vercel and set environment variables in the dashboard.
- Deploy!
Deployment is designed and tested for Vercel. For other platforms, custom configuration may be required.
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature
) - Make your changes and commit (
git commit -m 'Add feature'
) - Push to your fork (
git push origin feature/your-feature
) - Open a Pull Request on GitHub
This project is licensed under the MIT License. See the LICENSE file for details.
- Next.js Team for the React framework
- WordPress Community for the CMS
- Tailwind CSS for the styling framework
- Vercel for hosting
- All open-source contributors
Happy coding! 🚀