https://github.com/ghlps/ru-counter
Service implemented to count the users of the ru-menu service. The repository contains a simple Go program that fetches data from WhatsApp and updates the ru-menu repository
https://github.com/ghlps/ru-counter
github-repo golang sql-lite whatsapp worker
Last synced: 19 days ago
JSON representation
Service implemented to count the users of the ru-menu service. The repository contains a simple Go program that fetches data from WhatsApp and updates the ru-menu repository
- Host: GitHub
- URL: https://github.com/ghlps/ru-counter
- Owner: ghlps
- Created: 2025-10-15T18:10:08.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2026-01-11T17:29:01.000Z (5 months ago)
- Last Synced: 2026-03-22T00:50:15.183Z (2 months ago)
- Topics: github-repo, golang, sql-lite, whatsapp, worker
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RU Counter
Automated WhatsApp newsletter subscriber counter for the [ru-menu](https://github.com/guimox/ru-menu) project. This service automatically fetches subscriber counts from WhatsApp newsletters and updates GitHub repository statistics.
### Overview
RU Counter is a microservice that connects to WhatsApp Business API to retrieve real-time subscriber counts from university restaurant menu newsletters. It automatically updates the main repository description and README with current Daily Active User (DAU) statistics.
### Architecture
The project consists of two main components:
- **WhatsApp Client**: Connects to WhatsApp using the whatsmeow library to fetch newsletter subscriber data
- **GitHub Updater**: Updates repository metadata and README files with current subscriber statistics
### Project Structure
```
ru-counter/
├── cmd
│ └── main.go
├── db
│ └── session.db
├── docker-compose-prd.yml
├── Dockerfile
├── go.mod
├── go.sum
├── internal
│ ├── github
│ │ └── updater.go
│ └── whatsapp
│ └── client.go
└── README.md
```
### Integration with RU Menu
This counter service is part of the larger [ru-menu](https://github.com/guimox/ru-menu) ecosystem that provides daily university restaurant menus to students via WhatsApp. The counter ensures accurate tracking of user engagement and service reach across multiple campus locations.
### Cronjob
This service runs once every friday.
### Data Flow
1. **Authentication**: Service displays QR code for WhatsApp Web pairing
2. **Connection**: Establishes stable connection with WhatsApp servers
3. **Data Retrieval**: Fetches subscriber counts from configured newsletters
4. **GitHub Update**: Updates repository description and README with current statistics
5. **Reporting**: Logs successful updates with detailed breakdown
### Monitoring
The service provides detailed logging for:
- WhatsApp connection status and reconnection events
- Individual newsletter subscriber count retrieval
- GitHub API update operations
- Error handling and recovery procedures