Serverless framework functions to expose time reporting data to clients as JSON. Currently this project assumes invoicing in swedish crowns.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Node.js + npm for building, running and deploying the project
- Harvest account where the time tracking is done, the source of data
First, install third party dependencies
npm install
Set up the .env
file with proper values
cp .env.example .env
code .env # or alternative editor
Start the project locally
npm run start
You should now have the project running on http://localhost:3000! ✨
This project relies heavily on unit tests with jest
and has 100% coverage! Additionally prettier
helps with code style consistency and ESLint
guides some code style decisions.
Run the tests by running one of
npm run test
npm run test -- --watch
npm run test -- --watch --notify
Check the code style by running
npm run lint
Fix the code style issues manually or together with the following command
npm run lint:fix
To set up a deployment on AWS you need an AWS account.
- Node.js + npm for building, running and deploying the project
- Harvest account where the time tracking is done, the source of data
- AWS account for hosting the serverless function (lambda)
First, install third party dependencies
npm install
Set up the .env
file with proper values
cp .env.example .env
code .env # or alternative editor
Configure AWS credentials in serverless
.
npx serverless config credentials --provider aws --key AKIAIOSFODNN7EXAMPLE --secret wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
To deploy both a dev environment and a prod environment, run
npm run deploy
(As an alternative you can run npm run deploy:dev
or npm run deploy:prod
)
To remove everything that was set up on AWS, run
npm run remove-deploys
- Serverless - The most widely-adopted toolkit for building serverless applications
- node-fetch - A light-weight module that brings window.fetch to Node.js, for consuming the Harvest API
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Daniel Edholm Ignat (dignite) - Initial work
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.