Turn your GitHub stars into a searchable, conversational library. Sign in with GitHub, StarLib auto-syncs your starred repositories, indexes them with embeddings, and helps you choose the right open-source project — by semantic search or by asking a built-in AI agent. Installable PWA, bilingual (en/zh).
- GitHub sign-in (better-auth, OAuth App) with auto-sync of your stars.
- Semantic search over your library (Postgres + pgvector) with language / topic / star filters.
- Selection advisor agent (AI SDK) that answers only from your library, cites repos, and compares them on real metadata.
- Mobile PWA: installable, offline-aware, navy-ink design system.
Next.js 15 (App Router) · TypeScript · Tailwind v4 · coss UI · better-auth ·
Drizzle ORM · Postgres + pgvector · AI SDK v5 + OpenAI · next-intl · Serwist ·
pnpm. Frontend follows Feature-Sliced Design; the backend follows Domain-Driven
Design. See docs/ — the single source of truth.
pnpm install
make db-up # Postgres + pgvector via Docker
make db-migrate # apply migrations
cp .env.example .env.local # fill in the values (see below)
make dev # http://localhost:3000make check runs lint, typecheck, tests, and the production build.
Copy .env.example to .env.local and set:
| Variable | Notes |
|---|---|
DATABASE_URL |
Postgres URL (matches the dev compose by default) |
BETTER_AUTH_SECRET |
openssl rand -base64 32 |
BETTER_AUTH_URL |
Public origin, e.g. http://localhost:3000 |
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET |
GitHub OAuth App |
OPENAI_API_KEY |
Chat + embeddings |
OPENAI_BASE_URL |
Optional OpenAI-compatible gateway |
OPENAI_CHAT_MODEL |
Default gpt-4o-mini |
OPENAI_EMBEDDING_MODEL |
Default text-embedding-3-small |
CRON_SECRET |
Protects /api/cron/sync |
- Go to https://github.com/settings/developers → OAuth Apps → New OAuth App (an OAuth App, not a GitHub App — OAuth App tokens don't expire).
- Set Authorization callback URL to
{BETTER_AUTH_URL}/api/auth/callback/github(e.g.http://localhost:3000/api/auth/callback/github). - Copy the Client ID and generate a Client Secret into your env.
Reading your public stars needs no extra scope. If your GitHub primary email is private, verify sign-in works with a private-email account.
Platform-agnostic (no Vercel-only APIs):
- Vercel + Neon/Supabase: point
DATABASE_URLat the pooled connection string; copydeploy/vercel.json.exampletovercel.jsonfor the cron schedule and function durations. - Self-hosted Docker:
docker compose -f deploy/docker-compose.yml up --build(app inoutput: "standalone"+ pgvector). Runpnpm drizzle-kit migrateagainst the database on first deploy.
Star sync runs as time-boxed slices driven by client polling, so it fits serverless timeouts and long-lived containers alike (ADR-0005).
docs/project— overview, goals, architecturedocs/frontend— Feature-Sliced Design conventionsdocs/backend— Domain-Driven Design conventionsdocs/operations— local dev, env, deploymentdocs/quality— testing strategydocs/decisions— ADRs