3 years ago
(Develop a web application complete with backend and frontend / Develop a full-stack web application / Develop a MERN stack website)
I will talk for both advanced and beginner developers in this blog. So, if you are a beginner 🤓, don't get confused with if you see anything that looks too advance for you. As soon as I am done with discussing the advanced stuff, I will also discuss a roadmap to how to reach that position. And if you are an advanced developer, well you know which part to skip. ☕️
So, let's first talk about the actual blogging platform that we are going to refer to in this blog: https://www.blogaramaa.com
This is a blogging platform, free for all to use. I created this as a part of my personal projects using MERN stack along with Next.JS. Essentially, I planned it to be simply a blogging platform for my own use, but then I figured, while I am at it, why not let the people use it too. So here it is. A very simple and intuitive platform for you to share your story.
It was an amazing experience building this as I have learnt a lot during the development process and that is what I would like to share today with you all.
Technical Specs-
As the title says, I've built this using MERN stack, which means MONGO, EXPRESS, REACT & NODE
BACKEND
FRONTEND
Road map to REACT.JS : GETTING STARTED
Road map to REACT.JS : THE NEXT LEVEL
Remember how I told you about using JSON-PLACEHOLDER while learning the frontend part. Well to get your website up and running, you will have to set up a backend which will serve you the dynamic data from your database to be consumed in your client app. So here you can make do with one of the following two routes -
Ok, so this might sound like too much work. But believe me, if you have come all this way, the next part is not that hard. So, if you have decided to go with the first route, then it's time for you to get started with the development of your product. And I hope this blog helped you find the answers you were looking for. But for those of you who are going with the second route, which is becoming the backend developer yourself, then follow along. And a nice recipe of becoming a MERN full-stack developer is coming right up!
Now while there are a number of options to choose from while developing a backend, and one definitely cannot go wrong with any of the available options as of the date this blog is posted, but since I went with Node.JS (with Express.JS) along with MongoDB as the database, those two are what we are going to talk about in the coming sections.
For starters, it's a JavaScript runtime environment. And being JS, there was not one-second thought for me. It had to be Node.JS. Moreover, with Express.JS which as stated in their very own WEBSITE, is a Fast, unopinionated, minimalist web framework for Node.JS. And as the frontend is also written using a JS framework, it would be very easy to build the REST APIs while being in the same paradigm of language, i.e. JS. Having said that, now I'll answer the question to why I choose MongoDB.
The reason is very similar to "why Node.JS?". MongoDB is a database that stores the data in the form of JSON (JavaScript Object Notation) like documents. And again, JS shines. As MongoDB stores data in an identical format to what we get as a response from REST APIs, it was like the backend, frontend and database, are not any different from each other at all. And so, the developing process becomes much painless. And this whole reason also answers the question why MERN stack, too. And while we are on this subject, Node + MongoDB + Mongoose is just a breeze. As their own WEBSITE quotes, Mongoose is an elegant MongoDB object modelling for Node.JS. And voila! This is why MERN.
So, that was backend in a nutshell. But for those who are just getting started with web-dev and mainly backend development, here is the roadmap to reach a position to build the backend for this exact website -
Road map to REST APIs : LEARNING MongoDB
Road map to REST APIs : LEARNING Node.JS
Road map to REST APIs : LEARNING Express.JS with Mongoose for Node.JS with MongoDB
Road map to REST APIs : FOR PRODUCTION
With this, I will conclude my blog about Developing a blogging platform using MERN stack.
Feel free to drop a comment below and react to this blog. I really hope this blog helped you envision a roadmap to how you can build a web application, complete with frontend and backend just like this one. Feel free to reach me out at my public email id. Thanks for reading.
BONUS
For those of you who are curious, here are the dependencies that went into developing BLOGARAMAA
(I have copied the list of dependencies directly from the package.json file for the following)
BACKEND
"dependencies": {
"@sendgrid/mail": "^7.4.4",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"express-jwt": "^6.0.0",
"formidable": "^1.2.2",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.12.12",
"nodemailer": "^6.6.1",
"nodemon": "^2.0.7"
}
FRONTEND
"dependencies": {"@chakra-ui/icons": "^1.1.7","@chakra-ui/react": "^1.8.8","@emotion/react": "^11.9.0","@emotion/styled": "^11.8.1","@testing-library/jest-dom": "^5.16.4","@testing-library/react": "^13.1.1","@testing-library/user-event": "^13.5.0","@types/jest": "^27.4.1","@types/node": "^16.11.33","@types/react": "^18.0.8","@types/react-dom": "^18.0.3","axios": "^0.27.2","framer-motion": "^6.3.3","github-calendar": "^2.2.9","react": "^18.1.0","react-dom": "^18.1.0","react-github-calendar": "^3.3.1","react-lazy-load-image-component": "^1.5.4","react-pdf": "^5.7.2","react-query": "^3.38.1","react-router-dom": "^6.3.0","react-scripts": "5.0.1","react-scroll": "^1.8.7","react-web-share": "^1.1.6","typescript": "^4.6.4"}