A Bun-based event notification system with web push capabilities.
- Event management (CRUD)
- Scheduled notifications
- Web push notifications
- User authentication
- PostgreSQL database with Prisma ORM
- Queue system for reliable notification delivery
- Recurring events support
The system requires two containers to function properly:
- API Server - Handles HTTP requests and API endpoints
- Worker - Processes background tasks (scheduled notifications, recurring events)
Run both containers with these commands:
# Start the API server
docker run -d \
--name signal-api \
--env-file .env \
--network host \
--restart unless-stopped \
ghcr.io/xg4/signal:latest run start
# Start the background worker
docker run -d \
--name signal-worker \
--env-file .env \
--network host \
--restart unless-stopped \
ghcr.io/xg4/signal:latest run start:worker
- Runtime: Bun
- Backend Framework: Hono.js
- Database: PostgreSQL + Prisma ORM
- Authentication: JWT
- Queue System: BullMQ + Redis
- Notifications: web-push
- Language: TypeScript
- Bun 1.x
- PostgreSQL
- Redis
-
Clone the repository:
git clone https://github.com/xg4/signal.git cd signal
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.template .env
Edit the
.env
file with your configuration. -
Generate VAPID keys for web push:
npx web-push generate-vapid-keys
Add the generated keys to your
.env
file. -
Set up the database:
npm run generate # Generate migration files npm run migrate # Apply migrations
Start the development server:
npm run dev
Build the project:
npm run build
Start the production server:
npm start
Build the Docker image:
docker build -t signal-app .
POST /api/register
- Register a new userPOST /api/login
- Login a userGET /api/me
- userRequired - Get current user info
GET /api/events
- Get all events for current userGET /api/events/:id
- Get a specific eventPOST /api/events
- Create a new eventPUT /api/events/:id
- Update an eventDELETE /api/events/:id
- Delete an eventPOST /api/events/batch
- Batch import events
POST /api/subscriptions
- Create a new subscriptionDELETE /api/subscriptions/:id
- Delete a subscription by IDGET /api/subscriptions
- Get all subscriptions for current user
You can test web push notifications using tools like:
MIT