MEAN Stack VM by Anarion Technologies
MongoDB is a NoSQL database that uses a flexible, document-oriented data model, allowing developers to store data in JSON-like documents. This schema-less structure enables easy scaling and efficient handling of large volumes of data, making it ideal for modern web applications that require agility and flexibility.
Express.js is a minimalist web application framework for Node.js that simplifies the process of building server-side applications and APIs. It provides a robust set of features for web and mobile applications, including routing, middleware support, and seamless integration with various template engines. This flexibility allows developers to create powerful server-side logic while maintaining clean and organized code.
Angular, developed by Google, is a leading front-end framework that empowers developers to create rich, dynamic user interfaces. It follows the MVC (Model-View-Controller) architecture, which promotes a clean separation of concerns, improving maintainability and scalability. Angular’s two-way data binding, dependency injection, and modular architecture enable the development of responsive and high-performance applications, enhancing the overall user experience.
Node.js serves as the runtime environment for executing JavaScript code on the server side. It is built on Chrome’s V8 JavaScript engine and uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js allows developers to build fast and scalable network applications, making it an ideal choice for real-time applications such as chat applications and collaborative tools.
Together, these components create a cohesive development environment where developers can use JavaScript for both client-side and server-side programming. This unified approach streamlines the development process, reduces context switching, and enables code reusability across different layers of the application.
To subscribe to this product from Azure Marketplace and initiate an instance using the Azure compute service, follow these steps:
1. Navigate to Azure Marketplace and subscribe to the desired product.
2. Search for “virtual machines” and select “Virtual machines” under Services.
3. Click on “Add” in the Virtual machines page, which will lead you to the Create a virtual machine page.
4. In the Basics tab:
- Ensure the correct subscription is chosen under Project details.
- Opt for creating a new resource group by selecting “Create new resource group” and name it as “myResourceGroup.”
5. Under Instance details:
- Enter “myVM” as the Virtual machine name.
- Choose “East US” as the Region.
- Select “Ubuntu 18.04 LTS” as the Image.
- Leave other settings as default.
6. For Administrator account:
- Pick “SSH public key.”
- Provide your user name and paste your public key, ensuring no leading or trailing white spaces.
7. Under Inbound port rules > Public inbound ports:
- Choose “Allow selected ports.”
- Select “SSH (22)” and “HTTP (80)” from the drop-down.
8. Keep the remaining settings at their defaults and click on “Review + create” at the bottom of the page.
9. The “Create a virtual machine” page will display the details of the VM you’re about to create. Once ready, click on “Create.”
10. The deployment process will take a few minutes. Once it’s finished, proceed to the next section.
To connect to the virtual machine:
1. Access the overview page of your VM and click on “Connect.”
2. On the “Connect to virtual machine” page:
- Keep the default options for connecting via IP address over port 22.
- A connection command for logging in will be displayed. Click the button to copy the command. Here’s an example of what the SSH connection command looks like:
“`
ssh [email protected]
“`
3. Using the same bash shell that you used to generate your SSH key pair, you can either reopen the Cloud Shell by selecting >_ again
or going to https://shell.azure.com/bash.
4. Paste the SSH connection command into the shell to initiate an SSH session.
Usage/Deployment Instructions
Anarion Technologies – MEAN Stack
Note: Search product on Azure marketplace and click on “Get it now”
Click on Continue
Click on Create
Creating a Virtual Machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
After Process of Create Virtual Machine. You have got an Option Go to Resource Group
Click Go to Resource Group
Click on the Network Security Group: mern-nsg
Click on Inbound Security Rule
Click on Add
Add Port
Add Port
Destination Port Ranges Section* (where default value is 8080)
5000, 4200
Select Protocol as TCP
Option Action is to be Allow
Click on Add
Click on Refresh
Copy the Public IP Address
SSH into Terminal & run these following Commands:
$ sudo su
$ sudo apt update
Verify the Version:
$ node -v
$ npm -v
MongoDB Status:
$ sudo systemctl status mongod
Check Express.js is Working: You can create a directory for your application
$ mkdir my-mern-app
$ cd my-mern-app
Create a Basic Express Server
Create a file called server.js:
// server.js
const express = require(‘express’);
const app = express();
const port = 5000;
app.get(‘/’, (req, res) => {
res.send(‘Hello World!’);
});
app.listen(port, () => {
console.log(`Server is running at http://localhost:${port}`);
});
Run the server:
$ node server.js
Use the browser to access the application at http://”instance Ip address:5000″
Check React is Working
In a separate terminal window, navigate to your project directory
$ npx create-react-app client
$ cd client
Run the React Application
Inside the client directory, run:
$ npm start
Create a new Angular project:
$ ng new angular-app
$ cd angular-app
$ ng serve –host 0.0.0.0 –open
Use the browser to access the application at http://”instance Ip address:4200″
Thanks!!!