
Install Visual Studio Code on Windows, download from code.visualstudio.com, complete the setup with the installation wizard, and verify the installation by running code --help in the command prompt.
Connect a node backend to MongoDB with Mongoose by installing the Mongoose package, defining a connect method, and using a MongoDB URI; create a hotel rooftop database and log success.
Create a two-folder project (frontend and backend) and initialize npm to build a basic express server in index.js. Run with nodemon for automatic restarts and manage ports for localhost.
Securely connect your MERN blog by configuring dotenv and cors, installing and using .env for the MongoDB URL, and enabling express.json parsing with a mongoose connection.
Postman Download Link: https://www.postman.com/downloads/
Learn how to create a route to get all blog posts from MongoDB using a Mongoose model and the find method, returning a 200 response with the posts.
Update a blog post in a MERN app using patch (or put) and findByIdAndUpdate, retrieving the post id from the route and returning a post updated successfully message.
Learn to build a related blogs feature by creating a dedicated route for related posts, excluding the current blog, and fetching results by title-based regex in a MERN stack.
Implement a login flow that authenticates users by email and password, comparing bcrypt hashed passwords, and returns a user object on success. Handle invalid credentials with a 401 error.
Implement a get all users route using router.get to fetch users from the database with the user model and return a 200 response with user data.
Update a user role in the admin dashboard with a put or patch request, using id from params and role from body to update MongoDB and respond with success.
const jwt = require('jsonwebtoken');
const JWT_SECRET = process.env.JWT_SECRET_KEY;
const verifyToken = (req, res, next) =>{
try {
// const token = req.cookies.token;
const token = req.headers.authorization?.split(' ')[1]; // Bearer token
if(!token) {
return res.status(401).send({message: "No token provided"})
}
const decoded = jwt.verify(token, JWT_SECRET);
if(!decoded.userId) {
return res.status(401).send({message: "Invalid token provided"})
}
req.userId = decoded.userId;
req.role = decoded.role;
next();
} catch (error) {
console.error( "Error verify token",error);
res.status(401).send({message: "Invalid token"})
}
}
module.exports = verifyToken
Define an isAdmin middleware to verify admin users for blog post creation, updating, and deletion, enforce token and authorization checks, and test admin access in the MERN blog API.
Set up a React project with vite and organize frontend and backend folders. Install dependencies with npm, run npm run dev to launch the frontend, and install Tailwind CSS.
Define a custom tailwind color palette in tailwind.config.js by extending colors for a full-stack mern blog project. Set primary, background, and accent colors to style the app.
Learn to set up react router dom to enable single-page navigation for a mern blog, render specific pages (home, about us, privacy policy, contact us) without reloading the whole page.
Set up a modular MERN blog architecture with a fixed header and footer and an outlet rendering changing body content, using a home page as a child route.
Build a blog base with blog cards and a searchable interface, featuring a search bar, a search component, and stateful handlers for query and category.
Design and implement a comment card component for a mern blog, map comments, display user name and avatar, format created at, and handle no comments found.
Create a post a comment section in a MERN blog app using route params for the post id, a controlled textarea, and a styled submit button.
implement login and registration in a mern blog app, using a login mutation and browser cookies to store the token, with client-side auth state managed by a redux slice.
Define and integrate post, update, and delete blog APIs using builder mutations, dynamic IDs, and tag invalidation within a MERN blog app, then secure the admin dashboard.
Set up admin navigation routes and pages for a full-stack MERN blog, creating root and child paths for dashboard, add post, manage items, and users, with Redux logout integration.
Design and implement an admin dashboard page for a full-stack MERN blog, featuring a welcome header, four stat cards (users, blocks, admins, comments), and a blog chart.
Design a blog graph chart using Recharts with a responsive area chart, including x axis, y axis, tooltip, and formatted data such as name, date, title length, and page views.
Learn how to run a full-stack MERN blog project by deploying backend and frontend, configuring MongoDB Atlas, env vars, and admin dashboard with posts and comments.
Are you ready to take your web development skills to the next level? In this course, we'll build a full-stack MERN blog website, a real-world project valued at $250 on Upwork. Whether you're a beginner or an experienced developer, this course will guide you through creating a powerful, feature-rich blog platform from scratch.
What You'll Learn
Frontend Development:
React: Master the fundamentals and advanced concepts of React.
Tailwind CSS: Style your application efficiently with this utility-first CSS framework.
Redux & Redux RTK Query Toolkit: Manage state and handle API requests seamlessly.
Login & Registration: For login and registration will generate token and set it to cookies.
Role-Based Dashboard: We will implement private routing to give access based on user role.
Backend Development:
Node.js & Express.js: Set up a robust backend server.
MongoDB & Mongoose: Work with a NoSQL database and an elegant object data modeling library.
JWT Authentication: Implement secure authentication and authorization.
Bcrypt: Ensure user password security with hashing techniques.
MVC Architecture Pattern: We will follow the Model, the View, and the Controller architecture pattern to structure our backend project
Admin Dashboard:
Admin Panel: Create an admin dashboard to post, manage, and update blogs.
User Management: Control user access and manage overall functionality.
Course Highlights
Real-World Project: Build a project that can be sold or showcased in your portfolio.
Comprehensive Learning: Gain hands-on experience with both frontend and backend technologies.
Step-by-Step Guidance: Follow detailed instructions and best practices.
Admin Functionality: Learn to create and manage an admin panel for complete control over your application.
Why Take This Course?
This course offers a complete, in-depth look at modern web development using the MERN stack. By the end, you'll have a fully functional blog website and the skills to build and manage your own web projects. Plus, you'll gain insights into best practices for both frontend and backend development, making you a versatile and valuable developer in today's job market.
Join us on this exciting journey to become a proficient full-stack developer. Enroll now and start building your professional blog website today!