A helper server for Malaysia Prayer Time app. Provide necessary data and procssing for the app features to work/
First, install the dependencies:
yarn install
(Optional) Get the Web API key from Firebase Console. Create a .env.local
file and add the following:
FIREBASE_PROJECT_API_KEY=AIzaXXXXXXXXXXXXXXXXXXX
Run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
The data is updated automatically every month using GitHub Action. The overall flow is depicted in the diagram below.
flowchart TD
A{{JAKIM}}
A <--> C
C[[Fetch latest prayer data]] --- D[(db.json)] & E[(log.json)] --> F(Commit & push)
F -->|Vercel build triggered| G[Deployed to Vercel]
View the fetcher implementation here.
GET
/api/solat
- Get the latest prayer time data for the current month for all locationGET
/api/solat/{locationCode}
- Get the latest prayer time data for the current month for the given location. See alllocationCode
here.GET
/api/solat/{locationCode}/{day}
- Same as above, but you can filter for only a day (1-31)GET
/api/zones
- Get all the zones with Jakim code, daerah & negeri for all location.GET
/api/zones/{locationCode}
- Note: Only give the initial string to the location code. Eg:kdh
,prk
, etc. Return zones only for the supplied zone.GET
/api/mosque/{locationCode}
- Get the mosque image for the supplied location code. See alllocationCode
here.
POST
/api/feedback