Developer Documentation
API-first. OpenAPI is truth. Every endpoint has curl / JS / TS / Python examples. Bilingual, modular, production-ready.
30 seconds from clone to first short link.
macOS & Oracle Linux 9 — Node 20+, pnpm, Sharp, Prisma.
Env, database, theme tokens, and feature flags.
DATABASE_URL, SESSION_SECRET, BASE_URL, REDIS_URL.
Docker, Coolify, standalone Next, Nginx + headers.
OpenAPI 3.1, SDK, pagination, idempotency.
Cookie + Bearer yas_live_, scopes, rotation.
Fuse.js global (⌘K), blog/tool/docs indexed.
Shorten → redirect → analytics pipeline.
MDX co-located, hero/cover/thumb, i18n EN/AR RTL.
app, components/ui, lib, prisma, blog, docs, public.
Add feature = add folder, never UI→DB.
Oracle Linux 9 checklist, TLS, backups.
Common errors, logs, health checks.
Pricing, limits, RPO, support SLA.
Oracle Linux 9 runbook: proxy, TLS, monitoring, backups, recovery.
Getting started, feature tour, tutorials, troubleshooting.
Getting Started
Clone, env, install, DB, dev — 30 seconds.
cp .env.example .env pnpm install --frozen-lockfile bash scripts/copy-blog-images.sh pnpm db:push && pnpm db:seed pnpm dev # http://localhost:3000 → /dashboard admin@yas.sh / Admin123!ChangeMe
Installation
pnpm -v # 9.12.3
openssl version # OpenSSL 3.x
dnf install openssl vips + nodesource.Configuration
All config via env + next.config.mjs + CSS vars.
app/globals.css :root --brand/--bg + components/theme-provider.tsx 7 palettes.next.config images.remotePatterns locked to yas.sh / unsplash / cdn. AVIF/WebP.Environment Variables
Never commit real secrets. .env.example is placeholder.
Deployment
Three options — local build, Docker, Coolify.
pnpm build && pnpm start # or docker compose up -d # or Coolify on Oracle Linux 9 — see docs/10_DEPLOYMENT.md
Standalone when BUILD_STANDALONE=true — copies minimal deps for Docker.
API Guide
Base /api/v1 • OpenAPI 3.1 at /api/v1/openapi • Errors application/problem+json.
Authentication
Cookie: yas_session httpOnly Secure SameSite Lax — for dashboard.
Bearer: Authorization: Bearer yas_live_… — for servers, auto hashed (SHA-256), lastUsedAt tracked.
Scopes: links:read,links:write,analytics:read. Rotate via /api/v1/api-keys show-once, 10 max.
Search
Global ⌘K opens Fuse.js index of pages/tools/blogs. Endpoint /api/search/index serves blog slugs.
Link Intelligence
Shorten (random base62 7 chars + alias) → 302 edge redirect (p95 38ms, Valkey cache) → ClickEvent (geo/device/referrer, bot filtered) → analytics rollup.
Blog System
See Blog Guide. Co-located blog/content/<slug>/index.mdx + hero.webp, auto SSG, sanitized marked, JSON-LD, i18n EN/AR RTL, sticky TOC, progress bar.
Project Structure
app/ Next.js (marketing, dashboard, blog/[slug], docs, api/v1, [code], status, case-studies) components/ui/ Card/Badge/Button/Input + blog-progress/theme-provider/search lib/ api-helpers, api-sdk (UI→REST), auth, prisma, utils, validators, tools-def blog/content/ MDX + hero/cover/thumb per post (EN + AR) prisma/ schema.prisma + seed.ts public/blog-img/ served images (copied via script) scripts/ smoke.sh, security-smoke.sh, copy-blog-images.sh (POSIX) docs/ markdown + BLOG_GUIDE.md
Development Workflow
- Add feature = add folder (
app/tools/[slug]+lib/tools-def) — no core edits. - UI never imports Prisma — only
lib/api-sdk.ts → REST /v1. - Theme via CSS vars — change 2 vars to rebrand.
- Blog via file system — no registry.
- Test:
pnpm build+bash scripts/smoke.sh+BASE= prod bash scripts/security-smoke.sh.
Production Deployment (Oracle Linux 9)
sudo dnf install -y openssl vips # Node 20 via nodesource, pnpm 9.12.3 via corepack cp .env.example .env # edit pnpm install --frozen-lockfile pnpm db:push && pnpm db:seed bash scripts/copy-blog-images.sh pnpm build pnpm start # behind Nginx with CSP (next.config headers)
Nginx: proxy + HSTS, 4GB RAM recommended for build, 1GB runtime.
Troubleshooting
BUILD_STANDALONE=true pnpm build or 4GB instance.openssl version must be 3.x; prisma generate on postinstall./^[a-z0-9-]+$/, file index.mdx, run copy script.Operations — Oracle Linux 9
The production runbook: server setup, reverse proxy, TLS, monitoring, backups, logging, and recovery procedures.
User Guide
Getting started, the full feature tour, tutorials, FAQ, and troubleshooting for end users.
FAQ
50 links, 1k clicks/mo, 1 API key. Pro 5k/100k, Business 50k/1M.
≤15m with daily encrypted dumps (MariaDB).
Contact → <24h; Enterprise → 4h.
EN + AR RTL supported, dir auto, locale frontmatter.