A full-stack blogging platform , built with React and Node.js. This CMS features a rich text editor, user authentication, blog management, comments system, edit profile and a beautiful theme.
- Rich Text Editor: Powered by EditorJS with support for:
- Headers, paragraphs, and lists
- Code blocks with syntax highlighting
- Inline code and markers
- Images and embeds
- Links and quotes
- Draft System: Save blogs as drafts and publish when ready
- Blog Management Dashboard: View, edit, and delete your published blogs and drafts
- Tag System: Organize blogs with tags for better discoverability
- Authentication:
- Email/Password signup and signin
- Google Auth integration
- JWT-based secure authentication
- User Profiles:
- Customizable profile with bio, username, and social links
- Profile image upload via Cloudinary
- View other users' profiles and their blogs
- Password Management: Secure password change functionality
- Comment System:
- Add comments and replies to blogs
- Nested comment threads
- Like System: Like blogs and track engagement
- Responsive Design: Mobile-friendly interface built with Tailwind CSS
- Smooth Animations: Framer Motion powered transitions
- Toast Notifications: Real-time feedback with React Hot Toast
- Pagination: Load more functionality for blogs and comments
- Search: Search blogs by title, tags, or author
- Trending Blogs: Discover popular content
- Latest Blogs: Browse recent publications
- User Search: Find other writers
- Framework: React 18.2.0
- Build Tool: Vite 4.4.5
- Routing: React Router DOM 6.14.2
- Styling: Tailwind CSS 3.3.3
- Rich Text Editor: EditorJS 2.27.2 with plugins
- Code, Embed, Header, Image, Inline Code, Link, List, Marker, Quote
- HTTP Client: Axios 1.4.0
- Authentication: Firebase 10.1.0 (Google OAuth)
- Animations: Framer Motion 10.13.0
- Notifications: React Hot Toast 2.4.1
- State Management: React Context API
- Runtime: Node.js with Express 4.18.2
- Database: MongoDB with Mongoose 7.3.2
- Authentication:
- Firebase Admin 11.10.1 (Google OAuth)
- JWT (jsonwebtoken 9.0.1)
- bcrypt 5.1.0 (Password hashing)
- File Storage: AWS SDK 2.1432.0 (Cloudinary integration)
- Utilities:
- nanoid 4.0.2 (Unique ID generation)
- dotenv 16.3.1 (Environment variables)
- cors 2.8.5 (Cross-origin requests)
- Server: Nodemon 3.0.1
- Linting: ESLint
- Bundling: PostCSS, Autoprefixer
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (local installation or MongoDB Atlas account)
- Firebase Project (for Google OAuth)
- Cloudinary Account (for image uploads)
git clone <repository-url>
cd Content_Management_Systemcd servernpm installCreate a .env file in the server directory:
PORT=4000
DB_LOCATION=your_mongodb_connection_string
SECRET_ACCESS_KEY=your_jwt_secret_key- Go to Firebase Console
- Create a new project or use an existing one
- Navigate to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Save the JSON file as
cms-website-a771e-firebase-adminsdk-fbsvc-d254091fb9.jsonin theserverdirectory- Note: Update the filename in
server.js(line 21) if you use a different name
- Note: Update the filename in
npm startThe server will run on http://localhost:4000
cd ../website - frontendnpm installCreate a .env file in the website - frontend directory:
VITE_SERVER_DOMAIN=http://localhost:4000Update src/common/firebase.jsx with your Firebase project credentials:
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-auth-domain",
projectId: "your-project-id",
storageBucket: "your-storage-bucket",
messagingSenderId: "your-messaging-sender-id",
appId: "your-app-id"
};Update src/common/aws.jsx with your Cloudinary credentials:
// Add your Cloudinary upload preset and cloud namenpm run devThe frontend will run on http://localhost:5173 (default Vite port)
server/
βββ Schema/
β βββ User.js # User model
β βββ Blog.js # Blog model
β βββ Comment.js # Comment model
β βββ Notification.js # Notification model
βββ server.js # Express server & API routes
βββ package.json # Backend dependencies
βββ .env # Environment variables
website - frontend/
βββ src/
β βββ pages/ # Page components
β β βββ home.page.jsx
β β βββ blog.page.jsx
β β βββ editor.pages.jsx
β β βββ profile.page.jsx
β β βββ dashboard.page.jsx
β β βββ ...
β βββ components/ # Reusable components
β β βββ navbar.component.jsx
β β βββ blog-post.component.jsx
β β βββ comment-card.component.jsx
β β βββ ...
β βββ common/ # Utility functions
β β βββ session.jsx # Auth context
β β βββ theme.jsx # Theme context
β β βββ firebase.jsx # Firebase config
β β βββ aws.jsx # Cloudinary config
β βββ App.jsx # Main app component
β βββ main.jsx # Entry point
βββ index.html
βββ package.json
βββ vite.config.js
POST /signup- Register new userPOST /signin- User loginPOST /google-auth- Google OAuth authenticationPOST /change-password- Change user password (Protected)
POST /get-profile- Get user profilePOST /update-profile- Update user profile (Protected)POST /update-profile-img- Update profile image (Protected)POST /search-users- Search users
POST /create-blog- Create/update blog (Protected)POST /get-blog- Get single blogPOST /latest-blogs- Get latest blogs with paginationPOST /all-latest-blogs-count- Get total blog countGET /trending-blogs- Get trending blogsPOST /search-blogs- Search blogsPOST /search-blogs-count- Get search results countPOST /user-written-blogs- Get user's blogs (Protected)POST /user-written-blogs-count- Get user's blog count (Protected)POST /delete-blog- Delete blog (Protected)
POST /like-blog- Like/unlike blog (Protected)POST /isliked-by-user- Check if user liked blog (Protected)POST /add-comment- Add comment (Protected)POST /get-blog-comments- Get blog commentsPOST /get-replies- Get comment repliesPOST /delete-comment- Delete comment (Protected)
- Sign in or create an account
- Click on "Write" in the navigation bar
- Use the rich text editor to create your content
- Add a banner image, title, description, and tags
- Save as draft or publish immediately
- Navigate to Dashboard > Blogs
- View your published blogs and drafts
- Edit or delete blogs as needed
- Load more blogs with pagination
- Like blogs by clicking the heart icon
- Add comments and replies
- Go to Dashboard > Edit Profile
- Update your bio, username, and social links
- Upload a profile picture
- Change your password in Dashboard > Change Password
- Password Hashing: bcrypt with salt rounds
- JWT Authentication: Secure token-based auth
- Protected Routes: Middleware for authenticated endpoints
- Input Validation: Server-side validation for all inputs
- URL Validation: Social links validation
The application is fully responsive and works seamlessly on:
- Desktop (1024px and above)
- Tablet (768px - 1023px)
- Mobile (below 768px)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.
- Inspired by Modern Web
- EditorJS for the rich text editor
- Firebase for authentication
- Cloudinary for image hosting
- The React and Node.js communities
For any queries or support, please open an issue in the repository.
Note: Remember to add your .env files to .gitignore and never commit sensitive credentials to version control.
