A full-stack countdown timer application built with Node.js and Express. It allows users to set a custom date and time, with the countdown updating in real-time. This project is a demonstration of a containerized application deployed on a VM of Microsoft Azure.
- Real-time Countdown: Displays a live countdown to a custom date and time
- Responsive Design: A clean, responsive user interface that works seamlessly on desktop and mobile devices
- Node.js & Express.js Backend: A robust and lightweight server architecture
- Cloud-Ready Deployment: Engineered for seamless deployment to Microsoft Azure
- Node.js (v18 or newer)
- npm
-
Clone the repository and install dependencies:
git clone https://github.com/Amitabha01/Nodejs_in_AZ.git cd Nodejs_in_AZ npm install -
Create a
.envfile with basic settings:PORT=3000 NODE_ENV=development STATIC_DIR="./public"
-
Start the server:
npm start
-
Open http://localhost:3000 in your browser
docker build -t countdown-timer .
docker run -p 8080:8080 countdown-timerThen visit http://localhost:8080
nodejs_application/
├── public/ # Frontend files (HTML, CSS, JS)
├── server.js # Node.js server
├── .env # Environment settings
├── Dockerfile # For containerization
└── package.json # Dependencies and scripts
PORT: The port number (default: 3000)NODE_ENV: "development" or "production"STATIC_DIR: Folder for static files (default: "./public")
This project includes a step-by-step guide for deploying a Linux virtual machine on Azure and making the application publicly accessible.
- Create a new Ubuntu Server VM in the Azure Portal.
- Select an allowed region as specified by your subscription policy (e.g., East Asia, Central India).
- Use an SSH public/private key pair for secure access.
-
Find the public IP address from the VM's overview page.
-
Use the SSH command to connect, ensuring your private key file has secure permissions (chmod 400 your_key.pem).
ssh -i /path/to/your_key.pem azureuser@<your_public_ip>
-
Remove the default Node.js version to avoid conflicts.
-
Add the official NodeSource repository to install the latest stable version of Node.js.
-
Install the required packages.
sudo apt remove nodejs npm curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install nodejs
-
Clone your repository onto the VM.
-
Navigate to the project directory and install the application dependencies.
git clone https://github.com/Amitabha01/Nodejs_in_AZ.git cd Nodejs_in_AZ npm install npm start
- In the Azure Portal, go to the VM's Networking blade.
- Create an inbound port rule to allow TCP traffic on port 3000.
- Set the Destination port ranges to 3000 and the Action to Allow.
The application is now accessible at http://<your_public_ip>:3000.
MIT
Amitabha - GitHub
- Node.js & Express.js for the core backend technology
- Microsoft Azure for a robust cloud computing platform