linkin

Linkin is a customizable self hosted link tree platform.

MIT License

Stars
76

Linkin · DeepScan grade codecov license Code Coverage

Linkin is a customizable self-hosted link tree application.

Free and Open Source

Self Hosted, you own your data

Customize your link tree with few clicks using a feature-rich dashboard

SEO friendly design built using Next js

Supports one-click deploy using multiple cloud providers

View Demo Demo Admin http://linkindemo.vercel.app/admin

  • Demo username = admin
  • Demo password = linkin123

Deploy with Vercel

Deploy with Heroku

Deploy with Railway

Getting started

  • Deploy in Vercel
    • set environment variables
      • DATABASE_URL - Postgres database url
      • HASHSALT - random secret key
      • NODE_ENV - set NODE_ENV to production
    • after successfully deploying visit youdomain/admin to view admin login
    • use default login credentials
      • username = admin
      • password = linkin123
    • after a successfull login you will be able to see above admin dashboard.
  • Deploy in Heroku
    • set environment variables
      • DATABASE_URL - Postgres database url
      • HASHSALT - random secret key
    • after successfully deploying visit youdomain/admin to view admin login
    • use default login credentials
      • username = admin
      • password = linkin123
    • after a successfull login you will be able to see above admin dashboard.
  • Deploy in Railway
    • set environment variables
      • HASHSALT - random secret key
      • PORT - 3000
      • RAILWAY - Set to 1 to run migrations and seeding in docker build stage . set 0 to avoid migrations and seeding in docker build stage
      • DATABASE_URL - Postgres database url . use this variable if you are not using railway postgres plugin
    • after successfully deploying visit youdomain/admin to view admin login
    • use default login credentials
      • username = admin
      • password = linkin123
    • after a successfull login you will be able to see above admin dashboard.

Running with docker

  • clone repository or download docker-compose.yaml yml file

  • update image to if you dont have it locally like below.

    services:
    linkin:
      image: ghcr.io/rizkyrajitha/linkin:latest
      ports:
        - "3000:3000"
      environment:
        DATABASE_URL: "postgres://linkin:linkin123@db:5432/linkin"
        HASHSALT: "1234" # random secret key
        NODE_ENV: "production"
      depends_on:
        - migrate
    
    migrate:
      image: ghcr.io/rizkyrajitha/linkin:latest
      command: >
        sh -c "npm run prismamigrateprod
        && npm run seed"
      environment:
        DATABASE_URL: "postgres://linkin:linkin123@db:5432/linkin"
        HASHSALT: "123" # random secret key
        NODE_ENV: "production"
    
  • Run docker compose up -d to start linkin (this will apply all migrations and then start linkin container).

Database connection

  • if the postgres database is behind pgbounce use pgbouncer=true parameter in DATABASE_URL ex - postgres://xx:xxx@xxxx:5432/xxxx?pgbouncer=true

Developing locally

Requirements

  • Node.js 18.x or newer
  • Postgresql

Clone and install dependencies

git clone https://github.com/RizkyRajitha/linkin.git
cd linkin
npm i

Setup local environmrnt variables in .env

example .env file

DATABASE_URL=postgres://linkin:123@localhost:5432/linkin
HASHSALT=123

Database migration

create database relations with prisma migration

you must have Postgres database setup locally

npx prisma migrate dev

Database Seeding

Addign Initial data to the database to get you started

npm run seed

Run

npm run dev

Build with

Currently supported hosting in

Community

Join our discord community for questions and updates

https://discord.gg/Jsmc5Dm9wg

Badges
Extracted from project README
DeepScan grade codecov Code Coverage Deploy with Vercel Deploy Deploy on Railway