{"id":23063736,"url":"https://github.com/douglasvolcato/pet-adoption-backend-node","last_synced_at":"2026-04-02T03:04:39.021Z","repository":{"id":205896719,"uuid":"715347479","full_name":"DouglasVolcato/pet-adoption-backend-node","owner":"DouglasVolcato","description":"Backend created using Node with TDD and Clean Architecture.","archived":false,"fork":false,"pushed_at":"2023-12-02T03:40:03.000Z","size":602,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T08:14:41.921Z","etag":null,"topics":["clean-architecture","clean-code","express","express-js","expressjs","javascript","jest","jest-mocking","jest-test","jest-tests","node","node-js","nodejs","test-driven-development","testing","typescript"],"latest_commit_sha":null,"homepage":"https://pet-adoption-backend-production.up.railway.app/api-docs","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/DouglasVolcato.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":"2023-11-07T00:43:53.000Z","updated_at":"2023-12-04T03:48:04.000Z","dependencies_parsed_at":"2023-11-17T04:08:01.428Z","dependency_job_id":"29d7c4b0-0f41-4af4-9122-106e2302c36b","html_url":"https://github.com/DouglasVolcato/pet-adoption-backend-node","commit_stats":null,"previous_names":["douglasvolcato/pet-adoption-backend","douglasvolcato/pet-adoption-backend-node"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DouglasVolcato%2Fpet-adoption-backend-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DouglasVolcato%2Fpet-adoption-backend-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DouglasVolcato%2Fpet-adoption-backend-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DouglasVolcato%2Fpet-adoption-backend-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DouglasVolcato","download_url":"https://codeload.github.com/DouglasVolcato/pet-adoption-backend-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246961930,"owners_count":20861185,"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":["clean-architecture","clean-code","express","express-js","expressjs","javascript","jest","jest-mocking","jest-test","jest-tests","node","node-js","nodejs","test-driven-development","testing","typescript"],"created_at":"2024-12-16T04:12:46.696Z","updated_at":"2025-12-30T21:07:26.462Z","avatar_url":"https://github.com/DouglasVolcato.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pet Adoption Backend API\r\n\r\nThis repository contains the backend API for a pet adoption platform. The API allows users to log in, create new users, index pets from third-party APIs into the database, update pet statuses, and search for pets based on various parameters.\r\n\r\n## Table of Contents\r\n\r\n- [Getting Started](#getting-started)\r\n  - [Prerequisites](#prerequisites)\r\n  - [Installation](#installation)\r\n  - [Running the Application](#running-the-application)\r\n- [Testing](#testing)\r\n- [API Routes](#api-routes)\r\n  - [User Login](#user-login)\r\n  - [Create User](#create-user)\r\n  - [Index Pets into Database](#index-pets-into-database)\r\n  - [Update Pet Status](#update-pet-status)\r\n  - [Get Pets](#get-pets)\r\n- [Dependencies](#dependencies)\r\n- [License](#license)\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n\r\nMake sure you have the following software installed on your machine:\r\n\r\n- [Node.js](https://nodejs.org/)\r\n- [npm](https://www.npmjs.com/)\r\n\r\n### Installation\r\n\r\n1. Clone the repository:\r\n\r\n   ```bash\r\n   git clone https://github.com/DouglasVolcato/pet-adoption-backend.git\r\n   ```\r\n\r\n2. Navigate to the project directory:\r\n\r\n   ```bash\r\n   cd pet-adoption-backend\r\n   ```\r\n\r\n3. Install dependencies:\r\n\r\n   ```bash\r\n   npm install\r\n   ```\r\n\r\n4. Fulfill the .env variables\r\n\r\n### Running the Application\r\n\r\nRun the following command to start the application:\r\n\r\n```bash\r\nnpm start\r\n```\r\n\r\nThe API will be accessible at [http://localhost:3000](http://localhost:3000).\r\n\r\n## Testing\r\n\r\nTo run tests, use the following command:\r\n\r\n```bash\r\nnpm test\r\n```\r\n\r\nThis will execute unit and integration tests.\r\n\r\n## API Routes\r\n\r\n### User Login\r\n\r\n- **Endpoint:** `/login`\r\n- **Method:** `POST`\r\n- **Description:** User login\r\n- **Request Body:**\r\n  ```json\r\n  {\r\n    \"email\": \"user@example.com\",\r\n    \"password\": \"password123\"\r\n  }\r\n  ```\r\n- **Responses:**\r\n  - `200`: Successful login\r\n  - `400`: Bad request\r\n  - `500`: Internal server error\r\n\r\n### Create User\r\n\r\n- **Endpoint:** `/user`\r\n- **Method:** `POST`\r\n- **Description:** Create user\r\n- **Request Body:**\r\n  ```json\r\n  {\r\n    \"name\": \"John Doe\",\r\n    \"email\": \"john.doe@example.com\",\r\n    \"password\": \"password123\"\r\n  }\r\n  ```\r\n- **Responses:**\r\n  - `200`: Successful creation\r\n  - `400`: Bad request\r\n  - `500`: Internal server error\r\n\r\n### Index Pets into Database\r\n\r\n- **Endpoint:** `/pet`\r\n- **Method:** `POST`\r\n- **Description:** Index pets into the database\r\n- **Security:** Bearer Token\r\n- **Responses:**\r\n  - `200`: Successful request\r\n  - `401`: Unauthorized\r\n  - `500`: Internal server error\r\n\r\n### Update Pet Status\r\n\r\n- **Endpoint:** `/pet`\r\n- **Method:** `PUT`\r\n- **Description:** Update pet status\r\n- **Security:** Bearer Token\r\n- **Request Body:**\r\n  ```json\r\n  {\r\n    \"petId\": \"12345\",\r\n    \"newStatus\": \"free\"\r\n  }\r\n  ```\r\n- **Responses:**\r\n  - `200`: Successful update\r\n  - `400`: Bad request\r\n  - `401`: Unauthorized\r\n  - `500`: Internal server error\r\n\r\n### Get Pets\r\n\r\n- **Endpoint:** `/pet`\r\n- **Method:** `GET`\r\n- **Description:** Get pets\r\n- **Parameters:**\r\n  - `limit` (number)\r\n  - `offset` (number)\r\n  - `term` (string)\r\n  - `category` (string, \"cats\" or \"dogs\")\r\n  - `status` (string, \"free\" or \"adopted\")\r\n  - `createdAt` (string)\r\n- **Responses:**\r\n  - `200`: Successful request\r\n  - `400`: Bad request\r\n  - `500`: Internal server error\r\n\r\n## Dependencies\r\n\r\n- [axios](https://www.npmjs.com/package/axios)\r\n- [bcrypt](https://www.npmjs.com/package/bcrypt)\r\n- [body-parser](https://www.npmjs.com/package/body-parser)\r\n- [cors](https://www.npmjs.com/package/cors)\r\n- [dotenv](https://www.npmjs.com/package/dotenv)\r\n- [email-validator](https://www.npmjs.com/package/email-validator)\r\n- [express](https://www.npmjs.com/package/express)\r\n- [jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken)\r\n- [mongoose](https://www.npmjs.com/package/mongoose)\r\n- [swagger-ui-express](https://www.npmjs.com/package/swagger-ui-express)\r\n- [uuid](https://www.npmjs.com/package/uuid)\r\n\r\n## License\r\n\r\nThis project is licensed under the ISC License - see the [LICENSE.md](LICENSE.md) file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasvolcato%2Fpet-adoption-backend-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglasvolcato%2Fpet-adoption-backend-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasvolcato%2Fpet-adoption-backend-node/lists"}