Skip to content
thangvv-techPublic

About

Real-time GPS tracking platform. Intuitive interface, precise positioning, and seamless route management.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

FindMy — Self-Hosted Apple Find My

Track your ESP32 / nRF52840 devices on a private, self-hosted dashboard powered by Apple's 2-billion-device Find My network. No Apple account. No Apple hardware. Full end-to-end encryption.


How it works

[ESP32 / nRF52840]  →  BLE (secp224r1 pubkey)  →  [Nearby iPhone]
        ↓
  ECDH + AES-128-GCM encrypt → upload to Apple servers (anonymously)
        ↓
  [Backend] polls Apple → decrypts with private key → stores location
        ↓
  [Frontend] MapLibre dashboard  ←  REST API
  1. Device broadcasts a rotating secp224r1 public key every 2 minutes. Deep-sleeps between pulses — no GPS, no SIM, no internet.
  2. Apple's network — any nearby iPhone — silently encrypts the BLE advertisement and uploads it. The iPhone learns nothing about what it scanned.
  3. Backend authenticates to Apple's Search Party API via find-my.js, decrypts each report with the private key, and persists locations in PostgreSQL.
  4. Frontend renders a live MapLibre map with Catmull-Rom path smoothing and inverse-variance location fusion.

Stack

Layer Tech
Firmware ESP-IDF 5.4 (ESP32, ESP32-C3) · NCS 2.7 / Zephyr 3.6 (nRF52840)
Crypto library libs/find-my.js — SRP auth, ECDH, AES-128-GCM, rolling keys
Backend NestJS · TypeORM · PostgreSQL · Valkey (BullMQ) · Fastify
Frontend Next.js 15 · React 19 · MapLibre GL · NextAuth.js v5 · Tailwind v4
Infra Docker Compose · Anisette-V3 server

Quick Start

Prerequisites

  • Docker + Docker Compose
  • An Apple ID (stored only on your server, never shared)

1. Clone

git clone https://github.com/thangvv-tech/find-my.git
cd find-my

2. Configure environment

cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env.local

Edit backend/.env:

JWT_SECRET=<64 random chars>
BACKEND_INTERNAL_SECRET=<64 random chars>
# Apple credentials are added via the dashboard after first run

Edit frontend/.env.local:

NEXTAUTH_SECRET=<64 random chars>
NEXTAUTH_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:5000

# At least one OAuth provider required
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
# or
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...

3. Run

make up
# or:
docker compose up -d --build

Open http://localhost:3000.

First run: the Anisette server generates a unique Machine ID on first Apple authentication. Do not delete the anisette_data volume or you will need to re-authenticate.


Project structure

find-my/
├── firmware/          # ESP32 (ESP-IDF) + nRF52840 (Zephyr) BLE advertiser
├── libs/find-my.js/   # Node.js Apple Find My crypto + API library
├── backend/           # NestJS REST API + sync pipeline
├── frontend/          # Next.js dashboard
└── docker-compose.yml # Full-stack deployment

firmware/

Dockerized build toolchain — no local ESP-IDF or NCS install needed.

cd firmware
./build.sh esp32c3          # build
./build.sh esp32c3 flash /dev/ttyUSB0   # build + flash

Supported boards: ESP32-C3 SuperMini, ESP32 DevKit, Nice!Nano v2 (nRF52840).
See firmware/README.md for full build and flash instructions.

libs/find-my.js/

Standalone TypeScript library for Apple's Search Party API. Handles SRP authentication, 2FA, ECDH + KDF + AES-128-GCM decryption, and rolling key support.
See libs/find-my.js/README.md.

backend/

NestJS service exposing:

  • /auth — OAuth + JWT session management
  • /devices — device + key CRUD
  • /location — location history, BullMQ sync jobs
  • /accounts — Apple account management (encrypted session storage)

See backend/README.md.

frontend/

Next.js 15 App Router dashboard:

  • MapLibre GL map with Catmull-Rom path smoothing
  • In-browser firmware flash (WebUSB / WebSerial via esptool.js + nrfdfu)
  • PWA-ready, dark mode, multi-user OAuth
  • Server-side auth with NextAuth.js v5

See frontend/README.md.


Supported hardware

Board SoC Flash method
ESP32-C3 SuperMini ESP32-C3 USB Serial (esptool)
ESP32 DevKit 38-pin ESP32 USB Serial (esptool)
Nice!Nano v2 nRF52840 UF2 Mass Storage

Security notes

  • Private keys never leave your server. Apple only receives encrypted reports.
  • Apple ID credentials are stored server-side in an encrypted session file. No plaintext password persisted after authentication.
  • All API endpoints are JWT-authenticated. Internal service calls use a shared BACKEND_INTERNAL_SECRET.

License

MIT — see LICENSE.

About

Real-time GPS tracking platform. Intuitive interface, precise positioning, and seamless route management.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages