How to build projects on MEAN stack

Jan 2, 2024

by Pranay

My Computer Specifications:

Step by Step Procedure:

  1. Download and install Node.js from the official website or use a package manager for your operating system.
  2. Install MongoDB by following the instructions on the official MongoDB website or using a package manager.
  3. Create a new directory for your MEAN stack project.
  4. Inside your project directory, initialize a new Node.js project by running:
  5. npm init -y
  6. Install Express.js, a web application framework for Node.js, by running:
  7. npm install express
  8. Create a new JavaScript file (e.g., app.js) and set up your Express application.
  9. Install Angular CLI globally on your system by running:
  10. npm install -g @angular/cli
  11. Create a new Angular app inside your project directory by running:
  12. ng new client
  13. Navigate to the client directory and install Angular dependencies by running:
  14. cd client
    npm install
  15. Install CORS middleware for Express.js to handle Cross-Origin Resource Sharing by running:
  16. npm install cors
  17. Start MongoDB server and configure your database settings.
  18. Set up a connection to MongoDB from your Express.js application using Mongoose or any other MongoDB driver.
  19. Build your Angular app by running:
  20. ng build --prod
  21. Start your Express.js server by running:
  22. node app.js
  23. Access Your MEAN Stack Application: Access your MEAN stack application in a web browser by navigating to http://localhost:PORT, where PORT is the port number specified in your Express.js configuration.
Author Avatar

Pranay Makkena

I am proficient in programming languages like Python and Java, React library and I also have expertise in marketing, including SEO and Social Media Marketing.