{"id":14978610,"url":"https://github.com/tonidarodda/nestjs-template","last_synced_at":"2025-10-28T11:30:31.868Z","repository":{"id":251428685,"uuid":"837251173","full_name":"ToniDarodda/nestjs-template","owner":"ToniDarodda","description":"NestJS template for projects with TypeOrm, featuring account management, authentication, emailing, caching, compression, scheduled tasks, and S3.","archived":false,"fork":false,"pushed_at":"2024-09-10T09:02:26.000Z","size":407,"stargazers_count":15,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T14:21:14.426Z","etag":null,"topics":["caching","compression","emailing","nest","nestjs","nestjs-backend","s3","swagger","tasks","template","template-project","typeorm","websocket"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ToniDarodda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-08-02T14:32:45.000Z","updated_at":"2025-01-05T14:34:09.000Z","dependencies_parsed_at":"2024-09-28T01:41:02.518Z","dependency_job_id":"160821dd-99f7-433a-b466-a7ac1d4c8453","html_url":"https://github.com/ToniDarodda/nestjs-template","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"1127bab92b1dd3e88e635e4bce462c69e21be3c7"},"previous_names":["tonidarodda/nestmonolithtemplate","tonidarodda/nestjs-template"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToniDarodda%2Fnestjs-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToniDarodda%2Fnestjs-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToniDarodda%2Fnestjs-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToniDarodda%2Fnestjs-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ToniDarodda","download_url":"https://codeload.github.com/ToniDarodda/nestjs-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238638190,"owners_count":19505557,"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":["caching","compression","emailing","nest","nestjs","nestjs-backend","s3","swagger","tasks","template","template-project","typeorm","websocket"],"created_at":"2024-09-24T13:58:01.597Z","updated_at":"2025-10-28T11:30:26.513Z","avatar_url":"https://github.com/ToniDarodda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n# NestJS Template\n\n![NestJS](https://img.shields.io/badge/NestJS-7E1E9C?style=for-the-badge\u0026logo=nestjs\u0026logoColor=white)\n![TypeORM](https://img.shields.io/badge/TypeORM-FF7A59?style=for-the-badge\u0026logo=typeorm\u0026logoColor=white)\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-336791?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n![PNPM](https://img.shields.io/badge/PNPM-4D4D4D?style=for-the-badge\u0026logo=pnpm\u0026logoColor=white)\n![License](https://img.shields.io/badge/License-LICENSED-green?style=for-the-badge)\n\nThis project is a NestJS template that includes various features such as user account management, authentication, authorization, email integration, caching, compression, centralized error handling, input validation, logging, scheduled tasks, and file upload to S3.\n\n## Features\n\n- 👤 **User Account Management**\n  - Sign-up, Sign-in, Get user, Update user, Delete user\n- 🔐 **Authentication and Authorization**\n  - JWT-based authentication, role-based authorization\n- ✉️ **Email Integration**\n  - Send emails using Nodemailer\n- 💾 **Caching**\n  - Optimize responses for frequently requested endpoints\n- ❌ **Centralized Error Handling**\n  - Global exception filter to handle all errors consistently\n- ✅ **Input Validation**\n  - Validate user inputs using class-validator\n- 📓 **Logging**\n  - Log application activities and errors\n- 🗂 **Compression**\n  - Compress HTTP responses to improve performance\n- ⏰ **Scheduled Tasks**\n  - Perform periodic tasks using CRON jobs\n- 📤 **File Upload to S3**\n  - Upload and retrieve files from Amazon S3\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js (v14 or higher)\n- PostgreSQL\n- Email service credentials (e.g., Gmail SMTP)\n- AWS S3 credentials for file upload\n\n### Installation\n\n1. Clone the repository\n\n   ```sh\n   git clone https://github.com/ToniDarodda/NestMonolithTemplate.git\n   cd NestMonolithTemplate\n   ```\n\n2. Install dependencies\n\n   ```sh\n   pnpm install\n   ```\n\n3. Update the `.env` file in the root directory and configure environment variables:\n   ```sh\n     EMAIL_PASS='Your password'\n   ```\n\n\n### Running the Application\n\n1. Start the PostgreSQL database\n\n2. Run the application\n\n   ```sh\n   pnpm run start:dev\n   ```\n\n3. The API will be available at `http://localhost:3000`\n\n### API Documentation\n\nThe API documentation is available at `http://localhost:3000/api`.\n\n## 📄 Usage\n\n### User Account Management\n\n- **🚪 Sign Up**\n\n  ```http\n  POST /account/sign-up\n  ```\n\n  Request Body:\n\n  ```json\n  {\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"email\": \"john.doe@example.com\",\n    \"phoneNumber\": \"1234567890\",\n    \"password\": \"password\",\n    \"country\": \"USA\"\n  }\n  ```\n\n- **🔑 Sign In**\n\n  ```http\n  POST /account/sign-in\n  ```\n\n  Request Body:\n\n  ```json\n  {\n    \"email\": \"john.doe@example.com\",\n    \"password\": \"password\"\n  }\n  ```\n\n- **👤 Get User Information**\n\n  ```http\n  GET /account\n  ```\n\n  Requires JWT Authentication and User Role\n\n- **📝 Update User Information**\n\n  ```http\n  PATCH /account\n  ```\n\n  Requires JWT Authentication and User Role\n\n  Request Body:\n\n  ```json\n  {\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"phoneNumber\": \"1234567890\",\n    \"country\": \"USA\"\n  }\n  ```\n\n- **🗑️ Delete User Account**\n\n  ```http\n  DELETE /account\n  ```\n\n  Requires JWT Authentication and User Role\n\n### File Upload to S3\n\n- **📤 Upload File**\n\n  ```http\n  POST /file/upload\n  ```\n\n  Requires JWT Authentication\n\n  Request Body: Form-data with `file` field\n\n- **📥 Get File**\n\n  ```http\n  GET /file/:fileName\n  ```\n\n  Requires JWT Authentication\n\n## 🧪 Testing\n\nTo run the tests, use the following command:\n\n```sh\npnpm run test\n```\n\n## 🛠️ Scripts\n\n- `🔨 build`: Build the application\n- `🧹 format`: Format the code using Prettier\n- `🏃‍♂️ start`: Start the application\n- `👨‍💻 start:dev`: Start the application in development mode\n- `🐞 start:debug`: Start the application in debug mode\n- `🚀 start:prod`: Start the application in production mode\n- `🔍 lint`: Lint the code using ESLint\n- `🧪 test`: Run the tests\n- `📦 migration:generate`: Generate a new database migration\n- `🚚 migration:run`: Run the database migrations\n- `🕵️‍♂️ test:watch`: Run the tests in watch mode\n- `📊 test:cov`: Run the tests and generate coverage report\n- `🐛 test:debug`: Run the tests in debug mode\n- `🧪 test:e2e`: Run end-to-end tests\n\n## 📜 License\n\nThis project is licensed under the UNLICENSED License.\n\n## 👤 Author\n\n[Toni Da Rodda](mailto:toni.da.rodda.pro@gmail.com)\n\n## 🛠️ Icons\n\n- 🚀 Deployment\n- ⚙️ Configuration\n- 📄 Documentation\n- 🔧 Maintenance\n- 🔒 Security\n- 📫 Email Integration\n- 📈 Performance Optimization\n- ⚡ Gain Time\n\n---\n\nFeel free to contribute to this project by submitting issues or pull requests.\n\nFor any questions or support, please contact [Toni Da Rodda](mailto:toni.da.rodda.pro@gmail.com).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonidarodda%2Fnestjs-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonidarodda%2Fnestjs-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonidarodda%2Fnestjs-template/lists"}