Skip to content

Latest commit

 

History

History
211 lines (130 loc) · 5.27 KB

DEVELOPERS.md

File metadata and controls

211 lines (130 loc) · 5.27 KB

Developing Ocular

Install dependencies

Install and configure the following dependencies on your machine to build Ocular.

Local development

Ocular uses Turborepo.

Fork the repo

To contribute code to Ocular, you must fork the Ocular repo.

Clone the repo

  1. Clone your GitHub forked repo:

    git clone your-forked-repo-ocular-repo
    
  2. Go to the Ocular directory:

    cd ocular

Install dependencies

  1. Install the dependencies in the root of the repo.
   npm install # install dependencies
  1. Install the dependencies in the root of the repo.
   npm install -g turbo # install dependencies

Starting the Backend

  1. Build repo with turbo.

       turbo build
  2. Copy the example env.dev.example to .env.dev

       cp env.dev.example packages/ocular/.env.dev
  3. Navigate to Ocular Dir

       cd packages/ocular/
  4. 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.
  5. Run Postgress DB + Redis + QDrant in Docker

   docker compose -f docker-compose.dev.yml up
  1. Start the backend.
   npm run dev # start the backend

Start UI

  1. Navigate to Ocular UI in "packages/ocular-ui".

       cd packages/ocular/
  2. Install front end dependencies with the following command.

       npm install --legacy-peer-deps # start all the applications
  3. 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

Start Web UI for Docker Postgres Container 🐳

Follow these steps to get the web UI up and running for your Dockerized Postgres container.

1. Start the Docker Container

Use the command below to start your Docker container:

docker compose -f docker-compose.dev.yml up

2. Access the Web UI

Visit the following URL in your web browser to access the web UI:

🌐 http://localhost:5050/login?next=/browser/

Here's the login page you should see:

Login Page

3. Login Credentials

Use the following credentials to log in:

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>

4. Create a new server and connect to container

server connection

🚀 Click save ! You should now be able to access the PostgreSQL management interface and manage your databases directly from your browser! |

Shared components

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 packages

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

Running All Of Ocular in Docker (Check the Ocular ReadMe)


Create a pull request

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.

Issue assignment

We don't have a process for assigning issues to contributors yet.


Community channels

If you get stuck somewhere or have any questions, join our Slack Workspace!