{"id":13618043,"url":"https://github.com/sekunho/emojied","last_synced_at":"2025-04-05T00:09:06.386Z","repository":{"id":40651884,"uuid":"472270250","full_name":"sekunho/emojied","owner":"sekunho","description":"✂️ A URL shortener that uses emojis, only emojis.","archived":false,"fork":false,"pushed_at":"2025-02-22T09:54:17.000Z","size":385,"stargazers_count":184,"open_issues_count":2,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:08:16.411Z","etag":null,"topics":["emoji","rust","url-shortener"],"latest_commit_sha":null,"homepage":"https://emojied.net","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sekunho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["sekunho"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2022-03-21T09:36:49.000Z","updated_at":"2025-03-12T16:10:31.000Z","dependencies_parsed_at":"2024-04-18T12:49:36.664Z","dependency_job_id":null,"html_url":"https://github.com/sekunho/emojied","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sekunho%2Femojied","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sekunho%2Femojied/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sekunho%2Femojied/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sekunho%2Femojied/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sekunho","download_url":"https://codeload.github.com/sekunho/emojied/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266564,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emoji","rust","url-shortener"],"created_at":"2024-08-01T20:01:53.228Z","updated_at":"2025-04-05T00:09:06.372Z","avatar_url":"https://github.com/sekunho.png","language":"Rust","funding_links":["https://github.com/sponsors/sekunho"],"categories":["Rust"],"sub_categories":[],"readme":"# emojied\n\n![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/hsekun/emojied)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"emojied.png\" /\u003e\n\u003c/p\u003e\n\nShorten your URLs with emojis!\n\n## Features\n\n- Well, shorten your URLs!\n- Customize what emoji to use. e.g Want to use an eggplant emoji? Sure, as long\n  as it's not taken!\n- Not sure what emoji to use? `emojied` autogenerates one for you.\n- View URL clicks (simple stats for now)\n- Leaderboard - See the top 20 most clicked links!\n- Do you hate enabling JS? Well, this works completely fine with JS disabled!\\*\n\n\\* If you're using an extension to disable JS, then this will depend on if they\ncopied the noscript tag attributes cause the ones I've used don't. It's a bug.\n\n## Getting Started\n\nFor the dev environment, it's fairly simple to set up the project if you're\nalready using Nix (with Flakes). If not, then you'll need to get the dependencies\nyourself; sorry!\n\nHere are the versions of the important ones:\n\n- `rustc`: 1.67.1\n- `cargo`: 1.67.0\n- `postgresql`: 15.2\n- `sqitch`: 1.3.1\n- `tailwindcss`: 3.2.7\n- `esbuild`: 0.17.14\n- `typescript`: 4.9.5\n- `openssl`: 3.0.8 (7 Feb 2023)\n\nEverything else doesn't matter too much I think. You could probably just use\nwhatever version of `rust-analyzer` you have, for example.\n\nHowever, if you _do_ have Nix 2.7.0 (with Flakes), you probably know how to\nuse it anyway. `nix develop` (or don't if you have `nix-direnv` already), and\ndev away. You should probably also setup the PG server with `devenv up`, and\nrun the sqitch migration (see below) to avoid the hassle of setting up Postgres\nmanually. Otherwise, you need to set it up, and create a DB called\n`emojied_development` for local dev stuff.\n\nOnce you've done whatever to get all the dependencies, you can do the ff:\n\n```\nPGPASSWORD=emojied sqitch deploy\n\n# You can also do `cargo run` if you don't want to use `cargo-watch`.\nPG__DBNAME=\"YOUR_DB_NAME_HERE\" PG__HOST=\"localhost\" PG__USER=\"YOUR_USER_HERE\" PG__PORT=\"5432\" A\nPP__STATIC_ASSETS=\"./public\" cargo watch -x run\n```\n\nor if you're using `nix`:\n\n```\nPGPASSWORD=emojied sqitch deploy\nnix run\n```\n\nThis should run a server in port `3000`, which you can access in http://localhost:3000.\n\nOh, you want to set it up for a prod server? But why? (continue reading)\n\n### Prepping the binary for prod\n\nYou'll need the binary to run the server. You can prep it in a few ways:\n\n#### Docker image\n\nA docker image is available here: https://hub.docker.com/r/hsekun/emojied\n\n#### Pre-built binary\n\nNOTE: The binary requires some dynamic libs. Haven't figured\nout a way to get a static binary working. I wasn't able to double check properly.\n\n#### Build from source\n\nYou can build the binary, and static assets with `nix`. You can also build it\nsome other way if you prefer, but I'm not gonna bother with that.\n\nOptions:\n\n1. `nix build`: Builds `emojied`'s + static assets, and provides\nan `APP__STATIC_ASSETS` environment variable. This is the \"wrapped\" version.\n2. `nix build .#emojied-unwrapped`: Like above, but doesn't provide the env\nvariable.\n\nIn both, everything is already taken care of. \\#1 is more suitable for distributing\nit as an application.\n\n#### Build a `Docker` image\n\nIf ever you need a Docker image with `emojied`, then you'll need `nix` (flakes)\nto build it.\n\n```sh\n# Build the Docker image tar\nnix build .#emojied-docker\n\n# Load result to Docker\ndocker load \u003c result\n```\n\nFrom this, you get a Docker image `emojied-docker:latest`! If you want an example,\nyou can check out the `.github/workflows/main.yml`.\n\n### Environment variables\n\n`emojied` requires you to provide some environment variables, namely the ff:\n\n- `APP__STATIC_ASSETS` (required, path that directly contains `app.css`, etc.):\nPath of `public/`\n- `APP__PORT` (optional, defaults to `3000`)\n- `PG__HOST` (required)\n- `PG__DBNAME` (required)\n- `PG__USER` (required)\n- `PG__PASSWORD` (optional, defaults to nothing)\n- `PG__PASSWORD_FILE` (optional, defaults to nothing): File path to the file\ncontaining the DB's password.\n- `PG__PORT` (required)\n- `PG__POOL_SIZE` (optional, defaults to `22`)\n- `PG__CA_CERT` (optional, defaults to No TLS): CA certificate's file path\n- `CA_CERT` (optional): CA certificate's contents. This shouldn't contain the\n`BEGIN` and `END` certificate headers. See `bin/run`.\n\n### Schema migrations\n\nFinally, you'll need to migrate the database `emojied` will use. I'm using\n`sqitch` cause I'm poor, and need a schema migration tool that doesn't come with\nbroken kneecaps in the free tier. `sqitch` gets the job done here, and it's OSS.\n\n```sh\nSQITCH_PASSWORD=\"YOUR_DB_PASSWORD_HERE\" sqitch deploy \\\n  --db-host YOUR_DB_HOST_HERE \\\n  --db-port YOUR_DB_PORT_HERE \\\n  --db-user YOUR_DB_ADMIN_USERNAME_HERE \\\n  --db-name YOUR_DB_NAME_HERE\n```\n\nOf course, replace the `YOUR_*_HERE` with your actual database credentials. It\nshould say `ok` for everything. If it doesn't then you probably set something\nup in the DB incorrectly. Oh, the device you're running this command on, whether\nit be local or in some CI, it needs to be added to the trusted sources so that\nyou can actually communicate with the DB. I just temporarily add my PC as one\nof the trusted sources, then remove it after I've performed the migrations.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsekunho%2Femojied","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsekunho%2Femojied","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsekunho%2Femojied/lists"}