Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support added while maintaining MacOS/Linux compatibility #50

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ node_modules

# Misc
.DS_Store
bin
bin/vault-web-server.exe
pkg
static/js
github.com
Expand Down
73 changes: 71 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ With The Vault, you can:
- go: v1.18.9 darwin/arm64
- poppler

## Setup
## MacOS/Linux Setup

### Install manual dependencies

1. Install go:

Follow the go docs [here](https://go.dev/doc/install)

2. Install node v19
2. Install node v19

I recommend [installing nvm and using it to install node v19](https://medium.com/@iam_vinojan/how-to-install-node-js-and-npm-using-node-version-manager-nvm-143165b16ce1)

Expand Down Expand Up @@ -74,6 +74,75 @@ When setting up your pinecone index, use a vector size of `1536` and keep all th

4. Visit the local version of the site at http://localhost:8100

## Windows Setup

### Install manual dependencies

1. Install go:

Follow the go docs [here](https://go.dev/doc/install)

2. Install node v19

I recommend [installing nvm and using it to install node v19](https://medium.com/@iam_vinojan/how-to-install-node-js-and-npm-using-node-version-manager-nvm-143165b16ce1)

3. Install poppler

via uer5305519 and Jeru Luke on [stack overflow](https://stackoverflow.com/questions/18381713/how-to-install-poppler-on-windows)

Go to [this page](https://blog.alivate.com.au/poppler-windows/) and download the binary of your choice. In this example we will download and use poppler-0.68.0_x86.

Extract the archive file poppler-0.68.0_x86.7z into C:\Program Files. Thus, the directory structure should look something like this:

C:
└ Program Files
└ poppler-0.68.0_x86
└ bin
└ include
└ lib
└ share

Add C:\Program Files\poppler-0.68.0_x86\bin to your system PATH by doing the following: Click on the Windows start button, search for Edit the system environment variables, click on Environment Variables..., under System variables, look for and double-click on PATH, click on New, then add C:\Users\Program Files\poppler-0.68.0_x86\bin, click OK.

### Set up your API keys and endpoints in System Variables

From the start menu, search for <b>Edit the system environment variables</b>, click on <b>Environment Variables...</b>, then on the lower half of the next dialogue under System Variables,
select <b>New...</b>. Create three new key value pairs:

1. OPENAI_API_KEY : [OpenAI API Key](https://platform.openai.com/docs/api-reference/authentication)
2. PINECONE_API_KEY : [Pinecone API key](https://docs.pinecone.io/docs/quickstart#2-get-and-verify-your-pinecone-api-key)
3. PINECONE_API_ENDPOINT : https://[Pinecone API endpoint](https://app.pinecone.io/organizations/)

<b>IF YOU DON'T PREPEND HTTPS:// TO YOUR ENDPOINT, IT WILL FAIL</b>

When setting up your pinecone index, use a vector size of `1536` and keep all the default settings the same.

### Running the development environment

1. Within the project folder, create an empty 'bin' folder.

<b> Use Git Bash for the following commands </b>

2. Install javascript package dependencies:

`npm install`

3. Run the golang webserver (default port `:8100`):

`npm start`

If you run into issues with this step such as Go reporting incompatibility with your Windows version, you can run the following command from the base of the project folder in bash:

`env GOOS=windows GOARCH=amd64 go build -o ./bin/vault-web-server.exe ./vault-web-server`

Based on your system specs, you may need to modify the [GOARCH](https://pkg.go.dev/cmd/go) variable

4. In another terminal window, run webpack to compile the js code and create a bundle.js file:

`npm run dev`

5. Visit the local version of the site at http://localhost:8100

## Screenshots:

In the example screenshots, I uploaded a couple of books by Plato and some letters by Alexander Hamilton, showcasing the ability of OP Vault to answer questions based on the uploaded content.
Expand Down
Loading