Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/singlelink-co/Singlelink

The open-source Linktree alternative.
https://github.com/singlelink-co/Singlelink

apollo graphql javascript linktree linktree-alternative mysql nextjs nodejs react

Last synced: about 1 month ago
JSON representation

The open-source Linktree alternative.

Awesome Lists containing this project

README

        



Singlelink logo


Singlelink is the open-source Linktree alternative.




Build & lint


Version


License


Users






Twitter Follow




Getting started
Local development
Production deployment
Credits

Getting started

The easiest way to get started is to deploy your [Singlelink](https://singlelink.co) site with [Railway](https://railway.app). You can get started with one-click using the button below and build up to three Singlelink pages, each with custom domains, 100% free, thanks to their $5/mo credit system.

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/R7HMcu)

We also recommend connecting [Vercel](https://vercel.com) and [Planetscale](https://planetscale.com) for a free self-hosted Singlelink environment.

Local development

Singlelink is a [NodeJS](#) project built on [Next.js](https://nodejs.org/en/), [GraphQL](https://graphql.org/) (served via [Apollo Server](https://www.apollographql.com/)), and [MySQL](https://www.MySQL.org/).

If you haven't already, you'll need to install NodeJS and MySQL before being able to host or work on Singelink.
- [NodeJS installation guide](https://nodejs.dev/learn/how-to-install-nodejs)
- To install MySQL with Docker, run `npm run db:boot` from the project root.

Once you've installed NodeJS & MySQL, you can download Singlelink locally with:
```bash
git clone https://github.com/Neutron-Creative/Singlelink.git;cd Singlelink;
```

Before you start, you'll need to configure your environment by copying the .env template:
```
cp .env.template .env
```

Then, set the following **mandatory** environment variables to your preferences:
- `DB_URL`: Optionally, override the remaining DB ENV variables with an all-in-one connection URL
- `DB_DATABASE`: The name of the MySQL database you'll connect to (ex: railway)
- `DB_PORT`: The port for the MySQL database you'll connect to (ex: 3306)
- `DB_HOST`: The host url for your MySQL database (ex: containers-us-east-13.railway.app)
- `DB_USER`: The username for your MySQL user (ex: root)
- `DB_PASSWORD`: The password for your MySQL user
- `SECRET`: The secret used to sign and validate JWTs during authentication
- `PASSWORD`: The password you'll use to login and manage your Singlelink

Optionally, set the following variables to customize your site:
- `META_TITLE`: The title for your site, seen in Google Search results
- `META_DESC`: The description for your site, seen in Google Search results
- `META_IMG`: The OG image for your site, seen when sharing your site on social media.
- `BRANDING`: A boolean that enables/disables Singlelink branding on your site & dashboard

Next, install your NPM dependencies using `--ignore-scripts`:
```bash
npm i --ignore-scripts
```

After, you can run the DB migration script to initialize your DB:
```bash
npm run db:migrate
```
*You'll need to run `npm run db:migrate` again everytime you pull changes. It can't hurt to run a migration, but it can break things if you don't.*

Finally, you can start your development environment by running:
```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to view your new Singlelink, and [http://localhost:3000/login](http://localhost:3000/login) to login and add your first link.

Production deployment

You can [deploy Singlelink in one-click here with Railway](https://railway.app/new/template?template=https%3A%2F%2Fgithub.com%2FNeutron-Creative%2FSinglelink&plugins=MySQL&envs=SECRET%2CPASSWORD%2CMETA_TITLE%2CMETA_DESC%2CMETA_IMG&optionalEnvs=META_TITLE%2CMETA_DESC%2CMETA_IMG&SECRETDesc=The+secret+used+when+signing+JWTs.&PASSWORDDesc=The+password+you%27ll+use+to+login+to+your+Singlelink+dashboard.&META_TITLEDesc=Your+page+%26+meta+title%2C+seen+in+Google+search+results&META_DESCDesc=Your+page+description+seen+in+Google+Search+results.&META_IMGDesc=The+OG+image+thumbnail+shown+when+sharing+your+Singlelink+on+social+media.&referralCode=singlelink). At this time, they are the only provider we maintain & gurantee support for.

### Need to host elsewhere?
#### Platform as a service hosts are recommended due to ease of installation (ex: Heroku, DigitalOcean App Platform , etc.)
We don't offer official support yet, but you can host Singlelink with any VPS, provided you can install and run both Node.JS & MySQL. Singlelink will need one MySQL database, and one NodeJS instance capable of running Next.JS at run-time/SSR.




Looking for cloud hosting with premium support?


Consider checking out Singlelink Cloud, with plans available soon starting at just $8/month.

Credits

Singlelink was built by the following team full-time from August 2020-2021 our mission to to *open-source the world* at [Neutron Creative](https://neutroncreative.com).




  • Jim Bisenius (Co-founder & former CEO, @jim_bisenius)

  • Navid Kabir (Co-founder & former CTO, @navidk0)

  • Andrew Boyle (Co-founder & former CMO)


Today, Singlelink is maintained soley by me, Jim Bisenius on nights & weekends. If you'd like to assist in my development efforts, I'd love your help. Please [join our Discord](https://discord.gg/DDGnXCcgsu) or [create a pull request](https://github.com/Neutron-Creative/Singlelink/pulls)!