Install and configure the following dependencies on your machine to build Ocular.
- Git
- Node.js v18.x (LTS)
- npm version 9.x.x
- Docker (to run studio locally)
Ocular uses Turborepo.
To contribute code to Ocular, you must fork the Ocular repo.
-
Clone your GitHub forked repo:
git clone your-forked-repo-ocular-repo
-
Go to the Ocular directory:
cd ocular
- Install the dependencies in the root of the repo.
npm install # install dependencies
- Install the dependencies in the root of the repo.
npm install -g turbo # install dependencies
-
Build repo with turbo.
turbo build
-
Copy the example
env.dev.example
to.env.dev
cp env.dev.example packages/ocular/.env.dev
-
Navigate to Ocular Dir
cd packages/ocular/
-
Configure .env with app and plugin secrets of the apps and plugins you want to connect.
- Azure Keys are required since they allow Ocular to connect to an LLM Service
AZURE_OPEN_AI_KEY= AZURE_OPEN_AI_ENDPOINT= AZURE_OPEN_AI_EMBEDDER_DEPLOYMENT_NAME= AZURE_OPEN_AI_EMBEDDING_MODEL= AZURE_OPEN_AI_CHAT_DEPLOYMENT_NAME= AZURE_OPEN_AI_CHAT_MODEL=
- Additional ApiKeys for other apps are optionnal but needed if you intend to connect Ocular to other apps.
-
Run Postgress DB + Redis + QDrant in Docker
docker compose -f docker-compose.dev.yml up
- Start the backend.
npm run dev # start the backend
-
Navigate to Ocular UI in "packages/ocular-ui".
cd packages/ocular/
-
Install front end dependencies with the following command.
npm install --legacy-peer-deps # start all the applications
-
After that you can start the front end with the following.
npm run dev
Then visit the following sites:
Site | Directory | Scope name | Description | Local development server |
---|---|---|---|---|
useocular.com | /packages/ocular-ui |
front-end | Ocular UI | http://localhost:3001/create-account |
Follow these steps to get the web UI up and running for your Dockerized Postgres container.
Use the command below to start your Docker container:
docker compose -f docker-compose.dev.yml up
Visit the following URL in your web browser to access the web UI:
🌐 http://localhost:5050/login?next=/browser/
Use the following credentials to log in:
- Email: [email protected]
- Password: ocular
Get container ID for postgres
docker ps
Get container IP address using postgres_container_id
which something looks like 17x.xx.x.x
at the bottom of the response
docker inspect <postgres_container_id>
🚀 Click save ! You should now be able to access the PostgreSQL management interface and manage your databases directly from your browser! |
The monorepo components are under /packages
:
/packages/apps
: Connectors To DataSources for Knowledge Indexing (Asana, Notion, GitHub etc)/packages/ocular-ui
: UI Dashboard for Ocular./packages/ocular
: Backend for Ocular which Ingests Apps and Plugins./packages/plugins
: Plugin's That Allow Ocular to access services such as VectorDBS, LLMModels etc/packages/types
: Shared data types shared across Ocular Modules/packages/utils
: Shared Utils aross Ocular Modules
Installing a package with NPM workspaces requires you to add the -w
flag to tell NPM which workspace you want to install into. Do not install dependencies in their local folder, install them from the route using the -w
flag.
The format is: npm install <package name> -w=<workspace to install in>
.
For example:
npm install react -w ocular-ui
: installs into./packages/ocular-ui
npm install react -w ocular
: installs into./packages/ocular
After making any changes, open a pull request. Once you submit your pull request, the Ocular team will review it with you.
Once your PR has been merged, you will be proudly listed as an Ocular contributor.
We don't have a process for assigning issues to contributors yet.
If you get stuck somewhere or have any questions, join our Slack Workspace!