A triathlon business platform combining APIs (OpenAPI specs + infrastructure), event & community services, and a developer portal — all in one ecosystem.
This repository houses:
- Terraform IaC
- Under the
portal/directory to provision a Konnect Developer portal - Under the
apis/directory to onboard APIs and markdown docs to the Developer Portal
- Under the
- GitHub Actions workflows for CI/CD for both projects
You can access a live demo of the Konnect Develoepr Portal by navigating to this link
You will have to register and account and confirm your email, but then you will have access to view everything on the site
-
Clone the repository:
git clone https://github.com/andrewgkew/wild-tri-co.git cd wild-tri-co -
To provision a Developer Portal:
cd portal -
Configure your backend and secrets. For example, use an S3 backend and set default variables in tfvars file:
# Example example.tfvars konnect_system_account_access_token=spat_xxxx
-
Initialize Terraform:
terraform init \ -backend-config="bucket=YOUR_S3_BUCKET" \ -backend-config="key=path/to/terraform.tfstate" \ -backend-config="region=YOUR_AWS_REGION"
-
Plan & Apply:
terraform plan -var-file=example.tfvars terraform apply -var -file=example.tfvars
The CI pipeline will:
- Checkout code
- Set up Terraform
- Configure AWS credentials (for S3 backend)
- Inject
KONNECT_TOKENsecret asTF_VAR_konnect_system_account_access_token - Run
terraform init,plan, and onmainbranch,apply
Make sure you add the following secrets in your GitHub repo settings:
AWS_ACCESS_KEY_ID- IAM access key to write terraform state to S3AWS_SECRET_ACCESS_KEY- IAM secret key to write terraform state to S3AWS_REGION- The default AWS regionTF_STATE_BUCKET- The S3 bucket name already created in AWSTF_STATE_KEY- The terraform state key which defines the S3 object name i.edeveloper-portal/terraform.tfstateKONNECT_TOKEN- The Konnect System account token used to provision Konnect Developer portal
The second terraform project under apis/ gives you ability to onboard APIs and mardown docs to the already created Konnect Developer Portal.
The project has an internal terraform module that allows you to create:
- An API with given name and description
- Set the current version of the API
- Add custom attributes that are used for filtering APIs on the portal
- Set the visibility of the API to private or public
- Create multiple versions of the API if you are managing more than 1 versio 8DC3 n of the API
- Create markdown docs that are linked to the API and visible as part of the API Renderer
To onboard APIs you can easily define all these in your tfvars file. Currently the project only allows local based OAS and markdown docs but this can be extended to allow pulling of the files from a URL instead.
Example tfvars file
api_config = {
"analytics" = {
current_version = "1.0.0"
api_slug = "analytics"
api_name = "Triathlon Business Reports and Insights API"
api_description = "API for generating reports and insights on athlete performance and business operations for a triathlon business."
api_visibility = "private"
labels = {}
attributes = {
domain = ["Business"]
use_case = ["Insights"]
audience = ["Admin"]
data_type = ["Reports"]
business_function = ["Analytics"]
workflow_stage = ["Analyze"]
integration_type = ["Analytics"]
access_level = ["Internal"]
complexity_level = ["Analytics APIs"]
industry_focus = ["Sports Tech"]
}
versions = [
{
version = "1.0.0"
location = "./specs/analytics-api.yaml"
type = "yaml"
}
]
api_docs = {
"overview" = {
title = "Overview"
location = "./docs/analytics/overview.md"
}
"quickstart" = {
title = "Quickstart"
location = "./docs/analytics/quickstart.md"
}
"authentication" = {
title = "Authentication"
location = "./docs/analytics/authentication.md"
}
"changelog" = {
title = "Changelog"
location = "./docs/analytics/changelog.md"
}
"errors" = {
title = "Errors"
location = "./docs/analytics/errors.md"
}
"recipes" = {
title = "Recipes"
location = "./docs/analytics/recipes.md"
}
"business-operations" = {
title = "Business Operations"
location = "./docs/analytics/business-operations.md"
}
"athlete-performance" = {
title = "Athlete Performance"
location = "./docs/analytics/athlete-performance.md"
}
"pagination-and-filtering" = {
title = "Pagination & Filtering"
location = "./docs/analytics/pagination-and-filtering.md"
}
}
portal = "Wild Tri Co."
}
"atheletes" = {
current_version = "1.4.0"
api_slug = "athlete"
api_name = "Athlete Management API"
api_description = "API for managing athlete profiles and performance data."
api_visibility = "private"
labels = {}
attributes = {
domain = ["Athlete"]
use_case = ["Performance"]
audience = ["Athlete"]
data_type = ["Profiles"]
business_function = ["Training"]
workflow_stage = ["Train"]
integration_type = ["Core System"]
access_level = ["Partner"]
complexity_level = ["Basic CRUD"]
industry_focus = ["Sports Tech"]
}
versions = [
{
version = "1.4.0"
location = "./specs/athletes-api.yaml"
type = "yaml"
}
]
api_docs = {
}
portal = "Wild Tri Co."
}
}Terraform loops over this map and auto-creates:
konnect_apiresourceskonnect_api_versionresourceskonnect_api_publicationresourceskonnect_api_documentresources
In order to find the portal to publish the APIs to the module will check the name of your portal that it contains the string
passed in in the portal field in your tfvars file
data "konnect_portal" "portal" {
filter = {
name = {
contains = var.portal
}
}
}- Terraform Docs: Backend Configuration
- Konnect registration: Register
- Konnect Docs: Developer Poratal Docs
- Terraform Provider: Konnect Terraform Provider
Contributions are welcome! Please open issues or PRs to propose new features, fix bugs, or improve docs.
Wild Tri Co — where triathlon, community, and APIs converge.