Skip to content

koekalenteri/koekalenteri

Repository files navigation

Koekalenteri

Quality gate

An open-source project to implement the functionality of http://koekalenteri.snj.fi on a modern architecture and futher enhance it with new functionality. Koekalenteri is used to create a calendar of the different types of retriever hunt tests (NOME-A, NOME-B, NOME-WT and NOU) in Finland as well as a tool for entrants to enter their dogs and organizers to manage entries etc.

Development

The following tools must be installed:

All scripts assume that you have a well configured CLI with the necessary AWS profile set, see AWS profile creation. It is recommended to name this profile as koekalenteri – at least all scripts and examples here assume this setup.

Configuring AWS CLI

You need AWS Access Key ID and AWS Secret Access Key. These can be generated in the IAM console.

aws configure --profile koekalenteri

Environment variables

You will need to setup the following environment variables so AWS uses the configured profile

Linux or macOS

export AWS_PROFILE=koekalenteri

Windows

setx AWS_PROFILE koekalenteri

Setting up dependencies and services

Following commands install dependencies to the project and initialize a docker network and dynamodb instance

npm ci
npm run init

Local development

Start backend and frontend

npm start

This command will start both backend and frontend. Changes are detected automatically. Only if you change the template.yaml, you need to stop (ctrl-c) and restart.

Note: SAM local is very slow, because it rebuilds lambda on every access.

Please note that AWS Cognito cannot be run locally so for user authentication a working network connection to the AWS setup is required.

Start frontend only

npm start-frontned

This command starts only the frontend.

Note: You should configure .env (see .env_sample) to use backend in the cloud.

Deploying

Deployment is automated with GitHub actions.

Backend overview

Koekalenteri backend is a bunch of lambda functions running on AWS.

Frontend overview

Koekalenteri frontend is written in TypeScript and is based on the following major libraries: