An app to automatically send the GA declaration form every week at a specified time, for the subscribed users.
- Allow user to configure the day they want their all-clear forms sent.
- Students and GA team can send all-clear declaration forms every week.
- Allow users to customise form fields (so these will be forms that are not all-clear)
- Notify user via email for every declaration submitted? (Users should be able to turn on/off the feature. Or they can enable emails only when the service fails.)
- Express
- Heroku with Scheduler Add-on (runs
api/jobs/sendGoogleForm.jsevery day. Due to Heroku scheduler restrictions which won't let me run jobs for a particular day of a week, this job runs everyday, but the script checks for the current date to see if it should run the job.)
- React
- Material UI
This repository has two separate apps - a React client and an Express api.
Create a .env in /api following .env.example. Be sure to remove all comments.
-
DB_USER: Your Mongo Atlas username (you don't need this if using your localhost MongoDB) -
DB_PASS: Your Mongo Atlas password (you don't need this if using your localhost MongoDB) -
DB_HOST= Your Mongo Atlas host. (you don't need this if using your localhost MongoDB) -
DB_NAME: Name of your database -
DB_TYPE: If this is not set to a string "atlas", it will default to using your localhost DB. -
SCHEDULED_DAYThis will affect the declaration day showed on the client. Should be a number from 0 - 6. (0 being Sunday, 6 being Saturday.) -
SCHEDULED_TIME_IN_HOURS: This will affect the declaration time showed on the client. Should be a number from 0 - 23 -
NODE_ENVthis should be either "production" or "development"
Create a .env in /client following .env.example.
REACT_APP_API_URL: The API endpoint the client will interact with. The default should be
REACT_APP_API_URL=http://localhost:4000
For api you can use yarn dev if you have nodemon installed, if not yarn start
For client, just yarn start
❗️ Sometimes, user's last declared field does not update although forms were sent – my theory is that it's an async problem where the connection to the database closed before Mongoose completed saving the changes to the user model. Tried to resolve it with async/await.
❗️ Requests for the team form has stopped working. Unable to figure out the issue.