- Install dependencies using
pnpm install - Copy
.env.exampleto.env - Configure all required environment variables:
SUPABASE_URL: Your Supabase project URLSUPABASE_KEY: Your Supabase anon/public keySUPABASE_DATA_ENDPOINT: API endpoint for data fetching (e.g.,/rest/v1/pills)PORT: Server port (default: 3000)REDIS_URL: Redis connection string (optional)
Run the project with pnpm start
Tests are located in testing/get_data.ts (renamed from get_pills.ts to get_data.ts).
To run the data fetching test:
pnpm run dev:getdataThis script fetches data from the configured SUPABASE_DATA_ENDPOINT and logs the result. It is useful for verifying your Supabase connection and data structure.
On success:
✅ Data retrieved successfully:
[
{
"id": 1,
"name": "Medicine Name",
"scheduled_time": "08:00:00+00",
"expoToken": "ExponentPushToken[...]"
},
...
]
On error:
❌ Error fetching data:
Status: 401
Data: { message: "JWT expired" }
The service includes a simple HTML status dashboard served at http://localhost:3000 (or configured PORT).
- Service Monitoring: Displays uptime, start time, and current status.
- Metrics: Shows total notifications sent and Redis memory usage.
- Activity Log: Lists recent events such as sent notifications, errors, and system messages.
- Header: Service title and status indicator.
- Stats Card: Key metrics including Uptime, Total Notifications Sent, Server Hostname, Storage Mode (Redis), and Memory Usage.
- Recent Activity Log: A table showing the timestamp and message for the last 50 events.
Ensure your .env file is properly configured.
SUPABASE_URL: Base URL of your Supabase project.SUPABASE_KEY: Service role or Anon key for authentication.SUPABASE_DATA_ENDPOINT: The specific endpoint to fetch notification data from.