Create calendars for sharing
Share your calendars
How it works
Whenever people applied for leave in the Payroll portion of Xero we were manually creating a calendar item and inviting people to it - just so they could see when people were on leave. We decided to make an easy way for everyone in the organisation to be able to see leave.
What it does
Takes the leave data from the Xero Payroll API and publishes it to any popular calendar readers.
How? Our process extracts approved leave data from Xero every night and puts it into an iCal format. The url to the custom iCal file can be added the end-user calendar (Google Calendar, Outlook, etc) - the calendar tool then makes sure the user always sees the latest leave data.
How we built it
We've gone for a completely server-less model.
We use Node.js running on AWS Lambda for our back-end - it talks to the Xero API to handle the authentication and to talk to the Xero Payroll API (AU).
The React code talks to AWS API Gateway to communicate with the Lambda functions, and uses AWS Cognito to handle all of our local authentication and user management.
The Lambda functions access/store their data in an AWS RDS instance (MySQL).
The finished iCal files sit in another S3 bucket and are access directly by the user's calendar apps.
Challenges we ran into
The xero-node npm package doesn't yet support the payroll API so we had to create this ourselves.
Accomplishments that we're proud of
A completely server-less stack means we don't have to worry about capacity or patching our servers - AWS abstracts us away from all of that.
Also pretty cool that we don't have a GUI for the end user - all they have to do is add the URL to their preferred calendar application and we do the rest behind the scenes.
What we learned
We learned that the Xero API is pretty cool and well documented and that AWS has a pretty broad suite of tools that can be pretty powerful when connected together (in the right way!).
What's next for LeaveCal by Finlert
We've got lots of plans...
- Expanding out to the NZ & UK Payroll APIs
- Allow orgs create multiple calendars - allowing them to see leave by department (rather than for everyone)
- Leave alerts that let people get alerted to leave in the organisation or just in their department
- Capacity reports so services businesses can get an accurate view of their capacity including leave