This is the WebSVF repo which highlights the static webSVF github io for redirecting to the deployed WebSVF pages https://svf-tools.github.io/WebSVF/
Capstone Project for the WebSVF can be found within this Repo as a sub module learn more about submodules at https://git-scm.com/book/en/v2/Git-Tools-Submodules
For a quick introduction to the latest addition in WebSVF 4.0, the CodeGPT panel, please have a watch of this video: https://www.youtube.com/watch?v=Gf6vAyzOlJ0
The new feature allows users to communicate with OpenAI's GPT 3.5-Turbo engine, and attach any of their files present on the site!
Note, webSVF 5.0 uses svf-ex executable from previous webSVF to create graphs. The executable can only run in x86 architecture (not arm64). Installation should be completed on linux for best results.
Go to this website
https://dotnet.microsoft.com/en-us/download/dotnet/8.0
Download sdk for dotnet 8.0. Click on x64 for binaries if using x64 architecture. Click arm64 if running on M-series macbook. This should automatically download the binary as a tar file.
cd Downloads
Go into downloads and run the following commands. (These commands were taken from the download page)
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-8.0.402-linux-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
Run the 2 export commands every time you open up a new terminal session. You could also edit the your shell profile to permanently add the commands.
Install Node Version Manager (nvm) by running the following command
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
Install Node version 20 by running following command
nvm install 20
You can check the node version by running following command. It should say v20..
node -v
Go into frontend folder
cd frontend
Install node packages needed to run frontend by using the following command.
npm install
Run npm run dev
npm run dev
Backend is currently deployed using fly.io.
Frontend is currently deployed using Vercel.
If you want to change the API key for codeGPT or come across the error 'apiKey' does not exist.
Add the APIKey to a .env.sh file inside frontend folder and outside of src. Add the following to the env file.
VITE_OPENAI_API_KEY='YOUR_API_KEY'
To generate the API key, you will need to:
- create an account with OpenAI.
- After logging in, select 'API'.
- Click on the GPT icon in the top left corner to expand the sidebar
- Select API Keys. Here, you can generate a key and add it as the value to the apiKey variable.
END OF WEBSVF 5.0 INSTALLATION
Note: Installation should be completed on linux for best results.
sudo apt install nodejs@15
sudo apt-get install clang cmake gcc g++ doxygen graphviz zlib1g-dev unzip libtinfo5
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04
cd ClientApp \
sudo npm install -g @angular/cli
https://angular.io/guide/setup-local
git clone https://github.com/Re-Tails/CapstoneProject.git
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-3.1
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-3.1
https://docs.microsoft.com/en-au/dotnet/core/install/linux-ubuntu#2004-
You can download any version as long as it is 3.1 version of SDK.
https://dotnet.microsoft.com/en-us/download/dotnet/3.1
After downloading, go to downloads folder and run the following commands.
cd
cd Downloads
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.1.302-win-x64.exe -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
If you have downloaded manually, you will need to run these commands everytime the machine is restarted (or add these commands to appropriate source file to avoid copy and pasting this command when computer restarts)
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
cd ClientApp \
npm install \
npm run start //note: this will only run the Client App
Run the following command from the CapstoneProject repo folder:
dotnet run
Install the following dependencies if required
npm i svf-lib
This command is be required to retrieve the latest files within CapstoneProject or any other repo you add.
git submodule update --init
These instructions are adapted from official AWS documentation (sources listed below).
It is highly recommended you read through the sources in detail if you're unfamiliar with the AWS environment, especially with AWS EC2.
WebSVF AMI: ami-06787f758a0b88e83
If you do not have an AWS account, complete the following steps to create one.
To sign up for an AWS account
-
Follow the online instructions.
Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.
When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to an administrative user, and use only the root user to perform tasks that require root user access.
AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account.
Login to your AWS account through the AWS Management Console.
-
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
-
In the navigation pane, choose
Key Pairs
. -
Choose
Create key pair
. -
For
Name
, enter a descriptive name for the key pair. Amazon EC2 associates the public key with the name that you specify as the key name. -
For Key pair type, choose
RSA
-
For
Private key file format
, choose the format in which to save the private key. -
Choose
Create key pair
. -
The private key file is automatically downloaded by your browser. The base file name is the name you specified as the name of your key pair, and the file name extension is determined by the file format you chose. Save the private key file in a safe place.
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
-
From the EC2 console dashboard, in the
Launch instance
box, chooseLaunch instance
, and then chooseLaunch instance
from the options that appear. -
Under
Name and tags
, forName
, enter a descriptive name for your instance. -
Under
Application and OS Images (Amazon Machine Image)
, do the following:-
Choose Quick Start, and then choose Amazon Linux. This is the operating system (OS) for your instance.
-
From Amazon Machine Image (AMI), choose Browse more AMIs to browse the full AMI catalog.
-
Choose Community AMIs
-
Search for the AMI
ami-06787f758a0b88e83
-
Select it
-
-
Under Key pair (login), for Key pair name, choose the key pair that you created when getting set up.
-
Review a summary of your instance configuration in the
Summary
panel, and when you're ready, chooseLaunch instance
.
If this error occurs, there should be a libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb that can be installed by running the following command.
sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb
If this libssl file is not here, you can run the following commands
wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz
tar -xzvf openssl-1.1.1c.tar.gz
cd openssl-1.1.1c
./config
make
sudo make install (it puts it into /usr/local/lib so it doesn't mess with the rest of your system)
Then, run this command to map this command temporarily via LD_LIBRARY_PATH. You will need to run this command everytime the computer restarts.
export export LD_LIBRARY_PATH="/usr/local/lib"
Source for no usable libssl if there is no libssl file. dotnet/core#4749
If you want to change the API key for codeGPT or come across the error 'apiKey' does not exist.
Add the APIKey in environment.ts (clientApp->src/environments->environments.ts).
To generate the API key, you will need to:
- create an account with OpenAI.
- After logging in, select 'API'.
- Click on the GPT icon in the top left corner to expand the sidebar
- Select API Keys. Here, you can generate a key and add it as the value to the apiKey variable.
An alternative method can also be to use a dotenv file, you can find some documentation on this here. This will allow you to secure the API keys over public repositories. https://betterprogramming.pub/how-to-secure-angular-environment-variables-for-use-in-github-actions-39c07587d590
https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-instances.html
https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance-wizard.html