惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Scott Helme
Scott Helme
N
Netflix TechBlog - Medium
AI
AI
Security Latest
Security Latest
GbyAI
GbyAI
P
Proofpoint News Feed
Y
Y Combinator Blog
A
Arctic Wolf
G
Google Developers Blog
U
Unit 42
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Vulnerabilities – Threatpost
Know Your Adversary
Know Your Adversary
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
C
Check Point Blog
B
Blog RSS Feed
The GitHub Blog
The GitHub Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 【当耐特】
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Cisco Blogs
云风的 BLOG
云风的 BLOG
NISL@THU
NISL@THU
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Microsoft Security Blog
Microsoft Security Blog
T
The Blog of Author Tim Ferriss
阮一峰的网络日志
阮一峰的网络日志
Latest news
Latest news
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
WordPress大学
WordPress大学
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
The Hacker News
The Hacker News
Simon Willison's Weblog
Simon Willison's Weblog
V
V2EX
Project Zero
Project Zero
博客园_首页

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I Built an AI Islamic Companion App. Here's What Actually Surprised Me
DevTECH · 2026-05-14 · via DEV Community

DevTECH

https://mytazki.com/

Building for a faith-based audience is the same as building for any other audience.
Just ship fast, iterate, repeat.
That's what I thought before I started MyTazki an AI-powered Islamic
companion PWA with Quran audio, Duas, prayer times, a Qibla compass, AI dhikr
sessions, and push notifications for Adhan. Six months and 35+ features later,
here are the technical decisions that genuinely surprised me for better

and worse.

1. Contract-First API Changed Everything (and I Almost Skipped It)

The most impactful DX decision in the project wasn't the AI stack or the database
choice. It was writing the OpenAPI spec first and generating everything from it.
Here's the flow:

lib/api-spec/openapi.yaml
↓ (pnpm --filter @workspace/api-spec run codegen)
lib/api-client-react/src/generated/api.ts ← React Query hooks
lib/api-zod/src/generated/api.ts ← Zod validators

Orval reads the spec and generates type-safe React Query hooks and Zod schemas
in one command. The server validates inputs with the generated Zod schemas. The
frontend calls the generated hooks. If the contract changes, a single codegen run
propagates it everywhere TypeScript screams at every inconsistency before a
single test runs.
Before this, I was hand-writing fetch() calls, manually keeping types in sync,
and debugging a mismatch between what the server sent and what the client expected.
After? I haven't written a raw fetch() on the frontend in four months.
The lesson: **the five hours you spend writing the OpenAPI spec saves you fifty

hours of type drift.**

2. I Used a Key-Value Store Instead of PostgreSQL — No Regrets

MyTazki runs on @replit/database, a simple key-value store. No schema migrations.
No SQL. No connection pooling. Just get, set, and list.
That sounds naive for a production app, but here's the reality: every entity that
would live in a relational table maps cleanly to a key pattern:

user:{userId} → profile object
streak:{userId} → { currentStreak, totalDays, lastCheckin }
push:{userId} → subscription object
aiUsage:{userId}:{date} → number (daily AI call count)
duas:{duaId} → dua object
sessions:{sessionId} → session object

The gotcha is the return type. db.get() returns OkResult | ErrResult — not the
value directly. Every single read needs:


typescript
const result = await db.get(`user:${userId}`);
const user = result.ok ? result.value : null;

Forget that check and you're silently working with an error object that looks truthy.
I forgot it exactly twice. Both times were memorable.

The real limitation is joins. When you need "all duas favorited by user X," you
either store an index (favs:{userId} → [duaId, duaId, ...]) or do a full scan.
For a prayer app at this scale, that trade-off is acceptable. For anything with
complex relational queries, it's a pain.

3. The iOS Safari Audio Hack No One Writes About
The Quran reader plays 114 surahs with per-ayah audio from everyayah.com. Each
ayah is a separate .mp3 file in the format SSSAAA.mp3 (surah + ayah, zero-padded).

On desktop Chrome: trivial. Create an Audio element, update src on each ayah,
call play(). Works perfectly.

On iOS Safari: the moment you update audio.src and call play(), Safari
treats it as a new user-initiated play event — and blocks it, because iOS requires
audio to be triggered directly by a user gesture. Autoplay restrictions apply to
every new src assignment.

The fix: one persistent Audio element, never replaced — only src swapped.

// Created once, at component mount  never recreated
const audioRef = useRef(new Audio());
function playAyah(surah: number, ayah: number) {
  const src = `https://everyayah.com/data/Alafasy_128kbps/
    ${String(surah).padStart(3,'0')}
    ${String(ayah).padStart(3,'0')}.mp3`;
  audioRef.current.src = src;
  void audioRef.current.play(); // Works — iOS sees this as continuation
}

The first play() call must happen inside a user gesture handler (a tap). After
that, swapping src and calling play() on the same element inherits that
gesture permission for the session. Destroying and recreating the Audio element
resets the permission.

This took me a day and a half to figure out. Saving you the half.

4. AI Rate Limiting in a KV Store  Simpler Than You Think
The AI companion routes through Anthropic's Claude. Without rate limiting, one
motivated user could burn through significant API credits in an afternoon. The
solution is 20 AI requests per user per day, tracked with a single KV key:

const dateKey = new Date().toISOString().split('T')[0]; // "2026-05-14"
const usageKey = `aiUsage:${userId}:${dateKey}`;
const result = await db.get(usageKey);
const count = result.ok ? Number(result.value) : 0;
if (count >= 20) {
  return res.status(429).json({ error: "Daily AI limit reached. Resets at midnight." });
}
await db.set(usageKey, count + 1);
// ... call Claude

