- Install Docker
- Obtain Captcha keys (https://developers.google.com/recaptcha/docs/v3)
- Setup ENV variables (details below)
- Setup docker-compose.override.yml using docker-compose.override.yml.dist
- Run
docker compose up -d
- Profit - by default (when filling up empty vars from .env.example) the frontend will be available at http://localhost:9052 and the API at http://localhost:9051
Docker compose consist of two services:
Written in Astro + React + Typescript; used to generate static page for the form. Astro is used to optimize and minimize the amount of JS and CSS sent to the client.
Written in Typescript with NestJS framework directly handles redirections and creation of short links.
Confront .env.example for details. .env should be present in shorty-front directory before building.
- PORT - port on which the server will run outside the docker
- GOOGLE_PUBLIC_API_KEY - public captcha V3 key https://developers.google.com/recaptcha/docs/v3
- SHORTY_API_DOMAIN - API domain as used outside the docker (with port), aka http://localhost:9051
- SHORTY_API_ABORT_TIMEOUT - Timeout after which requests to API will be terminated (10s default)
Confront .env.example for details. .env should be present in shorty-api directory before building.
- PORT - port on which the server will run outside the docker
- GOOGLE_RECAPTCHA_SECRET_KEY - private (secret) captcha V3 key https://developers.google.com/recaptcha/docs/v3
- DATABASE_URL - URL to the database, used by Prisma. Prisma is configured to use sqlite database.
- SHORT_PROTODOMAIN - API domain as used outside the docker (with port), aka http://localhost:9051
- SHORTWEB_PROTODOMAIN - Domain of the frontend (used to redirect user to web 404 page)
- SWAGGER_ENABLED - Enable swagger documentation with JSON schema
- SWAGGER_BASIC_USER - Enable basic auth for swagger
- SWAGGER_BASIC_PASS - Enable basic auth for swagger
- SWAGGER_TITLE - Title of the swagger documentation
- SWAGGER_DESCRIPTION - Description of the swagger documentation
- SWAGGER_API_VERSION - API version of the swagger documentation