{"id":27392420,"url":"https://github.com/hafizcode02/nest-contact-api","last_synced_at":"2026-02-05T19:31:30.987Z","repository":{"id":263716375,"uuid":"885395158","full_name":"hafizcode02/nest-contact-api","owner":"hafizcode02","description":"Creating Management Contact API with Nest.js. including multi-role authentication, account activation with email, and multi option to use cloud storage for saving file","archived":false,"fork":false,"pushed_at":"2024-12-30T11:04:12.000Z","size":662,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T21:52:39.491Z","etag":null,"topics":["aws-s3","cloudflare-r2","google-cloud-storage","learning-project","multer","nestjs","nestjs-api","nodemailer","prisma","rest-api","swagger-ui","typescript","winston-logger"],"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/hafizcode02.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-11-08T14:00:11.000Z","updated_at":"2025-02-25T10:38:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"59ed818a-bd44-4cc3-b76c-53516a5cf459","html_url":"https://github.com/hafizcode02/nest-contact-api","commit_stats":null,"previous_names":["hafizcode02/nest-simple-api","hafizcode02/nest-contact-api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hafizcode02/nest-contact-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fnest-contact-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fnest-contact-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fnest-contact-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fnest-contact-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hafizcode02","download_url":"https://codeload.github.com/hafizcode02/nest-contact-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fnest-contact-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29130355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T18:55:47.139Z","status":"ssl_error","status_checked_at":"2026-02-05T18:55:04.010Z","response_time":65,"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":["aws-s3","cloudflare-r2","google-cloud-storage","learning-project","multer","nestjs","nestjs-api","nodemailer","prisma","rest-api","swagger-ui","typescript","winston-logger"],"created_at":"2025-04-13T21:52:16.654Z","updated_at":"2026-02-05T19:31:30.973Z","avatar_url":"https://github.com/hafizcode02.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo-small.svg\" width=\"120\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n  \u003cp align=\"center\"\u003eA progressive \u003ca href=\"http://nodejs.org\" target=\"_blank\"\u003eNode.js\u003c/a\u003e framework for building efficient and scalable server-side applications.\u003c/p\u003e\n    \u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/~nestjscore\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@nestjs/core.svg\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/~nestjscore\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@nestjs/core.svg\" alt=\"Package License\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/~nestjscore\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/@nestjs/common.svg\" alt=\"NPM Downloads\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://circleci.com/gh/nestjs/nest\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/circleci/build/github/nestjs/nest/master\" alt=\"CircleCI\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/nestjs/nest?branch=master\" target=\"_blank\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9\" alt=\"Coverage\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/G7Qnnhy\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/discord-online-brightgreen.svg\" alt=\"Discord\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/nest#backer\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/nest/backers/badge.svg\" alt=\"Backers on Open Collective\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/nest#sponsor\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/nest/sponsors/badge.svg\" alt=\"Sponsors on Open Collective\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://paypal.me/kamilmysliwiec\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-ff3f59.svg\" alt=\"Donate us\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://opencollective.com/nest#sponsor\"  target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg\" alt=\"Support us\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://twitter.com/nestframework\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/nestframework.svg?style=social\u0026label=Follow\" alt=\"Follow us on Twitter\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n  \u003c!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)\n  [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)--\u003e\n\n## Description\n\nMy Learning Project in Nest.JS. Creating an Simple Contact API, this project including Authentication based on stored token on database and automatically logout if token is expired, specify which role that can accessed some routes (can be spesifically access by 1 role or multiple role), automatically sending verification email after register and after verifed, setup configuration for using multer uploads and save the file into local, or famous cloud storage (Cloudflare R2, AWS S3, Google Cloud Storage).\n\n## Project Checklist\n\n### User Endpoint\n\n- [x] Register User\n- [x] Send Email to Verify User\n- [x] Verify User\n- [x] Send Welcome Email after User Verified.\n- [x] Login User\n- [x] Get Logged In User\n- [x] Update User Data\n- [x] Logout User\n\n### Contact Endpoint\n\n- [x] Get All Contact \u0026 Search Contact\n- [x] Create Contact\n- [x] Get Contact\n- [x] Update Contact\n- [x] Update Contact Image\n- [x] Delete Contact\n\n### Address Endpoint\n\n- [x] Get All Addresses in the Contact\n- [x] Create Addresses of Contact\n- [x] Get Address\n- [x] Update Address\n- [x] Delete Address\n\n### Todo\n\n- [ ] Make Endpoint for forgot password\n- [x] Setup Swagger UI\n- [x] Create setup for multer to upload in cloud bucket like Cloudflare R2/AWS S3/GCP Cloud Storage\n\n## Project Endpoint\n\nYou can see at **doc** folder or import the postman collection.\nor you can go to swagger api docs:\n\n[SWAGGER API DOCS](https://localhost:3000/api)\n\n## Project setup\n\n```bash\nnpm install\nnpx prisma init\n```\n\n## Setup your .env\n\n```bash\nDATABASE_URL=\"mysql://root:@localhost:3306/nest_contacts?schema=public\"\n\n# MAIL CONFIG\nMAIL_HOST=\"yourwebserver.domain.com\"\nMAIL_PORT=465\nMAIL_SECURE=true\nMAIL_USER=yourmail@domain.com\nMAIL_PASS=YourPassword\n\n# HASHIDS CONFIG\nHASHIDS_SALT=YOURSALT\n\n# STORAGE MODE\nSTORAGE=local # (local, r2, s3, gcp) : local (local server), r2 (cloudflare), s3 (aws), gcp(google cloud)\n\n## LOCAL UPLOADS\nUPLOAD_DIR=uploads # Directory for local uploads\n\n## CLOUDFLARE R2 STORAGE\nCLOUDFLARE_R2_ENDPOINT=https://\u003cyour-account-id\u003e.r2.cloudflarestorage.com\nCLOUDFLARE_R2_DEV_URL=\u003cyour-r2-dev-subdomain-public-url\u003e\nCLOUDFLARE_R2_ACCESS_KEY=\u003cyour-access-key-id\u003e\nCLOUDFLARE_R2_SECRET_KEY=\u003cyour-secret-access-key\u003e\nCLOUDFLARE_R2_BUCKET=\u003cyour-bucket-name\u003e\n\n## AWS S3 STORAGE\nAWS_REGION=us-west-2  # Replace with your actual region\nAWS_ACCESS_KEY_ID=your-access-key-id  # Replace with your actual access key ID\nAWS_SECRET_ACCESS_KEY=your-secret-access-key  # Replace with your actual secret access key\nAWS_BUCKET_NAME=your-s3-bucket-name  # Replace with your actual bucket name\n\nGCP_PROJECT_ID=your-gcp-project-id\nGCP_KEY_FILE=path/to/your/service-account-key.json\nGCP_BUCKET_NAME=your-gcs-bucket-name\n```\n\n## Run Prisma\n\n```bash\nnpx prisma migrate dev\n```\n\n## Compile and run the project\n\n```bash\n# development\n$ npm run start\n\n# watch mode\n$ npm run start:dev\n\n# production mode\n$ npm run start:prod\n```\n\n## Run tests\n\nMake sure you change the email for testing in **should be return 201 when request is valid and success register** at **user.spec.ts**\n\n```bash\n# unit tests (empty record in db)\n$ npm run test\n\n# have record in db (run partial)\n$ npm run test -- user.spec.ts\n$ npm run test -- contact.spec.ts\n$ npm run test -- address.spec.ts\n```\n\n## Another way to Run\n\nMore simple shortcut to use in windows :D\n\n```bash\nrun.bat dev|test|build|lint|prod\n```\n\n## Deployment\n\nWhen you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.\n\nIf you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:\n\n```bash\nnpm install -g mau\nmau deploy\n```\n\nWith Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.\n\n## Resources\n\nCheck out a few resources that may come in handy when working with NestJS:\n\n- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.\n- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).\n- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).\n- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.\n- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).\n- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).\n- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).\n- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).\n\n## Support\n\nNest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).\n\n## Stay in touch (Nest.Js Author)\n\n- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)\n- Website - [https://nestjs.com](https://nestjs.com/)\n- Twitter - [@nestframework](https://twitter.com/nestframework)\n\n## License\n\nNest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).\n","funding_links":["https://opencollective.com/nest","https://paypal.me/kamilmysliwiec"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafizcode02%2Fnest-contact-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhafizcode02%2Fnest-contact-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafizcode02%2Fnest-contact-api/lists"}