Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pingpong

Each user gets a unique URL. A request to that URL triggers a mobile push notification for them.

Structure

  • backend/ — Go HTTP API. Registers devices, issues unique ping URLs, and sends push notifications via Expo's push API.
  • backend/migrations/ — SQL schema, applied automatically by the Postgres container on first boot.
  • mobile/ — Expo / React Native app. Registers the device for push notifications and displays the user's unique URL.

Flow

  1. Mobile app requests notification permission and gets an Expo push token.
  2. App calls POST /api/register on the backend with that token, and receives back a unique URL (/ping/{token}).
  3. Any request to /ping/{token} looks up the associated device and sends it a push notification via Expo.

Running locally

With Docker (API + Postgres):

docker compose up --build    # API on :8080, Postgres on :5432

Without Docker — the backend falls back to an in-memory store when DATABASE_URL is unset:

cd backend && make run

Either way, start the mobile app separately:

cd mobile && npm install && npm start

Set EXPO_PUBLIC_API_BASE_URL in mobile/.env (see .env.example) to point the app at the backend, and EXPO_ACCESS_TOKEN in the backend environment for authenticated Expo push requests.

Note: push notifications require a physical device, so point EXPO_PUBLIC_API_BASE_URL at your machine's LAN IP rather than localhost.

About

get pinged on your phone

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages