About this project

Motiq is a self-hosted analytics SDK designed for iOS developers who want to understand user behavior without relying on third-party trackers like Google Analytics. The project consists of two components: a Swift SDK for iOS apps (requiring iOS 16+ and Swift 6) and a self-hosted server built on FastAPI with SQLite. Key capabilities include custom event naming and properties, offline event queuing so data is preserved when users are offline, automatic session tracking, and the ability to track multiple apps from the same developer through a single server instance. All collected data is anonymized, avoiding the need for intrusive privacy pop-ups. Installation involves adding the Swift package via SPM to an Xcode project and configuring the base URL and API secret. The server is set up by cloning the repository, creating a Python virtual environment, installing dependencies, and running the FastAPI application with uvicorn. Users are recommended to run the server behind a reverse proxy such as Caddy or nginx, ideally as a systemd service. Events are tracked with simple Swift calls like `Motiq.shared.track("button_tapped", properties: ["button": "sign_up"])`. Events queue locally and flush in configurable batches. The project roadmap includes a web dashboard for data analysis, migration from SQLite to PostgreSQL, and Docker container support.