Skip to content
Ailton Baúque edited this page Oct 18, 2024 · 3 revisions

TinyLinker Quickstart Guide

This wiki provides a comprehensive, step-by-step guide to running TinyLinker, either using Docker or Kubernetes. Follow the instructions below to quickly get started.

Getting Started with Docker

To run the TinyLinker project using Docker, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/vybraan/TinyLinker.git
  2. Navigate to the Project Directory:

    cd TinyLinker
  3. Polulate The Environment file .env

    NEXTAUTH_SECRET=secretjeynext
    NEXTAUTH_URL=http://localhost:3000 # Your choice
    NEXT_PUBLIC_DOMAIN=http://localhost:3000 # Your choice
    JWT_SECRET=secrety
    AUTH_TL_BASE_URL=http://authtl:8080
    SHORTIFY_BASE_URL=http://tlshorten:8080
    REDIS_URL=redis://redis:6379
    
    
    GOOGLE_CLIENT_ID=clientIDvalue
    GOOGLE_CLIENT_SECRET=clientsecretvalue
  4. Start the Application with Docker Compose:

    sudo docker compose up -d
  5. Check the Logs: Ensure everything is running as expected by viewing the logs:

    sudo docker compose logs -f

Running with Kubernetes

TinyLinker is also configured to run in a Kubernetes cluster. The following steps will guide you through setting it up.

Prerequisites

  • A Kubernetes cluster set up and running
  • kubectl installed and configured to interact with your cluster

Deployment Steps

  1. Apply Namespace Configuration:

    kubectl apply -f k8s/namespace.yaml
  2. Apply Persistent Volume Claims:

    kubectl apply -f k8s/claims.yaml
  3. Apply Configuration and Secrets: Apply application secrets and config maps:

    kubectl apply -f k8s/app-secrets.yaml
    kubectl apply -f k8s/app-config.yaml
  4. Apply Service Definitions: Apply the services for each component:

    kubectl apply -f k8s/authtl/service.yaml
    kubectl apply -f k8s/tlshorten/service.yaml
    kubectl apply -f k8s/redis/service.yaml
    kubectl apply -f k8s/tldash/service.yaml
  5. Apply Deployment Configurations: Deploy the services to your Kubernetes cluster:

    kubectl apply -f k8s/authtl/deployment.yaml
    kubectl apply -f k8s/tlshorten/deployment.yaml
    kubectl apply -f k8s/redis/deployment.yaml
    kubectl apply -f k8s/tldash/deployment.yaml

Accessing the Application

Since the app is not publicly accessible by default, you can use port forwarding to access the dashboard. Run the following command to forward port 3000:

kubectl port-forward svc/tldash-service 3000:3000 -n tiny-linker

After running the command, you can access the TinyLinker dashboard at http://localhost:3000.


Running Manually

Documentation on how to run the app manually is in progress.