My experience working with the MERN stack in an industrial setting

Shavidini Ekanayake
SLIIT Women In FOSS Community
4 min readApr 23, 2023

The MERN stack is a popular web development technology that consists of MongoDB, Express, React, and Node.js. All the technologies in the MERN stack are open-source, which means they are free to use and constantly updated by a large community of developers. The MERN stack uses JavaScript throughout the entire stack, which can speed up and improve development. Sharing code between the client and server is also made simpler by using a single language.

I asked Mr. Nisal Palliyaguru, who works as a software engineer at Derana Macroentertainment Pvt Ltd, to find information about this MERN technology. In this blog, I will discuss his experience with this technology and how it has helped him in his professional career.

As a web developer for a startup, he started his journey with the MERN stack. Their main objective was to build a platform that would enable users to look for and find local businesses. The MERN stack offered a lot of flexibility and was well-suited for creating complex web applications, so the team chose to use it for this project.

As he told me “We first considered modular architecture while creating their project. It is regarded as a best practice for developers.” You can organize your code into small and reusable modules that are easy to maintain and test. You should use a clean directory structure, and separate concerns so that different parts of the application can be developed and deployed independently.

MongoDB — He said “As a software engineer, I use MongoDB’s indexing feature to optimize your database queries” MongoDB is a document-based NoSQL database. Its flexible data model allowed them to store complex data structures in a way that was easy to query and manage. They used the Mongoose ORM library to define their database schemas. Indexing ensures that queries are performed efficiently and helps speed up the performance of the application.

Express — Express is a nodejs web application framework that was used to create our API. Express made it easy to define routes and handle HTTP requests in a way that was simple and straightforward. He said “They also used various middleware packages, such as body-parser and cors, to handle incoming requests and enable cross-origin resource sharing” Middleware is a great way to keep your code organized and ensure that each component of your application is responsible for a specific task.

React — The React.js framework is an open-source JavaScript framework and library developed by Facebook. It was used to create the front-end of their application. React allow us to build complex user interfaces using reusable components, making it easy to manage and maintain our codebase. As he told me “They used various state management libraries, such as Redux and MobX, to manage their application state in a structured way” And, as a best practice, we develop our project should work well on different devices and screen sizes. We can use a popular CSS framework like Bootstrap or Materialize to create a responsive design that looks good on desktop and mobile devices.

Node — Node. js is a single-threaded, open-source, cross-platform runtime environment for building fast and scalable server-side and networking applications. He said, “They were able to create server-side code with Node.js using the same language and paradigm as their front-end code, which made it simple to transfer code between the two.”

When working as a developer should be more regarded about data safety. Use a robust authentication system for this. We can make use of a well-known authentication library like Passport.js or JsonWebToken (JWT). Also normally use a version control system like Git to manage your code changes. Version control helps you keep track of changes, collaborate with other developers, and roll back changes if necessary. Another one is to use a scalable architecture. Build your application with scalability in mind. Use a microservices architecture, containerization, and load balancing to ensure that your application can handle increasing traffic and user demand.

Finally, we look at why we use best practices in developing.

· Quality: By ensuring that the software is well-structured, dependable, and satisfies the needs of its users, best practices help to increase the software’s quality.

· Consistency: Utilizing best practices helps the development team adhere to a consistent methodology, which makes it simpler to maintain and update the software over time.

· Efficiency: By streamlining the development process, best practices help to cut down on the time and labor needed to create software.

· Scalability: By using best practices, you can make sure that the software is scalable and that it can manage lots of users, data, and other resources.

· Security: Using best practices helps to guarantee that the software is secure, guarding it against potential threats like hackers, viruses, and other kinds of malware.

In my opinion, building websites using best practices and taking into account all these factors can create high-quality, maintainable and efficient software that meets the needs of its users.

--

--