Skip to content

πŸ‘¨β€πŸ’» Local Environment ​

IMPORTANT

Your local ${USER} variable is important to us. It helps us create separated local environments while still allowing you to use cloud infrastrure without conflicts. You will notice a number of things are created with your ${USER} name.

Try to keep it constant through your adventure at Tellia

Prerequisites ​

  1. Install git
bash
brew install git

Backend ​

Prerequisites ​

  1. Clone the repository
bash
git clone https://github.com/tell-ia/tell-ia-solutions
  1. Install packages. Run the setup script to prepare your local development environment:

    CAUTION

    Only MacOS supported

    bash
    cd tell-ia-solutions
    ./dev/scripts/setup.sh
    Or install manually these packages
  2. Install dependencies
bash
pnpm install
  1. Authenticate Docker with GCP Artifact Registry (required for running tests)
bash
gcloud auth login
gcloud auth configure-docker europe-docker.pkg.dev

.env ​

Setup your local env file from 1password desktop application.

  1. Open settings

    alt text

  2. Set Show 1Password Developer experience

    alt text

  3. In Developer Click View Environment

    alt text

  4. Select backend-local

    alt text

  5. Click Configure destination

    alt text

  6. Check file is present
bash
ls /Users/${USER}/Documents/Git/tellai/tell-ia-solutions/.env
# /Users/acouty/Documents/Git/tellai/tell-ia-solutions/.env

Starting Services ​

Start the local development environment. This will deploy a stack of several services used by the teal for testing, debugging and so on.

bash
# Starts docker containers in the background
docker-compose up -d

Connecting to MongoDB ​

Use MongoDB Compass with the following connection string:

mongodb://user:pass@localhost:27017/?authSource=admin&directConnection=true

Local database seed ​

WARNING

This will copy the production database to your local environment!

Create or refresh your development database:

bash
# Standard, will only download once
./dev/scripts/create-user-db.sh

# Force re-sync with production
./dev/scripts/create-user-db.sh --dump

Start the backend ​

Your favorite IDE must be base on vscode.

  1. Run the πŸƒ Backend debugging configuration.
  2. Validate start
bash
curl http://localhost:3888
# Hello World%

Alternatively you can you the command line:

bash
pnpm --filter agri-backend dev

Frontend ​

Prerequisites ​

  1. Clone the repository
bash
git clone https://github.com/tell-ia/tell-ia-solutions
  1. Install dependencies
bash
pnpm install

Setup .env ​

CAUTION

It seems the dev setup does not allow env variables to be loaded correctly from 1password mounted file.
Use 1password to edit & sync dev .env, but keep it disabled for now

  1. Set .envfile Follow previouw steps with 1password to setup fyour .envfile.
  2. After set up, copy the .envfile
  3. Disable 1password sync
  4. Re-create the .env with the previously copied content

Start the frontent ​

Your favorite IDE must be base on vscode.

  1. Run the πŸƒ Backend debugging configuration.
  2. Validate start
bash
curl http://localhost:3888
# Hello World%

Alternatively, run

bash
pnpm --filter agri-frontend dev

Troubleshooting ​

  • Ensure all required environment variables are set
  • Check Docker is running
  • Verify network ports are not conflicted

Next steps ​