Git Product home page Git Product logo

tp-vm-maker-azure's Introduction

README

Table of contents

Introduction

This project is a simple web application that allows you to create a virtual machine on Azure using the Azure SDK for NodeJS.

It was created as part of a school project for the course "Cloud" at Sup de Vinci. To learn more head over to .docs/README.md to read the full description of the project.

It is composed of a frontend a backend and a host, the frontend is a simple web page that allows you to input the necessary information to create a virtual machine, and the backend is a simple websocket that will handle the creation of the virtual machine on Azure. The host is experimental and a work in progress.

This project is hosted on github : Github repo

Other information :

The project is using the following ports by default in serve and start mode:

  • Frontend : 3000
  • Backend : 8000
  • Host : 3035

The dev port for the frontend may vary in dev mode

It is heavily reliant on the Azure SDK for NodeJS, and the Azure services, so you will need to have an Azure account and a subscription to use this project. Also the installation process was only accounted for Ubuntu or Debian with apt-get, so it might not work on other OS.

I - Setup the project using git

First install git :

apt-get install git -y

Then clone the repository using git :

cd /path-to-project-folder/
git clone https://github.com/V4nkor/tp-vm-maker-azure.git

II - Install and configure NPM

1) Installing NVM

Make sure you have curl or wget installed :

sudo apt-get install wget curl -y

Then, you'll need to install NVM using curl :

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Or using wget :

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Nvm will make sure you are using the correct version of nodeJS for this project

After that, make sure to update your profile :

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

Then, make sure your nvm was installed correctly :

nvm -v

2) Installing Node using NVM

Using the .nvmrc file and NVM, the correct version of Node for this project will be installed, eg : v20.10.0

Make sure you are in the same folder as the .nvmrc file !

nvm install
nvm use

III - Launch the project

1) Install PNPM using npm

npm install -g pnpm

2) Install all dependencies recursively

pnpm -r install

This will install the dependencies for both the Frontend and the Backend

3) Prepare the .env file

  • You can either make it manually by using the .env.template file and create the .env file with your credentials in ./apps/front/

  • Or you can use the implemented CLI script using pnpm :

pnpm run env

You will be prompted the following elements in your terminal :

  • AZURE_SUBSCRIPTION_ID

  • AZURE_CLIENT_ID

  • AZURE_TENANT_ID

  • AZURE_CLIENT_SECRET

You can set them up and retrieve them by following this tutorial : Entra App documentation MS Learn

4) Launch both the frontend and the backend in dev mode

pnpm run dev

This will launch the frontend on http://localhost:8082/front/

It is the best way to run to ensure that the frontend and the backend are working correctly But it is the worst way to run the project in production

5) Build all apps and serve them

a) Option 1 ( frontend and backend | preffered option )

pnpm run build:serve
pnpm run serve

This will build the frontend and the backend, then serve them using the ports 3000 for the frontend and 8000 for the backend.

b) Option 2 ( frontend, backend and host | !warning experimental and might not work! )

pnpm run build
pnpm run start

This will build the frontend, backend and host, then serve them using the port 3035 for the host.

6) You should be set up to go

  • Just head over to your browser and use the following URL to access the frontend if you used serve : http://localhost:3000
  • Or use the following URL to access the host if you used start : http://localhost:3035

If it's does not work, search for the output of the pnpm run serve or pnpm run start command.

tp-vm-maker-azure's People

Watchers

Mathieu Morgat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.