{"id":15896798,"url":"https://github.com/msutkowski/url-shortener","last_synced_at":"2025-10-14T10:03:24.367Z","repository":{"id":49093965,"uuid":"381149220","full_name":"msutkowski/url-shortener","owner":"msutkowski","description":"A simple url shortener","archived":false,"fork":false,"pushed_at":"2021-06-29T07:56:15.000Z","size":985,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-16T13:22:39.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/msutkowski.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}},"created_at":"2021-06-28T20:07:09.000Z","updated_at":"2021-06-29T07:56:18.000Z","dependencies_parsed_at":"2022-09-01T22:41:47.207Z","dependency_job_id":null,"html_url":"https://github.com/msutkowski/url-shortener","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/msutkowski/url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msutkowski%2Furl-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msutkowski%2Furl-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msutkowski%2Furl-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msutkowski%2Furl-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msutkowski","download_url":"https://codeload.github.com/msutkowski/url-shortener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msutkowski%2Furl-shortener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278703572,"owners_count":26031205,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-06T09:22:53.689Z","updated_at":"2025-10-07T01:00:20.066Z","avatar_url":"https://github.com/msutkowski.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\n\nThis is a full-stack [Nest](https://nestjs.com/) and\n[React](https://reactjs.org/) project. The frontend uses the\n[Chakra](https://chakra-ui.com/) design framework to accelerate development. The\nentire stack is written in TypeScript, with an auto-generated API client for\nReact consumption _(useXQuery, useXMutation)_ by leveraging\n[redux-toolkit/query](https://redux-toolkit.js.org/rtk-query/overview) and\n[rtk-query-codgen](https://github.com/rtk-incubator/rtk-query-codegen).\n\nThe latest version of the `main` branch can be seen running at\n[https://go.msutkowski.com](https://go.msutkowski.com) - it's deployed\nautomatically via Cloudflare Pages and Heroku.\n\n### Development\n\nRequires:\n\n- [`docker`](https://docs.docker.com/install/)\n- [`docker-compose`](https://docs.docker.com/compose/install/)\n- Ensure you've allocated Docker **at least** 4GB of RAM for development - but\n  the more the better :)\n\n## Getting started\n\nThis project is designed to work with `yarn`. If you don't have `yarn`\ninstalled, you can install it with `npm install -g yarn`. The Docker setup\nalready has `yarn` \u0026 `npm` installed and configured.\n\nTo get started, please run:\n\n```sh\ncp env.example .env # you should change the db password here, but optional as we're in a no-risk temporary container\nyarn install\nexport UID; yarn docker setup # if the container fails to come up, run `export UID; yarn docker up`, then rerun setup\nexport UID; yarn docker dev # or alternatively, you can open the project in vscode and connect to the remote container at this point. See more info below\nyarn dev # once inside the dev prompt of the container.\n```\n\nAt this point, Nest and CRA will both start and the app will be accessible here:\n\n- **Client:** http://localhost:5678/\n- **API:** http://localhost:5679/\n\n**NOTE:** `export UID` is important on Linux Docker hosts, otherwise the files\nand folders created by Docker will end up owned by root, which is non-optimal.\nFor ease of long-term use, you should add `export UID` to your `~/.profile` or\n`~/.zshrc` etc.\n\nOnce docker is setup, you can run tests, lint, etc by connecting to the server:\n\n```sh\nexport UID; yarn docker dev # skip this if you're in the remote container\n# once connected in a bash terminal\nyarn install\nyarn lint\n# run server tests\nyarn server test\n# run client tests\nyarn client test\n```\n\nOptionally, I would recommend using the vscode remote containers to connect to\nthe container. Once started, you'll be in a shell and a full IDE on the remote.\n\n### Further development\n\n#### Writing any new code\n\nUse the devcontainer\n[as mentioned in the packages/docker/README](./packages/docker/README.md) to\navoid potential file permissions issues. Each OS is different, and this can\ncause many headaches. The other alternative is to just run the database in\ndetached mode and then develop locally.\n\n#### Generating a new API client for React apps\n\nIf you introduce new routes that you need to consume on the client, you can run\n`yarn client generate:api-client` - just make sure that your nest dev server is\nrunning and the swagger docs are reachable\n([more info](./packages/server/README.md#swagger)). It's a good idea to make\nsure your swagger docs look good before doing this - but it's not necessary. For\nbrevity's sake, this project currently modifies the `operationId` to have better\nnamed hooks (eg: `useCreateLinkMutation` instead of\n`useLinkController_CreateLinkMutation`)\n\n#### Updating DB schemas, running migrations, and generating clients\n\nIf you modify the prisma schema, you will need to `yarn db p migrate dev` to\ncreate and run a migration, then most likely `yarn db p generate` to update the\nprisma client. If you do not see the changes reflect in your types, you _may_\nneed to run `yarn install` again. In the long term, this issue would be solved\nby bumping versions in the `db` package when the schema changes, and linking\nthat version in the `server` package.\n\n#### Troubleshooting\n\nIf you run into file permissions issues for whatever reason, these commands\nshould help bail you out:\n\n```\nchmod -R a+rX,u+rwX .\nchown yourusername:yourgroup -R .\n```\n\n\u003e a+rX,u+rwX - for all, add read permissions and set execute on folders, for\n\u003e user add read and write and set execute on folders\n\n### Todos\n\n- [] API/Client: Real e2e tests\n- [] Cypress\n- [] API: Error handling and standardization (errors should be piped into a\n  format with a message property, validation errors, etc)\n- [x] API: Simple logging example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsutkowski%2Furl-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsutkowski%2Furl-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsutkowski%2Furl-shortener/lists"}