Skip to content

Local Setup

Terminal window
git clone git@github.com:Monsoft-Solutions/loquent-app.git
cd loquent-app

Loquent uses two separate env files:

FilePurposeWhen read
.envRuntime config (database URL, host)Every app start
seed.envAPI keys and credentials for initial DB seedOnce, during first migration
Terminal window
cp .env.example .env
cp seed.env.example seed.env
APP_HOST=localhost:8080
DATABASE_URL=postgres://user:password@localhost:5432/loquent
VariableDescription
APP_HOSTBind address for the Axum server
DATABASE_URLPostgreSQL connection string

Fill in all fields. The migration will abort if any value is empty.

TWILIO_MAIN_SID=your_twilio_account_sid
TWILIO_MAIN_TOKEN=your_twilio_auth_token
OPENAI_API_KEY=your_openai_api_key
RESEND_API_KEY=your_resend_api_key
EMAIL_DOMAIN=your-domain.com
EMAIL_USER_ADMIN=admin
GOOGLE_PROJECT_ID=your-gcp-project
GOOGLE_CLIENT_EMAIL=your-service-account@project.iam.gserviceaccount.com
GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"

After migration, these values live in the core_conf database table. seed.env is never read again at runtime.

The migration tool connects to an existing database — it won’t create one for you.

Terminal window
createdb loquent

Or via Docker:

Terminal window
docker run -d --name loquent-db \
-e POSTGRES_DB=loquent \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=password \
-p 5432:5432 postgres:16

Creates all tables (51 migrations) and seeds the core_conf table from seed.env:

Terminal window
just migrate

This runs sea-orm-cli migrate up. Key tables created:

TablePurpose
user, session, memberAuth and identity
organizationMulti-tenant orgs with Twilio credentials
agent, agent_knowledgeAI agents and knowledge base links
phone_numberTwilio numbers assigned to agents
call, contactCall records and caller contacts
analyzer, system_analyzerPost-call analysis config
knowledge, knowledge_documentKnowledge bases for agent tools
todo, todo_typeAI-extracted to-do items
core_confRuntime configuration (API keys, provider settings)
report_email_addressEmail report recipients

SeaORM entity files are gitignored — they must be generated locally from the database schema:

Terminal window
just generate

This runs:

Terminal window
sea-orm-cli generate entity -o src/bases/db/schemas --with-serde both
Terminal window
just dev

This runs dx serve, which compiles two targets simultaneously:

  • Server — native Rust binary (Axum)
  • Client — WASM binary (Dioxus)

First-run compilation takes several minutes. The app is available at http://localhost:8080 once both targets finish.

Terminal window
just dev # Start dev server with hot reload (dx serve)
just build # Production build (server + WASM)
just check # Fast type-check (native only)
just lint # Run clippy
just fmt # Format code
just migrate # Run pending database migrations
just generate # Regenerate SeaORM entities from DB schema

Once running, all API keys and provider settings are managed through the core_conf database table — not environment variables. The only env vars read at runtime are DATABASE_URL and APP_HOST.

Some defaults set by migrations:

  • realtime_provider"openai" (changeable via UI)
  • google_location"us-central1"
  • google_token_uri"https://oauth2.googleapis.com/token"