{"id":29871472,"url":"https://github.com/vasil-sarandev/compactly","last_synced_at":"2026-04-11T17:46:02.119Z","repository":{"id":304973875,"uuid":"1020620602","full_name":"vasil-sarandev/compactly","owner":"vasil-sarandev","description":"Compactly is an Open-Source URL Shortener that utilizes microservices, distributed transactions, containerization, message brokers, and caching within a monorepo.","archived":false,"fork":false,"pushed_at":"2025-09-19T13:41:22.000Z","size":406,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-19T15:43:48.786Z","etag":null,"topics":["distributed-transactions","docker","express","kafka","microservices","mongodb","monorepo","node","redis"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vasil-sarandev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-16T06:36:26.000Z","updated_at":"2025-09-19T13:41:26.000Z","dependencies_parsed_at":"2025-07-17T18:41:52.401Z","dependency_job_id":"eaf3184b-d63c-4e54-b644-9e3dcb5698d0","html_url":"https://github.com/vasil-sarandev/compactly","commit_stats":null,"previous_names":["vasil-sarandev/url-shortener","vasil-sarandev/compactly"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vasil-sarandev/compactly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasil-sarandev%2Fcompactly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasil-sarandev%2Fcompactly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasil-sarandev%2Fcompactly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasil-sarandev%2Fcompactly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vasil-sarandev","download_url":"https://codeload.github.com/vasil-sarandev/compactly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasil-sarandev%2Fcompactly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31689762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["distributed-transactions","docker","express","kafka","microservices","mongodb","monorepo","node","redis"],"created_at":"2025-07-30T19:46:33.141Z","updated_at":"2026-04-11T17:46:02.114Z","avatar_url":"https://github.com/vasil-sarandev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compactly - OSS URL Shortener\n\n`compactly` is an Open-Source URL Shortener that utilizes microservices, distributed transactions, containerization, message brokers, and caching within a monorepo.\n\n## Built with\n\n- Backend: Node, Express, TypeScript, Apache Kafka, Redis, MongoDB\n- Dev/Infra: Microservices, Docker, Turborepo\n\n## What's inside?\n\n### Applications\n\n- `apps/api`: the NodeJS server that exposes an API that serves redirects for shortened URLs or allows users to create new shortened urls for a targetURL by picking up pre-generated slugs from the slug pool.\n- `apps/pool-manager`: a NodeJS microservice that takes care of refilling the pool with available slugs for short urls. It consumes Kafka messages which are published by the `apps/api` to know when to do so.\n- `apps/analytics`: a NodeJS microservice that consumes Kafka Messages published by the `apps/api` and handles the analytics updates to the database.\n\n### Packages\n\nShared Configs/Packages between the apps.\n\n- `packages/shared` - shared models, schemas, constants, and utility files that are reused between applications.\n- `packages/tooling` - shared dev tooling and dev tooling configuration.\n\n## Prerequisites\n\n- **Node \u003e v22**\n- **Docker**\n  The microservices within the Monorepo are containerized. Commands are exposed that allow you to run them without Docker, but you'll also have to setup your own Kafka/MongoDB instances.\n  [Docker Desktop - docker.com](https://www.docker.com/products/docker-desktop/)\n\n## Docker Compose setups\n\n- **docker-compose.dev.yaml**\n  The Docker Compose setup for development.\n  Runs all microservices in development mode with HMR and also runs the shared services - MongoDB, Redis, Kafka.\n- **docker-compose.yaml**\n  The Docker Compose setup for production.\n  Compiles all microservices and runs them with the production environment inside a Docker Container. Also - doesn't run any shared services because they supposedly live in the Cloud or on a VPS at this point.\n\n## Running the Applications\n\nUse the `.env.sample` file and create `.env` files in the specific application folders.\n\n```\nnpm run dev\n```\n\nAlternatively if you don't want to run with Docker for some reason - install the dependencies and use turbo's dev command. Reminder - you'll have to configure and run the shared services on your local machine (MongoDB, Kafka, Redis, ...etc)\n\n```\nnpm install \u0026\u0026 npm run turbo:dev\n```\n\n## Building the Applications / Running in production mode\n\nThe _build_ command compiles all microservices and runs them with their production environment configuration inside a Docker Container.\n\n```\nnpm run build\n```\n\n... or you can just build the apps with Turborepo and then run them all together or individually if that's what you need.\n\n```\nnpm install \u0026\u0026 npm run turbo:build\n```\n\n## Turborepo Documentation\n\nYou can run or build individual microservices by themselves by adjusting the build/run commands.\n\nTo learn more about how to do that - please refer to [Turborepo Docs](https://turborepo.com/docs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasil-sarandev%2Fcompactly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasil-sarandev%2Fcompactly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasil-sarandev%2Fcompactly/lists"}