| --- |
| title: CreepURL |
| sdk: docker |
| emoji: π¦ |
| colorFrom: yellow |
| colorTo: red |
| --- |
| # CreepURL |
|
|
| > **"Destroy trust beautifully."** |
|
|
| A full-stack URL shortener that transforms normal URLs into computationally cursed, infrastructure-style slugs. Built with Go + SQLite (zero external dependencies) and React + Framer Motion. |
|
|
| All generated URLs are **real working redirects** β click one and it sends you back to the original URL. |
|
|
| --- |
|
|
| ## Instant Start (No database setup required) |
|
|
| ```bash |
| # Clone |
| git clone https://github.com/yourname/creepurl.git |
| cd creepurl |
| |
| # Backend β SQLite file auto-created on first run |
| cd backend |
| cp .env.example .env |
| go mod tidy |
| go run main.go |
| |
| # Frontend β open a new terminal |
| cd frontend |
| npm install |
| npm run dev |
| ``` |
|
|
| Open `http://localhost:3000`. Done. |
|
|
| The backend creates `backend/creepurl.db` automatically on first startup. No Postgres. No pgAdmin. No Docker. No setup. |
|
|
| --- |
|
|
| ## Tech Stack |
|
|
| ### Frontend |
| | Tech | Purpose | |
| |---|---| |
| | React 18 + TypeScript | UI framework | |
| | Tailwind CSS | Styling | |
| | Framer Motion | Animations | |
| | Vite | Build tooling | |
| | Axios | HTTP client | |
|
|
| ### Backend |
| | Tech | Purpose | |
| |---|---| |
| | Go 1.21 | Server language | |
| | Fiber v2 | HTTP framework | |
| | SQLite (modernc.org/sqlite) | Embedded database β zero install | |
| | godotenv | Env config | |
|
|
| --- |
|
|
| ## Project Structure |
|
|
| ``` |
| creepurl/ |
| βββ frontend/ |
| β βββ src/ |
| β β βββ components/ |
| β β β βββ layout/ |
| β β β β βββ Navbar.tsx |
| β β β β βββ Footer.tsx |
| β β β βββ features/ |
| β β β βββ BackgroundEffects.tsx |
| β β β βββ Hero.tsx |
| β β β βββ InputPanel.tsx |
| β β β βββ DestructionSlider.tsx |
| β β β βββ URLCard.tsx |
| β β β βββ ResultsSection.tsx |
| β β β βββ MetricsPanel.tsx |
| β β β βββ ErrorState.tsx |
| β β βββ hooks/ |
| β β β βββ useTransform.ts |
| β β βββ services/ |
| β β β βββ api.ts |
| β β βββ lib/ |
| β β β βββ utils.ts |
| β β βββ App.tsx |
| β β βββ main.tsx |
| β β βββ index.css |
| β βββ index.html |
| β βββ package.json |
| β βββ vite.config.ts |
| β βββ tailwind.config.js |
| β βββ tsconfig.json |
| β |
| βββ backend/ |
| βββ config/ |
| β βββ config.go β DB_PATH env var |
| βββ database/ |
| β βββ database.go β SQLite connect + migrate |
| β βββ migrations.sql β Reference schema (auto-runs on startup) |
| βββ generators/ |
| β βββ corruption.go β Display URL generator |
| β βββ slug.go β URL-safe slug generator |
| βββ handlers/ |
| β βββ transform.go β POST /api/transform |
| β βββ redirect.go β GET /:slug + GET /api/stats/:slug |
| βββ middleware/ |
| β βββ middleware.go |
| βββ models/ |
| β βββ models.go |
| βββ routes/ |
| β βββ routes.go |
| βββ services/ |
| β βββ shortener.go β DB persistence + lookup + click tracking |
| β βββ transform.go β Business logic + trust metrics |
| βββ main.go |
| βββ go.mod |
| βββ .env.example |
| βββ creepurl.db β Auto-created on first run (gitignored) |
| ``` |
|
|
| --- |
|
|
| ## Environment Variables |
|
|
| ### Backend (`backend/.env`) |
|
|
| | Variable | Default | Description | |
| |---|---|---| |
| | `PORT` | `8080` | Server port | |
| | `BASE_URL` | `http://localhost:8080` | Used to build full short URLs | |
| | `DB_PATH` | `./creepurl.db` | SQLite file path | |
| | `ENVIRONMENT` | `development` | Runtime label | |
|
|
| ### Frontend (`frontend/.env`) |
|
|
| | Variable | Default | Description | |
| |---|---|---| |
| | `VITE_API_URL` | `/api` | Backend API base path | |
|
|
| --- |
|
|
| ## API Documentation |
|
|
| ### `POST /api/transform` |
|
|
| Generates cursed slugs, persists them, returns real short URLs. |
|
|
| **Request:** |
| ```json |
| { |
| "url": "https://google.com", |
| "destruction_level": 4 |
| } |
| ``` |
|
|
| **Response:** |
| ```json |
| { |
| "links": [ |
| { |
| "slug": "sh-g00g__relay882--voidxr09", |
| "full_short_url": "http://localhost:8080/sh-g00g__relay882--voidxr09", |
| "display_url": "http://localhost:8080/sh-g00g__relay882--voidxr09" |
| } |
| ], |
| "metrics": { |
| "trust_stability": "14%", |
| "packet_integrity": "Corrupted", |
| "machine_confidence": "Collapsed", |
| "human_readability": "Terminal" |
| } |
| } |
| ``` |
|
|
| --- |
|
|
| ### `GET /:slug` |
|
|
| Redirects to the original URL. Increments click count. |
|
|
| ``` |
| GET /sh-g00g__relay882--voidxr09 |
| β 301 https://google.com |
| ``` |
|
|
| --- |
|
|
| ### `GET /api/stats/:slug` |
|
|
| Returns analytics for a slug without redirecting. |
|
|
| ```json |
| { |
| "slug": "sh-g00g__relay882--voidxr09", |
| "original_url": "https://google.com", |
| "full_short_url": "http://localhost:8080/sh-g00g__relay882--voidxr09", |
| "click_count": 42, |
| "created_at": "2025-01-01T00:00:00Z", |
| "last_clicked_at": "2025-01-02T12:00:00Z" |
| } |
| ``` |
|
|
| --- |
|
|
| ### `GET /health` |
|
|
| ```json |
| { "status": "operational", "version": "1.0.0" } |
| ``` |
|
|
| --- |
|
|
| ## Destruction Levels |
|
|
| | Level | Name | Slug style | |
| |---|---|---| |
| | 1 | Slightly Suspicious | `google-rel-x77` | |
| | 2 | Corrupted | `g00gle-relay-x77` | |
| | 3 | Infrastructure Horror | `g00g__relay-shad-x77` | |
| | 4 | Machine Corruption | `sh-g00g__relay882-void` | |
| | 5 | Computational Collapse | `s-g0__re882__voidxr09` | |
|
|
| --- |
|
|
| ## How the Slug Engine Works |
|
|
| ``` |
| Input: https://google.com |
| β |
| Extract domain fragment: "google" β "g00g" (char mutation) |
| β |
| Inject infra word: relay, cache, frag, sync... |
| β |
| Inject corruption word: shadow, void, echo... |
| β |
| Inject machine ID: x77, xr09, 882, v0id... |
| β |
| Combine with separator: __, --, - |
| β |
| Slug: sh-g00g__relay882--void |
| β |
| Store in SQLite β return http://localhost:8080/sh-g00g__relay882--void |
| β |
| Click link β 301 β https://google.com |
| ``` |
|
|
| --- |
|
|
| ## Building for Production |
|
|
| ### Backend binary |
|
|
| ```bash |
| cd backend |
| go build -o creepurl-server main.go |
| ./creepurl-server |
| ``` |
|
|
| ### Frontend static build |
|
|
| ```bash |
| cd frontend |
| npm run build |
| # Output: frontend/dist/ |
| ``` |
|
|
| --- |
|
|
| ## Deployment |
|
|
| ### Frontend β Vercel |
|
|
| ```bash |
| cd frontend |
| npx vercel --prod |
| ``` |
|
|
| Set `VITE_API_URL` to your backend URL in Vercel dashboard. |
|
|
| ### Backend β Fly.io |
|
|
| ```bash |
| cd backend |
| fly launch |
| fly deploy |
| ``` |
|
|
| Set `BASE_URL` to your deployed domain in Fly secrets: |
| ```bash |
| fly secrets set BASE_URL=https://your-app.fly.dev |
| ``` |
|
|
| SQLite works great on single-instance deployments. For multi-instance scaling, swap `modernc.org/sqlite` driver for `lib/pq` and point `DB_PATH` at a Postgres connection string β the `database/sql` interface is identical, so only `database.go` changes. |
|
|
| --- |
|
|
| ## Gitignore additions |
|
|
| Add to your `.gitignore`: |
|
|
| ``` |
| backend/creepurl.db |
| backend/creepurl.db-shm |
| backend/creepurl.db-wal |
| backend/.env |
| frontend/.env |
| ``` |
|
|
| --- |
|
|
| ## License |
|
|
| MIT |
|
|
| --- |
|
|
| > β οΈ All generated slugs and display URLs are for satirical/portfolio purposes. The redirect system is real and functional. |