{"id":23105957,"url":"https://github.com/fcbento/node-prisma-docker-postgresql-ci","last_synced_at":"2025-04-03T22:25:03.757Z","repository":{"id":267553499,"uuid":"901602898","full_name":"fcbento/node-prisma-docker-postgresql-ci","owner":"fcbento","description":"Challenge to practice TDD, Docker containers, Prisma ORM, PostgreSQL, Node.js with TypeScript and Fastify for web framework. CI to run for unit and e2e tests","archived":false,"fork":false,"pushed_at":"2024-12-18T02:23:38.000Z","size":721,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T10:22:35.706Z","etag":null,"topics":[],"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/fcbento.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}},"created_at":"2024-12-11T01:06:53.000Z","updated_at":"2024-12-18T02:23:42.000Z","dependencies_parsed_at":"2024-12-15T04:16:47.342Z","dependency_job_id":null,"html_url":"https://github.com/fcbento/node-prisma-docker-postgresql-ci","commit_stats":null,"previous_names":["fcbento/node-prisma-docker-postgresql","fcbento/node-prisma-docker-postgresql-ci"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcbento%2Fnode-prisma-docker-postgresql-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcbento%2Fnode-prisma-docker-postgresql-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcbento%2Fnode-prisma-docker-postgresql-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcbento%2Fnode-prisma-docker-postgresql-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fcbento","download_url":"https://codeload.github.com/fcbento/node-prisma-docker-postgresql-ci/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247087578,"owners_count":20881414,"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":[],"created_at":"2024-12-17T00:55:37.471Z","updated_at":"2025-04-03T22:25:03.738Z","avatar_url":"https://github.com/fcbento.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Find a friend\n\nA project created to practice Docker, Node.js, TypeScript, Prisma, PostgreSQL, Fastify and Vitest. JWT for authentication and authorization. Also CI using Github actions for running both unit tests and e2e tests. Basically an application for animal adoption, using some of the SOLID principles. This was actually a challenge that I had to create for a Node.js course I'm currenly taking.\n\n## Prerequisites\n\nRequirements for running the app locally\n- [Docker](https://www.docker.com/)\n- [Node](https://nodejs.org/)\n- [Npm](https://www.npmjs.com/)\n\n\n## How to use\n\n```bash\n# Clone this repository\n$ git clone https://github.com/fcbento/node-prisma-docker-postgresql-ci.git\n\n# Go into the repository\n$ cd node-prisma-docker-postgresql-ci\n\n# Install dependencies\n$ npm install\n\n# Start container\n$ docker compose up --detach\n$ docker container ls\n\n# Create migrations\n$ prisma migrate dev\n\n# Run the app\n$ npm run start:dev\n\n# Unit tests\n$ npm run test\n\n# E2e tests\n$ npm run test:e2e\n```\n\n## Key Features\n\n### Application Rules\n\n- [x] It must be possible to register a pet  \n- [x] It must be possible to list all pets available for adoption in a city  \n- [x] It must be possible to filter pets by their characteristics  \n- [x] It must be possible to view details of a pet available for adoption  \n- [x] It must be possible to register as an ORG  \n- [x] It must be possible to log in as an ORG  \n\n### Business Rules\n\n- [x] To list the pets, it is mandatory to provide the city  \n- [x] An ORG must have an address and a WhatsApp number  \n- [x] A pet must be linked to an ORG  \n- [ ] The user who wants to adopt will contact the ORG via WhatsApp  \n- [x] All filters, except for the city, are optional  \n- [x] For an ORG to access the application as an admin, it must be logged in  \n\n### Tests Coverage\n\n| Metric       | Coverage | Covered | Total |\n|--------------|----------|---------|-------|\n| Statements   | 97.25%   | 248     | 255   |\n| Branches     | 98.46%   | 64      | 65    |\n| Functions    | 95.12%   | 39      | 41    |\n| Lines        | 97.25%   | 248     | 255   |\n\n\u003cimg alt=\"example\" width=\"800\" src=\"coverage-services.png\"\u003e\n\n### DB Schema\n\n\u003cimg alt=\"example\" width=\"800\" src=\"schema_db.png\"\u003e\n\n### TODO\n\n- [ ] Fix mixed language fields. Currently some fields of the PET and ORG tables are mixed using both Portuguese and English.\n- [ ] Validate empty id in routes that the id is passed as an arugment and ideally return a friendly error message\n- [ ] Validate if org_id is a valid id when registering a new pet\n- [ ] Validate if pet_id is a valid id when registering either a new photo or a new requirement\n- [ ] Check if it's possible to use a global zip postal code to populate fields ragarding the address of pet and org. Currently the zip code service (cep-api-service.ts) only works for zip codes in Brazil. I tried to use Zipcodestack, but the requisition was too slow.\n- [ ] Add swagger/openapi\n- [ ] Create CD and publish to some free hosting service\n \n## Built With\n\nThis was created with the following tech stack. I intend to create a front end using Angular with Nx.\n\n[![My Skills](https://skillicons.dev/icons?i=nodejs,typescript,docker,prisma,postgres,vscode,vitest,windows,githubactions\u0026perline=10)](https://skillicons.dev)\n\n#### To come\n[![My Skills](https://skillicons.dev/icons?i=angular,rxjs,firebase\u0026perline=3)](https://skillicons.dev)\n\n## Top contributors\n\n\u003ca href=\"https://github.com/fcbento/node-prisma-docker-postgresql-ci/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=fcbento/node-prisma-docker-postgresql-ci\" alt=\"contrib.rocks image\"/\u003e\n\u003c/a\u003e\n\n## Contact\n\n[![linkedin](https://skillicons.dev/icons?i=linkedin)](https://linkedin.com/in/felipe-bento)\n[![discord](https://skillicons.dev/icons?i=discord)](https://discordapp.com/users/413141379074490369)\n[![gmail](https://skillicons.dev/icons?i=gmail)](mailto:felipe.16costa@gmail.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcbento%2Fnode-prisma-docker-postgresql-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcbento%2Fnode-prisma-docker-postgresql-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcbento%2Fnode-prisma-docker-postgresql-ci/lists"}