Deploy your own shortener service in the aws free tier. Made in Go with minimal dependencies. Raw HTML JS and tailwind front. Main engine to integrate with other internal services.
- Fully serverless pay per request
- Terraform infra
- Github actions
- Generic main engine
- Easily integrate using a api-key
- Bff implementation example
- make
- aws-cli
- terraform
- go
- node
- yarn
Make sure to have all requirements.
local:
- Clone the repo
- Install node dependencies with
yarn install
- Copy
.env.example
to.env.dev
and.env.prod
and fill the valuesSome values only exist after running Terraform apply
- configure aws credentials
- Configure your runner in
nx.json tasksRunnerOptions
⚠️ Configure the Terraform providerbackend
by changing or removing theprovider.tf backend
section in each environment- export AWS_PROFILE={your-profile}
- Deploy once with
nx run shortener:first-deploy:dev
andnx run shortener:first-deploy:prod
- Get the cloudfront distribution id and put it on your envs
- Finally deploy with
nx run shortener:deploy:dev
andnx run shortener:deploy:prod
github actions:
- configure a
prod
anddev
environment with:- secrets:
- AWS_ACCESS_KEY_ID
- AWS_PROFILE
- AWS_REGION
- AWS_SECRET_ACCESS_KEY
- variables:
same as .env
- API_BASE_URL
- API_BASE_URL_DOMAIN
- ARTIFACTS_BUCKET_NAME
- DYNAMO_URL_TABLE_NAME
- FRONT_BASE_URL
- FRONT_BASE_URL_DOMAIN
- FRONT_BUCKET_NAME
- FRONT_CLOUDFRONT_DISTRIBUTION_ID
- GATEWAY_API_NAME
- NX_RUNNER
- STAGE
- secrets:
See all available commands bellow and use with: nx run {project}:{task}:{environment}
.
Ex: nx run engine:serve:dev
to start a local api.
Projects | Tasks |
---|---|
engine | build, lint, serve, test, tidy |
front | build, lint, publish, serve, test, tidy |
public-api | build, lint, serve, test, tidy |
utils | lint, test, tidy |
shortener | deploy, first-deploy |
See in /docs
![]() |
![]() |
---|---|
![]() |
![]() |
![]() |
![]() |