A cross-platform islamic prayer alarm.
The prayer alarm binary will run the adhan prayer call (audio) based on prayer timings retrieved from the Adhan API.
- Prayer timings are retrieved on a monthly basis (starting with current month by default).
- Prayer calls (adhan audio) are played at the respective prayer times.
The prayer alarm admin dashboard (Web UI) can be viewed at port 8080
.
Name | Description | Value |
---|---|---|
city |
City for which to retrieve prayer calendar | "Auckland" |
country |
Country for which to retrieve prayer calendar | "NewZealand" |
offsets |
Prayer call offsets to fine-tune prayer adhan timings (negative numbers are supported) | "0,0,0,0,0" |
year |
Year of prayer calendar | 2021 (current year) |
month |
Month of prayer calendar | 6 (current month) |
output |
Output device to play adhan at prayer time; supported options are stdout , native and omx |
omx |
port |
Port to serve admin UI dashboard (web server) | 8080 |
Offsetting prayer call times is also supported. Prayer call's can be offset by a specified number of minutes by providing an optional offsets flag when running the binary.
For example, to respectively offset the Maghrib and Isha prayer calls to run 5 mins later and 3 mins earlier, the binary can be run with the following flag: -offsets "0,0,0,5,-3"
By default, offsets for all prayer times are set to 0; i.e. 0,0,0,0,0.
- Golang (developed on v1.15)
- Pre-requisites for sound/output dependencies
Use the Makefile to test, build and run the project; alternatively manual instructions are defined below.
cd client
npm install
cd client
npm run build
go mod download
go build
Note: If using native
output
, then build with: CGO_ENABLED=1 go build
In foreground:
./prayeralarm
- Run with overrides - optional city, country and offset flags
./prayeralarm -city Auckland -country NewZealand -offsets "5,0,-5,-10,0"
In background (as service) - with log file:
nohup ./prayeralarm > adhan.log &
- Kill background process
kill $(ps -ef | grep prayeralarm| cut -f4 -d" " | head -1)
- Oto for sound playback (playing Adhan audio)
- go-mp3 for cross-platform MP3 playback (playing Adhan audio)
- pulseaudio server on host (if running prayeralarm in container)
- run pulseaudio server:
pulseaudio --load=module-native-protocol-tcp --exit-idle-time=-1 --daemon
- stop pulseaudio server:
pulseaudio --kill
- run pulseaudio server:
- Integration testing
- Tagged releases - using semantic versioning
- Cross-platform release binaries
- Raspberry Pi release binary
- Docker based setup - example
- CI pipeline
- Multiplatform release binaries
- CD pipeline
- One workflow should release to Raspberry PI
- A web-ui to view prayer calendar - for current day and month
- Ability to toggle on-off prayer call