Mika

Legaci — Your story, in motion.

This repository contains the Legaci web app (frontend + backend) — an interactive, privacy-first memory & persona system with a 3D disco-ball UI, RAG, and optional voice features.

Quick links (important files)

Summary of recent additions

Development setup (local)

  1. Install repository dependencies (root)
    • pnpm install
  2. Backend
    • Ensure env vars are set in backend/.env (see Environment variables below).
    • Generate Prisma client:
      • npx prisma generate –schema=backend/prisma/schema.prisma
    • Install worker/runtime deps (if you want to run workers):
      • pnpm -C backend add bullmq ioredis
    • Start the backend (Next.js App Router):
      • pnpm -C backend dev
  3. Frontend
    • pnpm -C frontend dev
  4. Workers
    • Embeddings worker:
      • pnpm -C backend add -D ts-node typescript
      • node -r ts-node/register ./backend/src/worker/embeddingsWorker.ts
    • Voice worker:
      • node -r ts-node/register ./backend/src/worker/voiceWorker.ts
    • In production run workers as separate processes with the same env.

Playwright E2E (local)

Environment variables Add a .env in backend/ (or place in your deployment env). Minimum variables for dev/testing:

Common dev commands

How ingest → embeddings works (quick)

  1. POST file (audio/text) to /api/sources/ingest (backend/src/app/api/sources/ingest/route.ts:1)
  2. The route transcribes (if audio) and saves an encrypted source.
  3. The route automatically enqueues an embeddings job (BullMQ). The embeddings worker creates embeddings and upserts them to Qdrant.
  4. Check job status: GET /api/embeddings/status/:jobId (backend/src/app/api/embeddings/status/[id]/route.ts:1).

Voice consent & cloning (summary)

Troubleshooting

Security & privacy reminders

Where to read code (important files)

If you want, I will:

Which should I do next?

Playwright CI & Provider-mocking guidance

This project includes Playwright E2E tests ([playwright.config.ts:1](playwright.config.ts:1) and [tests/e2e/voice-lifecycle.spec.ts:1](tests/e2e/voice-lifecycle.spec.ts:1)). Below are recommended CI and local strategies for running the tests reliably, including provider-mock options.

1) CI overview (GitHub Actions)

2) Mocking vs running the real provider

3) Local developer flow for E2E

4) Debugging CI failures

5) Files to inspect

If you want, I can also: