“onepixel” is an API-first URL shortener.
A URL shortener should have a short domain name, possibly 2 or 3 letter in length.
“1 pixel” is the smallest unit of a screen.
So 1px.li
stands for one pixel links
- i.e. smallest possible links :)
The latest version of the code is automatically deployed via Railway
to
https://onepixel.link
You can deploy your own instance too
There are two databases used in this project
Purpose | Database |
---|---|
Application DB | PostgreSQL |
Events DB | Clickhouse |
For tests on CI it is better to use small embedded databases instead of spinning up a full database server.
Purpose | Database |
---|---|
Application DB | SQLite |
Events DB | DuckDB |
[!NOTE] You can also override
.onepixel.local.env
to use the embedded databases for local development but they are not recommended for production use.
Simplest way to get it running is
./data
directory where your database will be storeddocker-compose up
We will use docker to run an instance of our databases, but we will run the project using air locally
./data
for postgres./clk_data
for clickhouse./clk_logs
for clickhouse logsdocker-compose up -d postgres clickhouse
air
in the root directory of the project 1We will be using the embedded databases for local development without docker
.onepixel.local.env
DB_DIALECT=sqlite
DATABASE_URL="app.db"
USE_FILE_DB=true
EVENTS_DB_DIALECT=duckdb
EVENTDB_URL="events.db"
air
in the root directory of the project 1Note[1]: you can also run
go run src/main.go
but it will not reload on changes