- Ensure you are using
Node.js v10
- Install the dependencies in the
app
andstrapi
directories withyarn
- Requires a Mongo Service to be running on
127.0.0.1:27017
(localhost) - Run the frontend from the
app
directory withyarn start
- Run the strapi backend from the
strapi
directory withyarn run develop
Once ready, run npm run develop
- Open the
/admin
page of the Strapi Application (live here and login)
- After logging in you will see the homepage of the admin section. Now click on the
Masjids
link in theContent-Types
section in the left panel.
If you can only see the
Users
link it means that things did not load correctly, just do a hard refresh on your browser (more information here) until you can see the same sections as above, and then click onMasjids
- You should now see the Masjid listing screen below
- Click on the blue
Add New Masjid
button at the top right to create a new Masjid
If you would like to instead edit the times for an existing Masjid you can instead just click the row with the masjid details which will take you to the same edit screen as above
- Fill in the relevant fields for the Masjid (all times are not required). Note that when filling in times to please use the am/pm format (eg.
05:30pm
) as can be seen in the example below
- Once you are done entering the relevant details click the blue
Save
button at the top, and that's it.
If you want to export these times as a text format, this can be done by clicking on the Salaah Times
heading in the app view. The times will then be copied to your clipboard and you can paste them wherever you like
- Does not load content if the home page was not loaded first
[X] Create server to handle JSON times requests from React App
[X] Build frontend with React for the masjid listing
[X] Cache network requests with PWA
[X] Configure build and deploy pipeline
[ ] Decide how long the |js|css|html| files should be cached
[X] Refactor to an actual db (or at least provide a plugin that can be modified easily at a later stage)
[X] Consider using a custom theme
[ ] Look at PWA notifications
[ ] Add announcement functionality
Strapi is deployed as a Node.js application to Heroku, in order to set up the application you will need to do the following from the repository root directory:
heroku login
heroku git:remote -a salaah-times-backend
- Run the
heroku-deploy.ps1
script to deploy the application - You will also need to configure the following:
NODE_ENV
- This should be set todevelopment
so Gatsby can infer the schema during buildDATABASE_URI
- MongoDB connection stringMASJID_CHANGE_WEBHOOK
- Webhook to trigger frontend build
The frontend application is deployed as a Gatsby site to Netlify, this will automatically deploy when the application is pused, however a deploy will also be triggered when Strapi is updated via the Strapi Webhook functionality
The frontend application requires the STRAPI_BASE_URL
to be set as an environment variable without the trailing /
Salaah times from https://www.salahtimes.com/south-africa/pretoria
Convert to JSON https://www.csvjson.com/csv2json