- Introduction
- Features
- Screenshots
- Installation
- Usage
- Technologies Used
- Architecture
- Environment Variables
- Roadmap
- Contributing
- License
- Contact
DevNBlog is a comprehensive blog application developed using the MERN stack (MongoDB, Express, React, Node.js). It offers a dynamic and interactive experience, allowing users to manage posts, comments, and users through CRUD operations. The application also features JWT-based authentication and Google OAuth for secure user login, as well as a sleek dark mode interface and advanced search functionality.
DevNBlog ensures a responsive and engaging community experience, designed to cater to both desktop and mobile users.
Live Demo: DevNBlog Application
- JWT-Based Authentication & Google OAuth: Secure authentication using JSON Web Tokens and Google OAuth for seamless sign-in.
- CRUD Operations: Complete functionality for creating, reading, updating, and deleting blog posts, comments, and user profiles.
- Dark Mode: Sleek and responsive design with an optional dark mode for better user experience.
- Dashboard for Admins: Manage posts, comments, and users easily through a dedicated dashboard.
- Advanced Search and Sorting: Enhanced search functionality with options for sorting posts by date, popularity, or user preferences.
- Community Engagement: Users can interact with posts by leaving, editing, and deleting comments.
Home Screen | Admin Dashboard |
Post Page Interface | Post Details with Comments |
- Node.js: Ensure Node.js is installed. You can download it from the official website.
- MongoDB: You need MongoDB set up either locally or on a cloud service like MongoDB Atlas.
- Firebase: Set up Firebase for Google OAuth authentication.
- Clone the repository:
git clone https://github.com/naumanbutt2002/devnblog.git
- Navigate to the project directory:
cd devnblog
- Install server dependencies:
npm install
- Navigate to the client folder and install client dependencies:
cd client npm install
- Set up environment variables (See Environment Variables section below).
- Run the app:
# Start the server npm run dev # In a new terminal, start the client cd client
- Once the application is installed and running, you can access it by navigating to http://localhost:3000/ in your browser.
- Home Page: Browse and search blog posts. Filter results by date, popularity, or author.
- Post Details: View detailed information about a post, along with comments from the community.
- User Dashboard: For admins, manage posts, comments, and users in a separate admin interface.
- Commenting: Users can leave comments, edit or delete their existing comments.
- Authentication: Log in using Google OAuth or create a new account with JWT-based authentication.
- MongoDB: NoSQL database for storing posts, users, and comments.
- Express.js: Backend framework to handle server-side logic.
- React.js: Frontend framework to create the user interface.
- Node.js: JavaScript runtime for server-side programming.
- Redux: State management for React.
- Firebase: For Google OAuth authentication.
- JWT: Token-based authentication for secure login.
The DevNBlog application follows a component-based architecture with separation of concerns. The backend follows REST principles, while the frontend is designed using reusable React components. The state management is handled by Redux for scalable and maintainable code.
client/
├── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Pages (Home, PostDetails, etc.)
│ ├── redux/ # Redux actions, reducers
│ ├── utils/ # Utility functions and services
│ └── App.jsx # Main app component
server/
├── .env/ # Env files for MongoDB, JWT
├── controllers/ # Express controllers for handling routes
├── models/ # Mongoose models (User, Post, Comment)
├── routes/ # Express routes (Auth, Posts, Comments)
└── index.js # Main index file
To run this application, you need to set up two .env files with the following variables:
MONGO= 'Your MONGODB connection string'
JWT_SECRET='Any type of letters or keys of your choice'
VITE_FIREBASE_API_KEY="Your Firebase API Key"
- Set up a MongoDB database either locally or online via MongoDB Atlas.
- Create a Firebase Account here.
- Create a new project on Google Cloud Platform for Google OAuth integration here.
-
- Initial release with core features.
-
- Add image upload functionality for posts.
-
- Implement pagination for blog posts.
-
- Integrate a notification system for comments and replies.
-
- Add tagging functionality for posts.
-
- Release version 1.0.
Contributions are welcome! Please follow the steps below:
- Fork the repository.
- Create a new branch ('git checkout -b feature-branch').
- Make your changes.
- Commit your changes ('git commit -m 'Add some feature'').
- Push to the branch ('git push origin feature-branch').
- Open a pull request.
Please ensure all contributions align with the Clean Architecture principles used in this project.
Distributed under the MIT License. See LICENSE for more information.
Muhammad Nauman
naumanbutt2002@gmail.com
Linkedin | Instagram
You can also follow my GitHub Profile to stay updated about my latest projects: Github