How to setup the local Enviroment
- 1 Local Setup Mac M1
- 1.1 Install brew
- 1.2 Github SSH Setup
- 1.3 Docker Setup
- 1.4 Install Visual Studio Code
- 1.5 Clone the monorepo
- 1.6 Get the EnvFiles
- 1.7 Setup your local environment
- 1.8 Run the full local setup like this
- 1.9 Login to the UI
- 1.10 The FinanceGPT repository install (Optional)
- 1.11 TablePlus Setup (Optional)
- 1.12 Build your first Application (Optional):
- 1.13 Deploy hosted Modules (Optional):
Local Setup Mac M1
ℹ️ This setup was done on a 13” MacBook Pro with an M1 and 32Gb of RAM and this works pretty well for now!
Install brew
execute the following commands:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
follow the instructions.
Github SSH Setup
✅ Recommendation: Create a Github account using your professional email
Step 1: Create the SSH key pair values
Create an SSH Key pair (private / public) using the following command ( ⚠️ replace the name@example.com
with your own email.
ssh-keygen -t ed25519 -C "name@domain.com"
Make sure to add a passphrase to the SSH key and add it to your keychain. (
Step 2: Copy the public key value and add it to your Github account
Use the following command to copy the content of the
ed25519.pub
file on the clipboard:
pbcopy < ~/.ssh/id_ed25519.pub
Then, in Github, click on your profile picture (top right corner) > Settings > SSH and GPG Keys tab or simply use the following link: https://github.com/settings/keys
Create a “New SSH key”, give it any title that makes sense (e.g. Local Dev), and then paste the public key in the key field and leave the Key type set to
Authentication Key
then press “Add SSH Key”.
Step 3: Local configuration
Now open the
config
file in the.ssh
folder, you can use the commandopen ~/.ssh/config
to open it in an editor orvim ~/.ssh/config
if you want to edit within your terminal, then add the following lines (if not already done):
Run the following line:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Finally, run the following command:
Docker Setup
Install Docker
Install docker using the following link: Mac and make sure to use the right architecture (Apple Silicon or Intel chips). You can check it out by clicking on the Apple menu at the top left corner and then selecting “About This Mac”:
Install Visual Studio Code
Download Visual Studio Code from the following link: https://code.visualstudio.com/Download
Then run the following command to add the code
command on PATH:
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin”
Clone the monorepo
Execute the following command to clone the monorepo into the folder that you want:
Get the EnvFiles
From one of the Developers you need to get the EnvFile.zip this can be produced by the developer like this:
The file that is produced must be copied into your root folder of monorepo
envFiles.zip
Setup your local environment
Go into your VS code and open the monorepo folder that you checked out.
Execute the following command in the monorepo root:
then close the shell and open a new one.:
Execute the following command:
you see the following when you execute the where commands
close the shell and open a new one
Execute the following command in the monorepo root:
the last thing you should see is how the env variables were copied.
execute the following command then:
Run the full local setup like this
now it should start and all here:
there should now not be any errors in these consoles, make sure you click through all of the windows below.
Login to the UI
Now everything should be set up and you can log in to the application. Navigate to http://localhost:3004/chat
and log in with the developer user (already created in Zitadel):
Username:
root@unique-iam.localhost
Password:
RootPassword1!
You should be able to log in and use the Unique FinanceGPT chat solution.
The same user can be used to log in to Zitadel using http://localhost:9123
.
The FinanceGPT repository install (Optional)
Run the following command sequentially to install the financegpt-modules repository
Once everything is all up and running, you can start the flask app from the financegpt-modules using this command: poetry run flask run --port 5001--debug
TablePlus Setup (Optional)
Add the following database in Tableplus:
unique-ingestion-development
unique-chat-dev
unique-scope-management
unique-app-repository
To add a database, do the following steps:
Create a new connection and select Postgres
Fill in the following fields, they are all the same except for the Name and Database fields
Build your first Application (Optional):
you can now build your first app using this tutorial:
How to build my first module With SDK and Webhooks
But you can use local webhooks since you run it all locally.
Deploy hosted Modules (Optional):
Here is a tutorial for that: Deployment of Hosted SDK Module
Postman Setup
Install the Postman app using the following command:
brew install --cask postman
In the Postman app, click on “Create account” and sign in once done.
Once connected, create a Unique workspace and then import the following files) (2 collections and 1 environment):
Example Environment.postman_environment.json
assistants & modules.postman_collection.json
app-repository.postman_collection.json
Author | @Andreas Hauri |
---|
© 2024 Unique AG. All rights reserved. Privacy Policy – Terms of Service