Skip to content

0x4nud33p/blog-app

Repository files navigation

πŸ“ Blog App

A modern, full-stack blogging platform built with Next.js 14, featuring real-time interactions, user authentication, and a sleek responsive design.

✨ Features

  • πŸ” User Authentication - Secure signup/login system
  • πŸ’¬ Comment System - Interactive commenting on blog posts
  • πŸ” Search Functionality - Find blogs by title, content, or author
  • πŸ‘€ User Profiles - Customizable user profiles with edit capabilities
  • πŸ“± Responsive Design - Optimized for desktop, tablet, and mobile
  • πŸŒ™ Dark/Light Theme - Toggle between themes for better UX
  • ⚑ Real-time Updates - Dynamic content loading with Redux state management
  • πŸ“„ Pagination - Efficient content browsing
  • 🎨 Modern UI - Built with Tailwind CSS and shadcn/ui components

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 14 (App Router)
  • Styling: Tailwind CSS
  • UI Components: shadcn/ui
  • State Management: Redux Toolkit
  • Rich Text Editor: Custom implementation

Backend

  • API: Next.js API Routes
  • Database: Prisma ORM
  • Authentication: Custom JWT implementation
  • File Handling: Next.js built-in capabilities

Development Tools

  • Language: JavaScript
  • Linting: ESLint
  • Package Manager: npm/yarn
  • Database Management: Prisma

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ installed
  • npm or yarn package manager
  • Database (PostgreSQL, MySQL, or SQLite)

Installation

  1. Clone the repository

    git clone https://github.com/0x4nud33p/Blog-App.git
    cd Blog-App
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Environment Setup Create a .env.local file in the root directory:

    # Database
    DATABASE_URL="your-database-connection-string"
    
    # JWT Secret
    JWT_SECRET="your-super-secret-jwt-key"
    
    # Next.js
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-nextauth-secret"
  4. Database Setup

    # Generate Prisma client
    npx prisma generate
    
    # Run database migrations
    npx prisma db push
    
    # (Optional) Seed the database
    npx prisma db seed
  5. Start the development server

    npm run dev
    # or
    yarn dev
  6. Open your browser Navigate to http://localhost:3000

πŸ“ Project Structure

└── 0x4nud33p-blog-app/
    β”œβ”€β”€ app/                    # Next.js App Router
    β”‚   β”œβ”€β”€ (router)/          # Route groups
    β”‚   β”‚   β”œβ”€β”€ _components/   # Shared components
    β”‚   β”‚   β”œβ”€β”€ home/         # Home page & blog details
    β”‚   β”‚   β”œβ”€β”€ myblog/       # User's personal blogs
    β”‚   β”‚   β”œβ”€β”€ search/       # Search functionality
    β”‚   β”‚   └── signup/       # User registration
    β”‚   β”œβ”€β”€ api/              # API routes
    β”‚   β”‚   β”œβ”€β”€ (comment)/    # Comment operations
    β”‚   β”‚   β”œβ”€β”€ (posts)/      # Blog post operations
    β”‚   β”‚   β”œβ”€β”€ (update)/     # Update operations
    β”‚   β”‚   └── (user)/       # User operations
    β”‚   └── redux/            # State management
    β”œβ”€β”€ components/           # Reusable UI components
    β”‚   └── ui/              # shadcn/ui components
    β”œβ”€β”€ DB/                  # Database configuration
    β”œβ”€β”€ lib/                 # Utility functions
    β”œβ”€β”€ prisma/              # Database schema
    └── utils/               # Helper utilities

🎯 Usage

Creating a Blog Post

  1. Sign up or log in to your account
  2. Navigate to "My Blogs" section
  3. Click "Create New Post"
  4. Use the rich text editor to write your content
  5. Add a compelling title and publish

Commenting on Posts

  1. Browse to any blog post
  2. Scroll to the comment section
  3. Write your comment and submit
  4. Engage with other readers' comments

Managing Your Profile

  1. Access your profile from the navigation menu
  2. Update your username, email, and other details
  3. View and manage your published blogs

πŸ”§ API Endpoints

Authentication

  • POST /api/user/signup - User registration
  • POST /api/user/login - User login
  • POST /api/user/logout - User logout

Blog Posts

  • GET /api/posts/post - Get all blog posts
  • POST /api/posts/post - Create new blog post
  • GET /api/posts/post/[id] - Get specific blog post
  • GET /api/posts/search - Search blog posts

Comments

  • GET /api/comment/getcomment - Get comments for a post
  • POST /api/comment/create - Create new comment
  • DELETE /api/comment/deletecomment - Delete comment

User Updates

  • PUT /api/update/username - Update username
  • PUT /api/update/useremail - Update user email
  • PUT /api/update/updateTitle - Update blog title
  • PUT /api/update/updatePara - Update blog content

🌟 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m "Add some amazing feature"
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style and conventions
  • Write clear, descriptive commit messages
  • Add tests for new features when applicable
  • Update documentation as needed

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Support

If you encounter any issues or have questions:

πŸ™ Acknowledgments

πŸ“Š Project Stats

GitHub stars GitHub forks GitHub issues GitHub license


Made with ❀️ by 0x4nud33p

Features β€’ Quick Start β€’ Usage β€’ Contributing

Releases

No releases published

Packages

No packages published