Users log into TESSA with GitHub. Every developer should create their own OAuth app in GitHub to develop against. To do that, follow these steps.
- Go to https://github.com/settings/developers.
- Click the "New OAuth App" button.
- Enter the following data, then click the "Register application" button.
- Application name: TESSA Development
- Homepage URL:
http://localhost:3000/
- Application description: TESSA local development.
- Authorization callback URL:
http://localhost:8484/auth/github/oauth/callback
- In your local clone of this repo, create a copy of the file
.env.example
and name it.env
. - On the
Settings / Developer settings / TESSA Development
page, copy the "Client ID" and paste the value afterGITHUB_CLIENT_ID=
in the.env
file. - Then, click the "Generate a new client secret" button, copy the secret, and
paste it after
GITHUB_CLIENT_SECRET=
in the.env
file.
TESSA uses a Postgres database. For convenience, a docker-compose.yml
file has
been created to run a development database with the preconfigured environment.
To start the database, simply run:
docker-compose up
TESSA Backend is a Node.js app. To improve compatibility, it should only be run
against the version of Node.js specified in the .nvmrc
file. If you have
NVM installed, to use the correct version of
Node, run:
nvm use
With the right version of node installed, the next step is to install the dependencies. To do that, run:
npm install
Finally, run the server with:
npm start
To set up your local environment with access to AWS and Kubernetes, run:
./scripts/setup-env.sh
This script will open a web browser and prompt you to log in with your Commit account, and then will configure an AWS profile and a Kubernetes context.
The configuration of the application in Kubernetes uses
https://kustomize.io/ and is run by the CI pipeline. The
configuration is in the /kubernetes
directory.
Once the CI pipeline is finished, you can see the pod status on kubernetes in
the tessa-backend
namespace:
kubectl -n tessa-backend get pods
Pull requests run a workflow which runs unit tests and checks the code for lint before permitting PRs to be merged.
To check your code before merging, use the following commands.
Run unit tests with Jest.
npm test
Check formatting with Prettier.
npm run format
Check for lint with ESLint.
npm run lint
Automatically fix formatting errors.
npm run format:fix
Automatically fix some lint errors.
npm run lint:fix
This repository has an end-to-end CI/CD pipeline that runs whenever new commits
are pushed to the main
branch. It includes the following steps.
- Checkout
- Unit test
- Build image
- Upload Image to ECR
- Deploy image to cluster
Pull requests also run a workflow which runs unit tests, and checks the code for lint before permitting PRs to be merged.