An open-source repository of Arabic poetry containing over 944,000 verses from 932 poets spanning 10 historical eras, with database dumps, REST API, and web interface.
This is a monorepo containing:
apps/web: Next.js frontend (Cloudflare Pages)apps/api: Hono REST API (Cloudflare Workers)apps/bot: Twitter bot that posts poemspackages/schemas: Shared Zod schemas and validationpackages/tsconfig: Shared TypeScript configuration
Tech Stack: Next.js, Hono, PostgreSQL, Drizzle ORM
Current Statistics:
- 944,844 verses
- 85,342 poems
- 932 poets
- 10 eras
- 44 meters
- 47 rhyme patterns
- 27 themes
Database dumps are available in public/datasets and are updated automatically. These are provided for research and integration purposes as an alternative to scraping the API.
Requirements:
- Node.js 18 or higher
- pnpm 8 or higher
- Docker
Installation:
git clone https://github.com/alwalxed/qafiyah.git
cd qafiyah
pnpm install
./scripts/setup-database.sh
pnpm devThe application will run at http://localhost:3000
Local database: ./scripts/setup-database.sh creates two PostgreSQL instances and writes .dev.vars (dev, port 5433) and .dev.vars.test (test/micro, port 5434, ~300 poems for fast build validation). Use pnpm dev for normal development; use pnpm dev:test then pnpm build:static for fast build validation. Production: set DATABASE_URL in .env.prod (manual).
The Qafiyah project acknowledges the following contributors, listed chronologically by date of contribution:
-
Khalid Alraddady, AI Engineer at HRSD
Contribution: Development of the semantic search feature currently under active development.
Links: LinkedIn -
Khalid Almulaify, PhD in Morphology and Syntax at IMSIU
Contribution: Ongoing financial sponsorship ($100/month) and extensive usage of the public API through a widely used Telegram bot.
Links: GitHub -
Malath Alsaif, Software Engineer at Ejari
Contribution: UI improvements and implementation of the local database development workflow.
Links: LinkedIn