A modern, full-stack blog platform built with Next.js 16, featuring user authentication, blog management, and a beautiful responsive UI.
- 🔐 User Authentication - Firebase-based authentication with email/password and social login
- 📝 Blog Management - Create, read, update, and delete blog posts
- 🏷️ Category System - Organize blogs by categories
- 🔍 Search Functionality - Search blogs by title or author
- 🛡️ Protected Routes - Secure pages for authenticated users only
- 📱 Responsive Design - Mobile-first design with Tailwind CSS and DaisyUI
- 📧 Newsletter Section - Engage with your community
- 👥 Author Profiles - Showcase blog authors
- ⚡ Real-time Updates - React Query for efficient data fetching and caching
- Next.js 16 - React framework with App Router
- React 19 - Latest React features
- Tailwind CSS 4 - Utility-first CSS framework
- DaisyUI - Component library for Tailwind
- React Hook Form - Form validation and management
- TanStack Query - Data fetching and state management
- React Icons - Icon library
- Sonner - Toast notifications
- SweetAlert2 - Beautiful alerts
- Next.js API Routes - Serverless API endpoints
- MongoDB - NoSQL database
- Firebase Authentication - User authentication service
- Axios - HTTP client
- date-fns - Date utility library
- React Spinners - Loading indicators
- Node.js 18+ installed
- MongoDB database (local or Atlas)
- Firebase project with Authentication enabled
1️⃣ Clone the repository:
git clone https://github.com/programmerrakibul/chronos.git
cd chronos2️⃣ Install dependencies:
npm install3️⃣ Create a .env.local file in the root directory:
# Firebase Configuration
NEXT_PUBLIC_FIREBASE_apiKey=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_authDomain=your_firebase_auth_domain
NEXT_PUBLIC_FIREBASE_projectId=your_firebase_project_id
NEXT_PUBLIC_FIREBASE_storageBucket=your_firebase_storage_bucket
NEXT_PUBLIC_FIREBASE_messagingSenderId=your_firebase_messaging_sender_id
NEXT_PUBLIC_FIREBASE_appId=your_firebase_app_id
# MongoDB Configuration
MONGODB_URI=your_mongodb_connection_string
# Image Upload (ImgBB)
NEXT_PUBLIC_IMAGE_KEY=your_imgbb_api_key
# Site Configuration
SITE_DOMAIN=http://localhost:30004️⃣ Run the development server:
npm run dev5️⃣ Open http://localhost:3000 in your browser.
chronos/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (auth)/ # Authentication routes (login, register)
│ │ ├── api/ # API routes
│ │ ├── blogs/ # Blog listing and detail pages
│ │ ├── post-blog/ # Create blog page
│ │ ├── manage-blogs/ # Manage user's blogs
│ │ ├── about-us/ # About page
│ │ ├── contact-us/ # Contact page
│ │ └── layout.jsx # Root layout
│ ├── components/ # React components
│ │ ├── shared/ # Shared components (Navbar, Footer)
│ │ └── ... # Feature-specific components
│ ├── contexts/ # React contexts
│ ├── firebase/ # Firebase configuration
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility libraries (MongoDB)
│ └── utilities/ # Helper functions
├── public/ # Static assets
└── package.json
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLint
Users can register and login using email/password or social authentication providers through Firebase. Protected routes ensure only authenticated users can access certain pages.
Authenticated users can:
- ✍️ Create new blog posts with images
- 👀 View all their published blogs
- ✏️ Update existing blog posts
- 🗑️ Delete their blog posts
- 🔎 Search blogs by title or author name
- 🏷️ Filter blogs by category
- 👤 View blogs by specific authors
GET /api/blogs- Fetch all blogs (supports query params: email, search, category)POST /api/blogs- Create a new blog postGET /api/blogs/[id]- Fetch a specific blogPUT /api/blogs/[id]- Update a blog postDELETE /api/blogs/[id]- Delete a blog postGET /api/blogs/categories- Fetch all categories
| Variable | Description |
|---|---|
NEXT_PUBLIC_FIREBASE_* |
Firebase configuration keys |
MONGODB_URI |
MongoDB connection string |
NEXT_PUBLIC_IMAGE_KEY |
ImgBB API key for image uploads |
SITE_DOMAIN |
Your site's domain URL |
Contributions are welcome! Please feel free to submit a Pull Request.