Keys naturally expire with the date — no cron job needed to clean up. Today's key
is aiUsage:user123:2026-05-14. Tomorrow it's aiUsage:user123:2026-05-15. The
old key just sits there taking up negligible space until you decide to clean it.

5. Qibla Compass: Web APIs Are Wilder Than I Expected
The Qibla page shows a compass needle pointing toward Mecca. The math is
straightforward — a great-circle bearing from the user's coordinates to
(21.4225° N, 39.8262° E). The Web part is where it gets interesting.

The Web Magnetometer API (DeviceOrientationEvent + webkitCompassHeading on
iOS) gives you the device's heading relative to magnetic north. Android exposes
DeviceOrientationEvent.alpha (rotation around Z-axis). But:

iOS requires HTTPS and explicit permission (DeviceOrientationEvent.requestPermission())
only available in a user gesture handler.
Android Chrome exposes the API but many mid-range devices have poor magnetometer
calibration  the needle drifts.
Desktop browsers mostly return null for magnetometer data.
The fallback chain I settled on:

GPS bearing (always available) → show Qibla direction on map
+ Magnetometer (when available) → animate live compass needle
+ Calibration prompt when accuracy is low → "Wave your phone in a figure-8"

The figure-8 calibration prompt was the most-commented feature in user feedback.
Turns out most people have never calibrated their phone compass and find it
genuinely surprising that this is a thing.

6. Push Notification Scheduling Is a Scheduler Problem
Prayer times differ by location. Fajr in London in January is 7:14 AM. In Karachi
in June, it's 4:02 AM. You can't pre-schedule notifications — you have to compute
them fresh for each user, each day, from their stored coordinates.

The approach: a scheduler loop running every 60 seconds on the API server, checking
whether any prayer time falls within the next minute for any subscribed user:

setInterval(async () => {
  const subscribers = await getAllPushSubscribers(); // list prefix scan
  for (const { userId, subscription, preferences } of subscribers) {
    const user = await getUser(userId);
    const times = await getPrayerTimes(user.lat, user.lon);
    for (const prayer of PRAYERS) {
      if (!preferences[prayer]) continue;
      const prayerTime = times[prayer]; // e.g. "05:23"
      if (isWithinOneMinute(prayerTime)) {
        await sendPushNotification(subscription, {
          title: `${prayer} time`,
          body: `It's ${prayerTime} — time for ${prayer} prayer`,
        });
      }
    }
  }
}, 60_000);

The cold-start problem: if the server restarts at 5:22 and Fajr is at 5:23, the
first tick runs at 5:22:00 and sends the notification. If the restart takes more
than 60 seconds, you miss the window. For a prayer app, missing Fajr is bad UX.
The mitigation: start the interval with an immediate first tick (setImmediate +
setInterval), and log all misses for monitoring.

7. The Cultural UX Layer Is a Real Engineering Problem
Every technical decision in an Islamic app has a cultural dimension that isn't
obvious until you're building it.

Arabic RTL: React renders fine with dir="rtl", but flexbox reverses
direction in unintuitive ways. Every flex container near Arabic text needs explicit
direction management. I standardized on Amiri (font-family: "Amiri, serif") for
all Arabic text — it renders Quranic Arabic with correct diacritics and ligatures.
Using a generic serif font for Quranic text is visually wrong in a way that users
notice immediately.

Hijri calendar: The Hijri date doesn't map 1:1 to Gregorian — it's a lunar
calendar that shifts by ~11 days per year. I use aladhan.com for both prayer
times and Hijri date conversion. Trying to calculate this locally is a rabbit hole
I'm glad I didn't go down.

Tasbih counter: A simple counter with a haptic feedback tap. Sounds trivial.
The UX constraint: it must work with one hand while sitting in prayer. No accidental
resets. Every interaction must be deliberate. The reset button is hidden behind a
long-press, not a tap. Users asked for this explicitly.

Gender-neutral Duas: Some duas in classical Arabic are grammatically gendered.
For a library of 110+ duas, deciding which to include, how to present gender
variants, and whether to show transliteration by default required real product
thinking — not just copy-paste from an API.

What I'd Do Differently
Start with SSR or a static shell. The SPA approach means search crawlers that
don't execute JavaScript see an empty <div id="root">. I added a pre-render
trick (H1 inside #root that React replaces on mount) but proper SSR or
prerendering would have been cleaner from day one.

Use Postgres earlier. The KV store got me to v1 fast, but the index management
complexity starts compounding around feature #15. A lightweight Postgres setup
from the start would have been worth the initial overhead.

Design the push notification UX before the infrastructure. The scheduler was
fun to build. Designing the permission request flow — when to ask, what to say,
how to handle denial gracefully — took longer than the scheduler itself.

The Stack, For Reference
Frontend: React + Vite, TypeScript 5.9, Tailwind CSS, pnpm workspaces
Backend: Express 5, @replit/database (KV), JWT auth, bcryptjs
AI: Anthropic Claude via API proxy
Push: web-push, VAPID, 60s scheduler loop
API Design: OpenAPI spec → Orval → React Query hooks + Zod schemas
Build: esbuild (CJS bundle for the server)
MyTazki is live at mytazki.com — free, no credit card,
works on any device as a PWA. If you're building for underrepresented communities
or faith-based audiences, I'm happy to answer questions in the comments.

Enter fullscreen mode Exit fullscreen mode