Functions
Functions
Cloud Functions are used for server-side-logic. Most Operations in crowde are done directly from the web-client to firestore, but for some operations the web-client cannot be bothered or trusted. Cloud Functions are mainly used for those Operations, that are computing-intensive or require system-wide permissions. They are mostly triggered by changes in firestore and mostly respond by writing back into firestore. There are a few exceptions, like a function responding to a newly registered user in Firebase Auth. Functions in this project are defined in /functions/
.
Jobs
Jobs are a bit like RPC. They can be triggered by writing a new Job to Firestore (mostly done be Web-Client). A function called isofireMandantJobs
is triggered for each new Job. A Job Controller defines how a particular Job is handled (for example /functions/src/job/join-course.job.ts
). The Response of the Job is written to the Job's firestore Document originally created to trigger the job.
Jobs can also be triggered or executed by other Jobs or by the Dev-Server. (For example /server/src/operations/redo-job.operation.ts
)
Starting Points
/functions/src/isofire-functions/crowde.module.ts
defines all crowde-specific Jobs and functions./functions/src/index.ts
usesexportFunctions(...)
at the end of the file to define all functions.