https://github.com/cobanov/notification-relay
FastAPI server to receive and store notifications from mobile devices.
https://github.com/cobanov/notification-relay
fastapi notifications postgresql
Last synced: 5 months ago
JSON representation
FastAPI server to receive and store notifications from mobile devices.
- Host: GitHub
- URL: https://github.com/cobanov/notification-relay
- Owner: cobanov
- Created: 2025-12-12T11:28:06.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-02T09:02:39.000Z (6 months ago)
- Last Synced: 2026-01-05T01:22:32.611Z (6 months ago)
- Topics: fastapi, notifications, postgresql
- Language: Python
- Homepage:
- Size: 92.8 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Notification Relay
FastAPI server to receive and store notifications from mobile devices.
## Quick Start
```bash
docker-compose up -d
```
**Access:**
- API: `http://localhost:4141`
- Database: `localhost:4142`
## Configuration
Create `.env`:
```env
# Database
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_password
POSTGRES_DB=notifications
# API
API_KEY=your-secret-key
# Optional
DEBUG=false
LOG_LEVEL=INFO
```
## API Usage
**Create Notification**
```bash
curl -X POST http://localhost:4141/notifications \
-H "Content-Type: application/json" \
-H "X-API-Key: your-secret-key" \
-d '{
"app_name": "WhatsApp",
"title": "New Message",
"text": "Hello!"
}'
```
**Health Check**
```bash
curl http://localhost:4141/health
```
## Development
```bash
# Install
uv sync
# Run
uv run uvicorn app.main:app --reload --port 8000
# View logs
docker-compose logs -f api
```
## Features
- Async PostgreSQL with SQLAlchemy
- API key authentication
- Automatic JSON sanitization for mobile apps
- Structured logging
- Health checks
- Docker optimized with uv
## Stack
FastAPI · PostgreSQL · SQLAlchemy · Docker · uv