2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00
2025-11-23 20:42:56 +01:00

URL Shortener

A modern, full-stack URL shortener application built with a separate backend and frontend, orchestrated via Docker Compose.

Prerequisites

Before you begin, ensure you have the following installed on your machine:

Configuration

  1. Clone the repository:

    git clone <repository-url>
    cd url-shortener
    
  2. Environment Setup:

    Copy the example environment file to create your local configuration:

    cp .env.example .env
    
  3. Configure Environment Variables:

    Open the .env file and adjust the variables as needed. Key variables include:

    • DOMAIN: The base domain for the application (default: localhost).
    • STACK_NAME: The name of the Docker stack (default: url-shortener).
    • JWT_SECRET: A secret key for signing JWTs. Change this to a secure random string.
    • PRISMA_USERNAME & PRISMA_PASSWORD: Credentials for accessing Prisma Studio.
      • Note: PRISMA_PASSWORD must be a bcrypt hash. The example file contains the hash for "adminpassword".

Deployment

To start the application in a local development environment, run:

docker compose -f compose.yaml -f compose.local.yaml up -d --build

This command builds the images and starts the services in detached mode.

Accessing the Services

Once the containers are up and running, you can access the various components at the following URLs (assuming default DOMAIN=localhost):

Project Structure

The project is organized into two main directories, each with its own README for more detailed information:

  • backend/: Contains the Bun API and database logic.
  • frontend/: Contains the React/Vite frontend application.
S
Description
No description provided
Readme 142 KiB
Languages
TypeScript 94.5%
CSS 3.7%
Dockerfile 1.5%
HTML 0.3%