| app | ||
| assets | ||
| plugins | ||
| src | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| app.json | ||
| babel.config.js | ||
| eas.json | ||
| eslint.config.js | ||
| jest.config.js | ||
| jest.setup.js | ||
| LICENSE | ||
| metro.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
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
- Open https://dash.cloudflare.com/profile/api-tokens.
- Click Create Token.
- Use the Edit zone DNS template, or create a custom token with:
Zone→DNS→EditZone→Zone→Read(needed to list zones)- Zone Resources:
Include→All zones(or restrict to specific zones)
- Click Continue to summary, then Create Token, and copy the value.
- 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-storewithWHEN_UNLOCKED_THIS_DEVICE_ONLY;android:allowBackupis 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
- Screenshot blocking is applied only while the Login screen is mounted; other screens intentionally allow screenshots so records can be shared.
- The native high-refresh-rate config plugin takes effect in prebuild/EAS builds. Expo Go may remain capped at 60Hz.
- Zone record counts appear only when Cloudflare includes
meta.record_countin its zone response; some accounts/zones omit it. - FlashList v2 measures rows automatically and no longer accepts
estimatedItemSize; rows use stable keys, memoized components and consistent heights instead. - iOS configuration is present but Android is the tested and supported target.
- Tests mock native modules; there are no on-device instrumentation tests in this repository.
- The bundled icon, adaptive icon and splash images are generated placeholder artwork.
- Global API Key mode has full account access; use an API Token whenever possible.
License
MIT © 2026 Sagar Bhusal. See LICENSE.