An open API service indexing awesome lists of open source software.

https://github.com/nima-moradi1/blog-app

a full blog app with admin panel and user panel. create posts , make comments, answer to comments,
https://github.com/nima-moradi1/blog-app

context-api expressjs nextjs15-typescript react-query tailwindcss

Last synced: 4 months ago
JSON representation

a full blog app with admin panel and user panel. create posts , make comments, answer to comments,

Awesome Lists containing this project

README

        

# ๐Ÿ“Œ Next.js-V.15 Full-Stack Blog-Application

## ๐Ÿš€ Project Overview
This project is a **Full-Stack Blog application** built with **Next.js**, **TypeScript**, and a **MongoDB, Node.js, Express backend**. It features a **fully responsive UI**, an **admin panel**, **Secure authentication**, **RESTful API implementation**, **server-side rendering (SSR)**, and advanced functionalities like **pagination, sorting, filtering, and nested routes**.

---

## ๐Ÿ›  Tech Stack

### **Frontend (Next.js & React)**
- **Next.js** โ†’ Server-side rendering (SSR), routing, API routes
- **TypeScript** โ†’ Type safety, improved maintainability
- **Tailwind CSS** โ†’ Utility-first styling, responsive design
- **React Query** โ†’ State management, API data fetching and caching
- **Axios** โ†’ HTTP requests to backend
- **Middleware Handler** โ†’ Custom middleware for authentication, logging, and request validation

### **Authentication & Authorization**
- **OTP-based login & signup** โ†’ Secure authentication using Username-Password
- **JWT-based authorization** โ†’ Role-based access for users and admins
- **Middleware for protected routes** โ†’ Ensures only authorized users can access restricted content

### **Advanced UI Features**
- **Nested Routes** โ†’ Clean and modular routing
- **Pagination** โ†’ Optimized data loading with page navigation
- **Sorting & Filtering** โ†’ Efficient data manipulation for a better user experience
- **Fully Responsive Design** โ†’ Works seamlessly on all devices

### **Admin Panel**
- **Dashboard for site owners** โ†’ Manage users, content, and site settings
- **Admin Role Authorization** โ†’ Only admins can access and modify specific data > delete comments, delete posts, update them and ...
- **Create Posts** โ†’ You can create as many posts as you want!
- **Comments** โ†’ You can give feedback through comments, or even หฎanswerหฎ the users' comments >> dynamically updating the ui while fetching API without refreshing the page or more requests!

### **Backend (Node.js, Express & MongoDB)**
- **Node.js & Express.js** โ†’ REST API implementation, request handling
- **MongoDB** โ†’ NoSQL database for scalable data storage
- **Mongoose** โ†’ ODM for MongoDB schema and model management
- **REST API Implementation** โ†’ Full CRUD operations with authentication

---

## ๐Ÿ›  Installation & Setup
### **1๏ธโƒฃ Clone the Repository**
```sh
git clone https://github.com/Nima-Moradi1/blog-app.git
cd blog-app
```

### **2๏ธโƒฃ Install Dependencies**
```sh
npm install
```

### **3๏ธโƒฃ Set Up Environment Variables**
Create a `.env` file in the root directory and configure your environment variables:
```sh
>>Frontend :
NEXT_PUBLIC_API_URL=http://localhost:5001
>>Backend :
APP_DB=####
ACCESS_TOKEN_SECRET_KEY=####
REFRESH_TOKEN_SECRET_KEY=####
COOKIE_PARSER_SECRET_KEY=####
TOKEN_SECRET_KEY=####
CLIENT_URL=http://localhost:3000
SERVER_URL=http://localhost:5001
NODE_ENV=development
PORT=5001
ALLOW_CORS_ORIGIN=http://localhost:3000
DOMAIN=localhost
```

### **4๏ธโƒฃ Run the Development Server**
Frontend (Next.js):
```sh
npm run dev
```

Backend (Express.js):
```sh
cd backend
npm start
```

### **5๏ธโƒฃ Build for Production**
```sh
npm run build && npm start
```

---

## ๐Ÿ”ฅ Features
โœ… Full **Next.js** & **TypeScript** support
โœ… **Fully responsive** design with TailwindCSS
โœ… **React Query** for data fetching & caching
โœ… **React Context** for storing user data (State manager)

โœ… **JWT-based (httpOnly Cookies) authentication**
โœ… **Nested routes**, **pagination**, **sorting & filtering**
โœ… **Admin panel** for website admin
โœ… **RESTful API** with Express & MongoDB
โœ… **Middleware handlers** for security & access control
โœ… **Server-Side Rendering (SSR)** for better performance
โœ… **Full authorization & role-based access**
โœ… **Full CRUD operations** on the backend

---

## ๐Ÿ“œ API Endpoints (Examples)
๐Ÿš€Provided in a JSON file for you in the repository๐Ÿš€

---

## ๐Ÿค Contribution Guidelines
Feel free to contribute! ๐Ÿš€
1. Fork the repo
2. Create a new branch (`feature/your-feature`)
3. Commit your changes (`git commit -m 'Added new feature'`)
4. Push to your branch (`git push origin feature/your-feature`)
5. Create a pull request

---

## ๐Ÿ“ฌ Contact
For any questions or collaborations, reach out at:
๐Ÿ“ง **[email protected]**
GitHub: [Nima-Moradi1](https://github.com/Nima-Moradi1)

---
### ๐ŸŽ‰ Happy Coding! ๐Ÿš€