Giter Club home page Giter Club logo

prayeralarm's Introduction

Prayer Alarm

CI CD Release
Go Report Card

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.

Prayer alarm configuration parameters

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

Prayer time offsets

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.

Development

Pre-requisites

  • Golang (developed on v1.15)
  • Pre-requisites for sound/output dependencies
    • output=native
      • Oto - based on OS
      • Oto requires CGO_ENABLED=1
    • output=omx
      • Omxplayer - A CLI application that can play audio files

Steps

Use the Makefile to test, build and run the project; alternatively manual instructions are defined below.

Install client dependencies

cd client
npm install

Build client

cd client
npm run build

Install server dependencies

go mod download

Build server

go build

Note: If using native output, then build with: CGO_ENABLED=1 go build

Run server binary - examples

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)

Dependencies

  • 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

Licence

License


TODO

  • 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

Roadmap

  • A web-ui to view prayer calendar - for current day and month
  • Ability to toggle on-off prayer call

prayeralarm's People

Contributors

zees-dev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.