No description
Find a file
2026-12-06 00:17:31 +05:45
app Fix swipe gestures, edit form hydration, record mutations and UI layout 2026-12-06 00:07:36 +05:45
assets Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
plugins Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
src Fix swipe gestures, edit form hydration, record mutations and UI layout 2026-12-06 00:07:36 +05:45
.gitignore Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
.prettierignore Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
.prettierrc Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
app.json feat: DNS record CRUD + UI/UX improvements v1.2.0 2026-12-05 20:19:56 +05:45
babel.config.js Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
eas.json Fix eas.json appVersionSource for EAS build 2026-12-05 22:57:55 +05:45
eslint.config.js Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
jest.config.js Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
jest.setup.js Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
LICENSE Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
metro.config.js Initial commit: CF DNS Android app 2026-11-25 20:38:32 +05:45
package-lock.json Align Expo SDK 58 dependency versions for release build 2026-12-06 00:17:31 +05:45
package.json Align Expo SDK 58 dependency versions for release build 2026-12-06 00:17:31 +05:45
README.md feat: DNS record CRUD + UI/UX improvements v1.2.0 2026-12-05 20:19:56 +05:45
tsconfig.json Fix swipe gestures, edit form hydration, record mutations and UI layout 2026-12-06 00:07:36 +05:45

CF DNS

A fast, production-oriented Android app for managing Cloudflare DNS zones and records. Built with Expo, React Native and TypeScript.

Credentials are stored only in the device's encrypted secure store (Android Keystore), never in AsyncStorage, never logged, and never sent anywhere except https://api.cloudflare.com/client/v4.

Features

  • API Token (recommended) or Global API Key login, verified against Cloudflare before saving
  • Secure, Keystore-backed credential storage with optional biometric/device-lock gate
  • Zone list with local search, status chips, plan names, pull-to-refresh and skeleton loading
  • DNS record list with type filters, name/content search, pull-to-refresh and skeleton loading
  • Create, edit, and delete DNS records (A, AAAA, CNAME, TXT, MX, NS, SOA)
  • Animated orange-cloud proxy switch for A, AAAA and CNAME records with optimistic updates, haptics, rollback and a one-time safety notice
  • System/light/dark themes, edge-to-edge layout, Material 3 styling, TalkBack labels and 48dp touch targets
  • Cached data and an offline banner when the network is unavailable
  • Retry/backoff handling for 429 responses and clear inline errors for invalid credentials

Requirements

  • Node.js 20 LTS or newer
  • npm 10+
  • JDK 17 (for Android builds)
  • Android Studio with an emulator, or a physical Android device with USB debugging
  • An Expo account for EAS Build (only needed for cloud builds)

Setup

git clone <your-repo-url> cf-dns
cd cf-dns
npm install

Optional: change the application id from com.yourname.cfdns to your own id in app.json, and replace the placeholder artwork in assets/ with your own icon and splash images.

Create a Cloudflare API Token

  1. Open https://dash.cloudflare.com/profile/api-tokens.
  2. Click Create Token.
  3. Use the Edit zone DNS template, or create a custom token with:
    • Zone → DNS → Edit
    • Zone → Zone → Read (needed to list zones)
    • Zone Resources: Include → All zones (or restrict to specific zones)
  4. Click Continue to summary, then Create Token, and copy the value.
  5. Paste it into the app's API Token field.

API Tokens are preferred: a Global API Key grants full access to your entire Cloudflare account. If you must use one, find it under My Profile → API Tokens → Global API Key and treat it like a password.

Run on Android

Start the dev server:

npm start

Then either:

  • Install Expo Go on the device/emulator and scan the QR code, or
  • Run a native build directly (recommended for biometric and secure-storage features):
npx expo run:android

Or build and launch a native Android app directly:

npm run android

For a development client build via EAS:

npm install -g eas-cli
eas login
eas build --platform android --profile development

Build an APK or AAB with EAS Build

npm install -g eas-cli
eas login
eas build --configure   # optional: link/initialize the EAS project

Build a signed, installable APK for internal testing:

npm run build:apk

Build a production Android App Bundle for upload to Google Play:

npm run build:aab

Profiles are defined in eas.json. The first build asks you to generate an Android keystore; keep its backup safe — EAS cannot recover it.

Local native project (optional):

npm run prebuild
cd android && ./gradlew assembleRelease

Quality checks

npm run typecheck
npm run lint
npm run format:check
npm test

Project structure

app/            Expo Router screens: login, zones, zone records, settings
src/api/        Typed Cloudflare client, pagination, zones/DNS endpoints, query client
src/auth/       Secure storage, authentication provider, auth hook
src/components/ Reusable Material 3 components and snackbar system
src/hooks/      Query and proxy-toggle hooks
src/theme/      Color roles, spacing, typography and theme provider
src/utils/      Error, record-name and TTL formatting helpers
plugins/        Android config plugin that opts into the highest display refresh rate
assets/         Icon, adaptive icon, splash and favicon artwork

Security notes

  • Credentials use expo-secure-store with WHEN_UNLOCKED_THIS_DEVICE_ONLY; android:allowBackup is disabled.
  • The Cloudflare client is the only place that touches keys or tokens. Request headers are never logged.
  • All requests are made to a hard-coded HTTPS base URL.
  • Screenshot prevention is active on the Login screen via expo-screen-capture.
  • Biometric lock is optional and uses the device's own biometrics/passcode; there is no separate app password.

Known limitations

  1. Screenshot blocking is applied only while the Login screen is mounted; other screens intentionally allow screenshots so records can be shared.
  2. The native high-refresh-rate config plugin takes effect in prebuild/EAS builds. Expo Go may remain capped at 60Hz.
  3. Zone record counts appear only when Cloudflare includes meta.record_count in its zone response; some accounts/zones omit it.
  4. FlashList v2 measures rows automatically and no longer accepts estimatedItemSize; rows use stable keys, memoized components and consistent heights instead.
  5. iOS configuration is present but Android is the tested and supported target.
  6. Tests mock native modules; there are no on-device instrumentation tests in this repository.
  7. The bundled icon, adaptive icon and splash images are generated placeholder artwork.
  8. Global API Key mode has full account access; use an API Token whenever possible.

License

MIT © 2026 Sagar Bhusal. See LICENSE.