A complete push notification system with React Native mobile app, web dashboard, and Express backend using Firebase, AWS SNS, and Docker containerization.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Mobile App │◄──►│ Express API │◄──►│ Web Dashboard │
│ (React Native) │ │ + AWS SNS │ │ (React) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Firebase │ │ PostgreSQL │
│ Messaging │ │ Database │
└─────────────────┘ └─────────────────┘
- Push notification reception with Firebase Cloud Messaging
- Device registration and token management
- Notification history and management
- Clean tab-based navigation
- Settings for notification preferences
- Admin interface for sending push notifications
- Device management and registration overview
- Notification history and analytics
- Real-time device status monitoring
- AWS SNS integration for notification delivery
- Device registration and token management
- RESTful API with proper error handling
- PostgreSQL database for persistent storage
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Firebase project with FCM enabled
- AWS account with SNS access
- Expo CLI (for mobile development)
- Create a Firebase project at Firebase Console
- Enable Cloud Messaging
- Download
google-services.json(Android) andGoogleService-Info.plist(iOS) - Get your Firebase configuration object
- Create an AWS account and set up SNS
- Create an IAM user with SNS permissions
- Get your AWS Access Key ID and Secret Access Key
Create the following environment files:
EXPO_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
EXPO_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
EXPO_PUBLIC_FIREBASE_APP_ID=your_app_id
EXPO_PUBLIC_API_URL=http://localhost:3001
NODE_ENV=development
PORT=3001
DATABASE_URL=postgresql://user:password@postgres:5432/pushnotify
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_PRIVATE_KEY=your_firebase_private_key
FIREBASE_CLIENT_EMAIL=your_firebase_client_email
REACT_APP_API_URL=http://localhost:3001
- Clone the repository
- Copy environment files and fill in your credentials
- Run the entire system:
docker-compose up --buildThis will start:
- PostgreSQL database on port 5432
- Express backend on port 3001
- Web dashboard on port 3000
- Mobile app development server on port 8081
cd backend
npm install
npm run devcd web
npm install
npm startnpm install
npm run devPOST /api/devices/register
Body: {
"deviceId": "unique_device_id",
"pushToken": "firebase_token",
"platform": "ios|android",
"deviceName": "User's Device"
}
POST /api/notifications/send
Body: {
"deviceIds": ["device_id_1", "device_id_2"],
"title": "Notification Title",
"body": "Notification message",
"data": { "custom": "data" }
}
GET /api/devices
Response: [
{
"id": "device_id",
"deviceName": "Device Name",
"platform": "ios",
"lastSeen": "2025-01-11T10:00:00Z",
"isActive": true
}
]
cd backend
npm testnpm testcd web
npm test-
Build for production:
expo build:android expo build:ios
-
Submit to app stores:
expo submit:android expo submit:ios
-
Build Docker images:
docker-compose -f docker-compose.prod.yml build
-
Deploy to your preferred cloud provider
See the PlantUML diagrams in the /docs directory:
registration-flow.puml- Device registration processnotification-flow.puml- Push notification delivery flowsystem-architecture.puml- Overall system architecture
-
Push notifications not received
- Verify Firebase configuration
- Check device token registration
- Ensure AWS SNS permissions are correct
-
Docker build fails
- Ensure all environment files are present
- Check Docker daemon is running
- Verify port availability
-
Mobile app not connecting to backend
- Check API URL in mobile environment
- Verify backend is running on correct port
- Check network connectivity
# Check container logs
docker-compose logs backend
docker-compose logs web
docker-compose logs postgres
# Test API endpoints
curl -X GET http://localhost:3001/api/health
curl -X GET http://localhost:3001/api/devices
# Database access
docker-compose exec postgres psql -U user -d pushnotify- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Private - All rights reserved