{"id":30741790,"url":"https://github.com/laruschkaj/dog-adoption-api","last_synced_at":"2026-04-12T13:36:43.520Z","repository":{"id":311974018,"uuid":"1045730196","full_name":"Laruschkaj/dog-adoption-api","owner":"Laruschkaj","description":"A RESTful API for a dog adoption platform, built with Node.js, Express, and MongoDB. Includes features for user authentication, dog management, and testing.","archived":false,"fork":false,"pushed_at":"2025-08-28T04:12:15.000Z","size":5935,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-28T04:29:28.581Z","etag":null,"topics":["api-testing","backend","chai","express","express-js","mocha","mongodb","node-js","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Laruschkaj.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}},"created_at":"2025-08-27T16:18:16.000Z","updated_at":"2025-08-28T04:12:18.000Z","dependencies_parsed_at":"2025-08-28T04:44:07.586Z","dependency_job_id":null,"html_url":"https://github.com/Laruschkaj/dog-adoption-api","commit_stats":null,"previous_names":["laruschkaj/dog-adoption-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Laruschkaj/dog-adoption-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laruschkaj%2Fdog-adoption-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laruschkaj%2Fdog-adoption-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laruschkaj%2Fdog-adoption-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laruschkaj%2Fdog-adoption-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Laruschkaj","download_url":"https://codeload.github.com/Laruschkaj/dog-adoption-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laruschkaj%2Fdog-adoption-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273534564,"owners_count":25122679,"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-09-03T02:00:09.631Z","response_time":76,"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":["api-testing","backend","chai","express","express-js","mocha","mongodb","node-js","nodejs","rest-api"],"created_at":"2025-09-04T01:02:12.567Z","updated_at":"2026-04-12T13:36:43.492Z","avatar_url":"https://github.com/Laruschkaj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dog Adoption Platform API\nA RESTful API for a dog adoption platform, built with Node.js, Express, and MongoDB. This application allows users to register, authenticate, manage dogs for adoption, and adopt dogs from other users.\n\nFeatures\nUser Authentication: JWT-based authentication with 24-hour token validity\nDog Management: Register dogs for adoption with name and description\nDog Adoption: Adopt available dogs with thank-you messages\nDog Removal: Remove your own dogs (if not adopted)\nList Management: View your registered and adopted dogs with pagination\nSecurity: Password hashing, rate limiting, CORS protection\nTesting: Comprehensive test suite with Mocha and Chai\nModern Frontend: Beautiful, responsive web interface\nTechnologies Used\nBackend: Node.js, Express.js, MongoDB, Mongoose\nAuthentication: JWT, bcryptjs\nSecurity: Helmet, CORS, express-rate-limit\nTesting: Mocha, Chai, chai-http\nFrontend: HTML5, CSS3, JavaScript, Lucide Icons\nQuick Start\nPrerequisites\nNode.js (v16 or higher)\nMongoDB Atlas account\nGit\nInstallation\nClone the repository\nbash\ngit clone https://github.com/yourusername/dog-adoption-api.git\ncd dog-adoption-api\nInstall dependencies\nbash\nnpm install\nSet up environment variables Update .env file with your MongoDB Atlas credentials:\nbash\nMONGODB_URI=mongodb+srv://username:password@cluster0.xxxxx.mongodb.net/dog-adoption-dev?retryWrites=true\u0026w=majority\nDB_NAME=dog-adoption-dev\nTEST_DB_NAME=dog-adoption-test\nPORT=3000\nNODE_ENV=development\nJWT_SECRET=your-super-long-random-jwt-secret-string-here\nALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001\nSeed the database with sample data\nbash\nnpm run seed\nStart the server\nbash\n# Development mode\nnpm run dev\n\n# Production mode\nnpm start\nOpen the application Visit http://localhost:3000 in your browser to access the web interface.\nAPI Documentation\nBase URL\nhttp://localhost:3000/api\nAuthentication Endpoints\nRegister User\nhttp\nPOST /api/auth/register\nContent-Type: application/json\n\n{\n  \"username\": \"johndoe\",\n  \"password\": \"securepassword123\"\n}\nLogin User\nhttp\nPOST /api/auth/login\nContent-Type: application/json\n\n{\n  \"username\": \"johndoe\",\n  \"password\": \"securepassword123\"\n}\nDog Management Endpoints\nAll dog endpoints require authentication via JWT token in the Authorization header:\n\nAuthorization: Bearer \u003cyour_jwt_token\u003e\nRegister a Dog\nhttp\nPOST /api/dogs\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"name\": \"Buddy\",\n  \"description\": \"A friendly golden retriever looking for a loving home\",\n  \"imageUrl\": \"https://example.com/dog-image.jpg\"\n}\nAdopt a Dog\nhttp\nPUT /api/dogs/:id/adopt\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"thankYouMessage\": \"Thank you for taking such good care of Buddy!\"\n}\nRemove a Dog\nhttp\nDELETE /api/dogs/:id\nAuthorization: Bearer \u003ctoken\u003e\nGet Registered Dogs\nhttp\nGET /api/dogs/registered?status=available\u0026page=1\u0026limit=10\nAuthorization: Bearer \u003ctoken\u003e\nGet Adopted Dogs\nhttp\nGET /api/dogs/adopted?page=1\u0026limit=10\nAuthorization: Bearer \u003ctoken\u003e\nTesting\nRun the comprehensive test suite:\n\nbash\n# Run all tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\nThe test suite includes:\n\nUser registration and authentication tests\nDog management operation tests\nError handling and edge case tests\nDatabase operation tests\nTest Database\nThe application uses a separate test database to avoid affecting development data. Update .env.test with your test database credentials.\n\nProject Structure\ndog-adoption-api/\n├── controllers/           # Request handlers and business logic\n├── middleware/           # Custom middleware functions\n├── models/              # Database schemas and models\n├── routes/              # API route definitions\n├── tests/               # Test files\n├── scripts/             # Utility scripts (seeding, etc.)\n├── public/              # Static files (web interface)\n├── .env                 # Environment variables\n├── .env.test           # Test environment variables\n├── app.js              # Main application file\n├── db.js               # Database connection\n└── package.json        # Dependencies and scripts\nSample Users\nAfter running the seed script, you can use these credentials to test the application:\n\nUsername: sarah_loves_dogs, Password: password123\nUsername: mike_adoption_center, Password: password123\nUsername: emma_rescue_volunteer, Password: password123\nSecurity Features\nPassword hashing with bcryptjs\nJWT authentication with 24-hour expiration\nRate limiting (100 requests per 15 minutes)\nCORS protection\nSecurity headers with Helmet.js\nInput validation and sanitization\nDevelopment\nbash\n# Start development server\nnpm run dev\n\n# Run tests\nnpm test\n\n# Seed database\nnpm run seed\nContributing\nFork the repository\nCreate a feature branch (git checkout -b feature/amazing-feature)\nCommit your changes (git commit -m 'Add amazing feature')\nPush to the branch (git push origin feature/amazing-feature)\nOpen a Pull Request\nLicense\nThis project is licensed under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaruschkaj%2Fdog-adoption-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaruschkaj%2Fdog-adoption-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaruschkaj%2Fdog-adoption-api/lists"}