Archipelago Alerts (formerly AP Tracker) is a tool for tracking Archipelago multiworld games. It consists of a Python backend service and a native Android application designed to send push notifications for key in-game events for players you choose to follow.
This project was built to solve a simple problem: wanting to know when important things happen in an Archipelago game without having to constantly watch a tracker website or be at your computer.
The app uses Discord for authentication. The backend service polls rooms you've added, and the Android app provides a clean interface for managing your tracked rooms, setting notification preferences, and viewing event history. When a significant event occurs, the backend sends a push notification via Firebase Cloud Messaging directly to your phone.
- Discord Authentication: Securely log in using your existing Discord account via OAuth 2.0.
- Room Management: Easily add, rename, and remove Archipelago rooms you want to track.
- Player Selection: Choose exactly which players in a room you want to receive notifications for.
- Per-Slot Preferences: Fine-tune your notifications for each specific player, overriding your global defaults.
- Real-time Push Notifications: Get notified for:
- Progression items being received.
- Useful items being received.
- New hints being revealed.
- Event History: View a filterable history of received items and revealed hints.
- Account Deletion: A built-in, self-service option to permanently delete your account and all associated data.
This project is a monorepo containing two main components:
-
Backend (Python)
- Flask & Gunicorn for the web server API.
- SQLAlchemy as the ORM.
- PostgreSQL (for production/UAT) & SQLite (for local dev).
- Alembic for handling database migrations.
- Firebase Admin SDK for sending push notifications.
-
Android App (Kotlin)
- Jetpack Compose for the declarative UI.
- Retrofit & OkHttp for consuming the backend API and handling auth.
- Jetpack Room for local database caching of rooms and history.
- AppAuth for handling the Discord OAuth 2.0 flow.
- EncryptedSharedPreferences for secure storage of auth tokens.
- Firebase Cloud Messaging (FCM) for receiving push notifications.
This project uses a hybrid database setup. The backend is designed to run with PostgreSQL in production and SQLite in local development.
-
Navigate to the Backend Directory
cd backend
-
Create a Virtual Environment (Recommended)
python -m venv venv source venv/bin/activate # On Windows use
venv\Scripts\activate -
Install Dependencies
pip install -r requirements.txt
-
Set up Firebase Admin
- In your Firebase project settings, generate a new private key for the Service Account.
- Download the resulting JSON file and save it as
service-account-key.jsonin thebackend/app/directory.
-
Set up the Database (Choose one)
-
Option A: Local Development (SQLite)
- No setup needed! The app is configured to automatically create and use an
ap_tracker.dbfile in the root directory if noDATABASE_URLis provided.
- No setup needed! The app is configured to automatically create and use an
-
Option B: Production (PostgreSQL)
- Install PostgreSQL on your server.
- Create a database and a user for your app (e.g.,
ap_tracker_db,ap_tracker_user). - Grant privileges:
GRANT ALL PRIVILEGES ON DATABASE ap_tracker_db TO ap_tracker_user;andGRANT ALL PRIVILEGES ON SCHEMA public TO ap_tracker_user;
-
-
Configure Environment Variables
- The backend is configured using environment variables, typically in a
.envfile. - Create a file at
backend/.envand add your database URL:
export DATABASE_URL='sqlite:///../ap_tracker.db'
export DATABASE_URL='postgresql://ap_tracker_user:your_password@localhost/ap_tracker_db'
- The backend is configured using environment variables, typically in a
-
Run Database Migrations
- Before the first run, you must build the database schema.
- From the project root (not the
backenddirectory), run:
source backend/.env
alembic upgrade head
-
Run the Server
source backend/.env
flask --app backend.run:app run --debug
-
Open in Android Studio
- Open Android Studio and select
Open, then navigate to and select theandroid/folder.
- Open Android Studio and select
-
Set up Firebase Services
- In your Firebase project, go to the Android app settings.
- Download the
google-services.jsonfile. - Place this file in the
android/app/directory.
-
Configure API & Secrets
- The app's secrets (like API keys) are not stored in version control. They are managed in a local
local.propertiesfile. - Create a new file at
android/app/local.properties. - Add the following keys. The
build.gradle.ktsfile is already configured to read them.
DEV_API_BASE_URL=http://192.168.1.100:5000/
DISCORD_CLIENT_ID=YOUR_DISCORD_CLIENT_ID
- The app's secrets (like API keys) are not stored in version control. They are managed in a local
-
Build and Run
- Select the
devDebugbuild variant in Android Studio. - Run the app on an emulator or a physical device connected to the same local network as your computer. The app will now connect to your local backend.
- Select the