Skip to content

NV-9/Lynx

Repository files navigation

Lynx

Lynx is a self-hosted URL shortener with authentication, admin user management, and a clean web UI. It is designed to run as a lightweight single-container deployment while still providing practical controls like custom slugs, filtered/paginated link browsing, and role-based actions.

Built with

Go Chi SQLite Docker Tailwind CSS HTMX

Development

The project is production-usable and still evolving. Current work is focused on tightening admin workflows, improving UX polish, and keeping the deployment path simple for single-host setups.

Features

  • Authenticated dashboard
  • First-user bootstrap as admin
  • Admin user management (create, role toggle, delete safeguards)
  • Custom slug support
  • Reserved slug protection
  • Link access metrics
  • Filtered + paginated link API
  • Admin-only link deletion
  • Link analytics breakdown by date range and top destinations
  • User-agent capture on link access (browser breakdown)
  • Privacy policy page

Roadmap

  • CSV export for filtered link data
  • Optional webhook notifications for newly created links

Run Locally

Run Locally - Docker

  1. Clone the repository:
git clone https://github.com/NV-9/Lynx.git
cd Lynx
  1. Start the app:
docker compose up -d
  1. Open:
http://localhost:8080

Run Locally - Manual Setup

  1. Clone and enter the project:
git clone https://github.com/NV-9/Lynx.git
cd Lynx
  1. Install dependencies and run:
go mod download
go run .
  1. Open:
http://localhost:8080

Environment Variables

Variable Default Description
PORT 8080 HTTP port
BASE_URL http://localhost:<PORT> Public base URL used when returning short links
DATA_DIR /data Directory used for SQLite database storage

API Summary

Method Path Notes
POST /api/shorten Create short link (optional custom slug)
GET /api/links Auth required, supports filter, page, size
DELETE /api/links/{id} Admin only
GET /api/users Admin only
POST /api/users Admin only
PATCH /api/users/{id}/admin Admin only
DELETE /api/users/{id} Admin only

Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a feature branch from main.
  3. Add or update tests for behavior changes.
  4. Run checks before opening a PR:
go test ./...
go build ./...
  1. Open a pull request with a clear summary and rationale.

License

This project is licensed under the MIT License.

See LICENSE for details.

About

Lynx is a self-hosted, single-container URL shortener with authentication, admin user management, custom slugs, analytics, and a clean responsive UI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors