Local Setup
1. Clone the Repository
Section titled “1. Clone the Repository”git clone git@github.com:Monsoft-Solutions/loquent-app.gitcd loquent-app2. Configure Environment
Section titled “2. Configure Environment”Loquent uses two separate env files:
| File | Purpose | When read |
|---|---|---|
.env | Runtime config (database URL, host) | Every app start |
seed.env | API keys and credentials for initial DB seed | Once, during first migration |
cp .env.example .envcp seed.env.example seed.env.env — Runtime
Section titled “.env — Runtime”APP_HOST=localhost:8080DATABASE_URL=postgres://user:password@localhost:5432/loquent| Variable | Description |
|---|---|
APP_HOST | Bind address for the Axum server |
DATABASE_URL | PostgreSQL connection string |
seed.env — Migration Seed
Section titled “seed.env — Migration Seed”Fill in all fields. The migration will abort if any value is empty.
TWILIO_MAIN_SID=your_twilio_account_sidTWILIO_MAIN_TOKEN=your_twilio_auth_tokenOPENAI_API_KEY=your_openai_api_keyRESEND_API_KEY=your_resend_api_keyEMAIL_DOMAIN=your-domain.comEMAIL_USER_ADMIN=adminGOOGLE_PROJECT_ID=your-gcp-projectGOOGLE_CLIENT_EMAIL=your-service-account@project.iam.gserviceaccount.comGOOGLE_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.
3. Create the Database
Section titled “3. Create the Database”The migration tool connects to an existing database — it won’t create one for you.
createdb loquentOr via Docker:
docker run -d --name loquent-db \ -e POSTGRES_DB=loquent \ -e POSTGRES_USER=user \ -e POSTGRES_PASSWORD=password \ -p 5432:5432 postgres:164. Run Migrations
Section titled “4. Run Migrations”Creates all tables (51 migrations) and seeds the core_conf table from seed.env:
just migrateThis runs sea-orm-cli migrate up. Key tables created:
| Table | Purpose |
|---|---|
user, session, member | Auth and identity |
organization | Multi-tenant orgs with Twilio credentials |
agent, agent_knowledge | AI agents and knowledge base links |
phone_number | Twilio numbers assigned to agents |
call, contact | Call records and caller contacts |
analyzer, system_analyzer | Post-call analysis config |
knowledge, knowledge_document | Knowledge bases for agent tools |
todo, todo_type | AI-extracted to-do items |
core_conf | Runtime configuration (API keys, provider settings) |
report_email_address | Email report recipients |
5. Generate Entities
Section titled “5. Generate Entities”SeaORM entity files are gitignored — they must be generated locally from the database schema:
just generateThis runs:
sea-orm-cli generate entity -o src/bases/db/schemas --with-serde both6. Start the Dev Server
Section titled “6. Start the Dev Server”just devThis 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.
Quick Reference
Section titled “Quick Reference”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 clippyjust fmt # Format codejust migrate # Run pending database migrationsjust generate # Regenerate SeaORM entities from DB schemaConfiguration at Runtime
Section titled “Configuration at Runtime”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"