{"id":17931033,"url":"https://github.com/ing-cordova/nest-typeorm-hexagonal","last_synced_at":"2026-05-18T00:05:21.095Z","repository":{"id":258274271,"uuid":"867308769","full_name":"ing-cordova/nest-typeorm-hexagonal","owner":"ing-cordova","description":"This api template was designed to help developers quickly build applications that are scalable, maintainable, and easy to use","archived":false,"fork":false,"pushed_at":"2025-08-07T15:42:22.000Z","size":7702,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-15T14:57:51.073Z","etag":null,"topics":["api-rest","hexagonal-architecture","nestjs","template","unittesting"],"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/ing-cordova.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":"2024-10-03T20:21:53.000Z","updated_at":"2025-08-07T15:42:27.000Z","dependencies_parsed_at":"2024-10-18T08:30:34.351Z","dependency_job_id":"02d358a7-f185-4157-bff8-ca978f1162cf","html_url":"https://github.com/ing-cordova/nest-typeorm-hexagonal","commit_stats":null,"previous_names":["ing-cordova/nest-typeorm-hexagonal"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/ing-cordova/nest-typeorm-hexagonal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-cordova%2Fnest-typeorm-hexagonal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-cordova%2Fnest-typeorm-hexagonal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-cordova%2Fnest-typeorm-hexagonal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-cordova%2Fnest-typeorm-hexagonal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ing-cordova","download_url":"https://codeload.github.com/ing-cordova/nest-typeorm-hexagonal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-cordova%2Fnest-typeorm-hexagonal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: 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":["api-rest","hexagonal-architecture","nestjs","template","unittesting"],"created_at":"2024-10-28T21:19:11.929Z","updated_at":"2026-05-18T00:05:16.738Z","avatar_url":"https://github.com/ing-cordova.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 NESTJS WITH HEXAGONAL ARCHITECTURE API\n\nThis API-Template was designed and built with **NestJS** and TypeORM. It follows the **Hexagonal Architecture** pattern, which is a software architecture pattern that is used to create loosely coupled application components. The Hexagonal Architecture pattern is also known as the Ports and Adapters pattern.\n\nThis api template was designed to help developers quickly build applications that are scalable, maintainable, and easy to use. Furthermore, the api use and requires **unit testing** to ensure that the application works as expected. It is designed to be used in production, and it is also open source.\n\n## 🚀 FEATURES\n\n- **Authentication**: This API uses JWT (jsonwebtoken) for authentication.\n\n## 🛠 Technologies Used\n\n- **Backend**: NestJS, TypeORM, TypeScript\n- **Authentication**: JWT (jsonwebtoken)\n- **Database**: It supports PostgreSQL and others based on TypeORM. (Currently PostgreSQL)\n- **ORM**: TypeORM\n- **Testing**: Jest for unit testing\n- **Documentación**: Swagger for API documentation.\n\n## 📂 Project Structure\n```bash\nsrc/\n│\n├── context/                      # Context of the project\n│   ├── userProfile/              # UserProfile Entity Folder\n│   │   ├── application/          # Entity UseCases\n│   │   │   ├── use-case/\n│   │   ├── domain/               # Domain Entity\n│   │   └── infraestructure/      # Infraestructure of the entity\n│   ├── seeds/                    # Seeders Folder\n│   ├── services/                 # Global Services\n│   └── shared/                   # Global Shared Modules\n└──\n```\n\n## 📦 Instalation \n\n1. Clone the repository\n```bash\ngit clone https://github.com/ing-cordova/nest-typeorm-hexagonal.git\n```\n\n2. Navigate to the repository\n```bash\ncd nest-typeorm-hexagonal\n```\n\n3. Install dependencies\n```bash\nnpm install\n```\n\n4. **Set up your database**: By default, the application uses a PostgreSQL database. You can change the database configuration in the `.env` file. You can use the following databases:\n\n### Supported databases:\n\n* MySQL or MariaDB\n* PostgreSQL or CockroachDB\n* SQLite\n* Microsoft SQL Server\n* Oracle\n* SAP Hana\n* Google Cloud Spanner\n* MongoDB (experimental)\n\n### Installation:\n\nTo use a different database, you need to install the right driver for your environment:\n\n```bash\nnpm install DRIVER_NAME --save\n```\n\n\n| Database | Driver |\n| --- | --- |\n| MySQL or MariaDB | `mysql` or `mysql2` |\n| PostgreSQL or CockroachDB | `pg` |\n| SQLite | `sqlite3` |\n| Microsoft SQL Server | `mssql` |\n| Oracle | `oracledb` |\n| SAP Hana | `@sap/hana-client` and `hdb-pool` |\n| Google Cloud Spanner | `@google-cloud/spanner` |\n| MongoDB | `mongodb@^5.2.0` |\n\n### Environment variables:\n\n* For Google Cloud Spanner, you need to set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable with the path to your JSON key file.\n* For SAP Hana, you need to set the `SPANNER_EMULATOR_HOST` environment variable if you want to use the emulator.\n\n5. Set up environment variables\n```bash\nsource .env\n```\n\n## ✨ Generate new Modules\n```bash\nnpm run generate:module module-name\n```\n\nAfter you run the command, you will see a new folder in the `src/context` directory with the name of the module you entered. Also, you have to include into the `src/app.module` file the new module.\n\n## ⚙️ Usage\n1. Generate the migrations (at the project will be a initial migration, you can create more migrations based on the entities you create)\n```bash\nnpm run typeorm:generate -- ./src/migrations/initial-migration\n```\n\n2. Run the migrations\n```bash\nnpm run typeorm:run\n```\n\n2.1 If you want to revert the migrations\n```bash\nnpm run typeorm:revert\n```\n\n3. Run the seeders\n```bash\nnpm run seed\n```\n\n4. Run the application\n```bash\nnpm run start\n```\n\n## ✅ Unit Testing\n\n1. Run unit tests\n```bash\nnpm run test\n```\n\n## 📝 Documentation API\n\nThe Swagger documentation for this API is available at [http://localhost:3000/api](http://localhost:3000/api)\n\n\n## 💡Acknowledgments\n\nFeel free to explore the code and contribute to this project. If you have any questions or suggestions, don't hesitate to [contact me](https://github.com/ing-cordova).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fing-cordova%2Fnest-typeorm-hexagonal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fing-cordova%2Fnest-typeorm-hexagonal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fing-cordova%2Fnest-typeorm-hexagonal/lists"}