A minimal MVP system designed to help lyricists compose Cantonese lyrics by providing ultra-fast character/word retrieval based on mapped tone patterns.
- Tone-based search for Cantonese characters and words
- LLM-enhanced composition assistance with Google Gemini
- User feedback collection for learning
- Hexagonal architecture with DDD-lite principles
- CQRS-lite separation for read/write operations
- Deno v1.40+
- Docker and Docker Compose
- PostgreSQL (via Docker)
-
Clone the repository
-
Copy environment variables:
cp .env.example .env
-
Start the database:
docker compose up db -d
-
Generate Prisma client and run migrations (Deno-native):
deno run -A npm:prisma@latest generate deno run -A npm:prisma@latest migrate dev
-
Seed the database with sample data:
deno task db:populate
This will populate the database with sample character and vocabulary entries.
-
Start the development server:
deno task dev
The API will be available at http://localhost:3000.
Note on Prisma + Deno
- We generate a Deno-native Prisma Client using
provider = "prisma-client"andruntime = "deno"intoprisma/generated/. - Import it directly via
import { PrismaClient } from "./prisma/generated/client.ts". - Always run
deno run -A npm:prisma@latest generateafter schema changes to refresh the client. - For production/edge environments, you may switch DATABASE_URL to a
prisma://Accelerate URL if desired, but it is not required for local Postgres.
deno task dev- Start development server with hot reloaddeno task start- Start production serverdeno task lint- Lint codedeno task fmt- Format code
pnpm exec prisma generate- Generate Prisma clientpnpm exec prisma migrate dev- Run database migrationsdeno task db:populate- Seed database with sample datadeno task db:reset-seed- Reset and re-seed the database
deno task vector:ingest- Ingest data into ChromaDB via the Python script.
The project follows hexagonal architecture with:
- Domain Layer: Core business logic and entities
- Application Layer: Use cases and orchestration
- Infrastructure Layer: External concerns (database, HTTP, caching)
GET /- Welcome messageGET /health- Health checkPOST /search- Search characters/words by tone patternPOST /compose- Compose lyrical lines with LLM rankingPOST /feedback- Record user feedback
MIT