This service provides prayer times data for all states in Malaysia. Data is based on E-Solat JAKIM.
Disclaimer: This service is not affiliated with JAKIM nor endorsed by them in any way.
There are three ways documented here to start the development server locally. Choose the one according to your preferences. Bare Metal, Docker, or GitHub Codespaces.
This method assumes you already have PHP development environment set up on your machine. If you don't have one yet, you can install and set up Herd.
To get started, clone the repository. Then, install Composer & Node dependencies:
composer install
npm installSet up your .env file:
cp .env.example .envIn the .env file, fill in the database connection info.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=waktusolat
DB_USERNAME=root
DB_PASSWORD=Note
SQLite database is currently not supported because it doesn't have a spatial driver. If you are limited to using SQLite, you can either:
- Install a spatial extension for SQLite.
- Avoid using spatial queries. This includes removing the
ZonePolygonSeeder,zone_polygonsmigration, etc. Note that this will cause some endpoints that require geographic resolution to not work. - If you still want spatial queries to work, refer to the geojson-helper server that was previously implemented.
Then, run the migrations & seeder:
php artisan migrate --seedGenerate the api documentation page:
php artisan scribe:generateBuild and start the application:
composer run devNote
When running composer run dev, it will automatically listen for changes in the app/Http/Controllers/api/**/*.php files and regenerate the API documentation. However, sometimes it may not work. In such cases, try running the following command separately in another terminal:
npx chokidar 'app/Http/Controllers/api/**/*.php' -c 'php artisan scribe:generate'You can now access the application at http://localhost:8000. The api docs will be available at http://localhost:8000/docs.
Setup the project until the step of creating .env file above. Then, run:
docker compose -f docker-compose.local.yml up --buildThe compose file assumes you have MySQL instance already running on your machine. If you don't have one yet, learn how to set it up here: https://iqfareez.com/blog/setup-docker-mysql-phpmyadmin
The app should be available at http://localhost:8080/.
To access the container's shell, run:
docker compose -f docker-compose.local.yml exec app shNote
This setup works best if you launch the codespace within your local VS Code. If you're using Codespace in the browser, additional steps may be required. See https://github.com/JonoHall/Laravel-Vite-Codespaces
You may need to create/edit the .env file:
DB_CONNECTION=mysql
DB_HOST=db # use service name instead of local ipThen, run
composer setupStart the application:
composer run devThe app should be available at http://localhost:8000. PhpMyAdmin should be available at http://localhost:9001 (username: root, password: leave empty).
When error "Failed to Fetch" appear in the Swagger UI. Update the APP_URL value in the .env file to match the app URL. Example:
APP_URL=http://127.0.0.1:8000Create a .env.testing file:
cp .env.example .env.testingSet the database connection to production database. It must run MySQL or other supported database with spatial support.
To run the test suite, execute the following command:
php artisan test --env=testingThis project contains Laradumps package. LaraDumps is a powerful and user-friendly debugging app.
To use it, first install the Laradumps desktop app from https://laradumps.dev/download.
Then, run the following command:
php artisan ds:init $(pwd)Get further information from the documentation: https://laradumps.dev/debug/introduction.html
TODO
In early days of App Waktu Solat API, I rely on API server provided by others. But sometimes, the server got shut down, discontinued, out of date etc. Hence, I think I need to maintain my own server.
History of API Server implementation, sorted from latest to oldest:
- This API
- MPT Server - Discontinued
- MPT Backup API - Discontinued
Wonder why so many changes? Here's why. (TODO)
Interested in self-hosting the API Waktu Solat server? See Deployments for details.