{"id":28590229,"url":"https://github.com/antoniopaya22/typescript-api-rest-template","last_synced_at":"2025-06-11T08:13:38.170Z","repository":{"id":44013056,"uuid":"212760380","full_name":"antoniopaya22/TypeScript-API-REST-Template","owner":"antoniopaya22","description":"TypeScript and NodeJS API-REST Template","archived":false,"fork":false,"pushed_at":"2023-03-03T11:28:49.000Z","size":760,"stargazers_count":5,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-09T17:27:19.957Z","etag":null,"topics":["api-rest","apirestfull","rest-api","typeorm","typescript"],"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/antoniopaya22.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}},"created_at":"2019-10-04T07:35:04.000Z","updated_at":"2022-08-01T17:56:04.000Z","dependencies_parsed_at":"2024-01-08T17:37:19.482Z","dependency_job_id":null,"html_url":"https://github.com/antoniopaya22/TypeScript-API-REST-Template","commit_stats":null,"previous_names":["antoniopaya22/typescript-api-rest-template"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniopaya22%2FTypeScript-API-REST-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniopaya22%2FTypeScript-API-REST-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniopaya22%2FTypeScript-API-REST-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniopaya22%2FTypeScript-API-REST-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antoniopaya22","download_url":"https://codeload.github.com/antoniopaya22/TypeScript-API-REST-Template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniopaya22%2FTypeScript-API-REST-Template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259227960,"owners_count":22824907,"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":["api-rest","apirestfull","rest-api","typeorm","typescript"],"created_at":"2025-06-11T08:13:33.951Z","updated_at":"2025-06-11T08:13:38.135Z","avatar_url":"https://github.com/antoniopaya22.png","language":"TypeScript","readme":"# TypeScript-API-REST-Template\n\n[![Build Status](https://travis-ci.com/antonioalfa22/TypeScript-API-REST-Template.svg?branch=master)](https://travis-ci.com/antonioalfa22/TypeScript-API-REST-Template)\n[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)\n[![NPM version](https://badge.fury.io/js/badge-list.svg)](https://github.com/antonioalfa22/TypeScript-API-REST-Template)\n[![star this repo](http://githubbadges.com/star.svg?user=antonioalfa22\u0026repo=TypeScript-API-REST-Template\u0026style=flat)](https://github.com/antonioalfa22/TypeScript-API-REST-Template)\n[![fork this repo](http://githubbadges.com/fork.svg?user=antonioalfa22\u0026repo=TypeScript-API-REST-Template\u0026style=flat)](https://github.com/antonioalfa22/TypeScript-API-REST-Template/fork)\n\n\n## 1. Estructura y Flujo\n\n```bash\n└───src\n    ├───controllers\n    ├───models\n    ├───middlewares\n    ├───repository\n    ├───routes\n    └───test\n```\n\n![flow diagram](./flow.png)\n\n### 1.1. Models\n\nRepresenta el modelo de datos, (por ejemplo un usuario).\n\n### 1.2. Repository\n\nSe encargan de proporcionar los métodos de acceso a base de datos para trabajar con los modelos (Entidades).\n\n### 1.3. Middlewares\n\nSon los componentes encargados de comprobar si se debe o no seguir con la petición. Por ejemplo autorización o roles.\n\n### 1.4. Controllers\n\nLos controladores son los encargados de realizar las operaciones requeridas por la petición definida en la ruta.\n\n_______\n\n## 2. Ejecutar\n\nPara ejecutar la API-Rest en modo de desarrollo o testeo se deben ejecutar las siguientes instrucciones:\n\n```node\nnpm install\nnpm run dev\n```\n\nPara ejecutar la API-Rest en producción se deben de realziar los siguientes pasos:\n\n1. **Set .env**\n\nSe necesita crear un archivo de configuración `.env` como el siguiente:\n\n```env\nMODE = test\n```\n\n2. **Run**\n\n```node\nnpm install\nnpm run prod\n```\n\n## 2. Ejecutar con Docker\n\n1. **Set .env**\n\nSe necesita crear un archivo de configuración `.env` como el siguiente:\n\n```env\nMODE = test\n```\n\n2. **Build**\n\n```docker\ndocker build . -t api-rest:latest\n```\n\n3. **Run**\n\n```docker\ndocker container run --publish 3000:3000 --detach api-rest\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoniopaya22%2Ftypescript-api-rest-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantoniopaya22%2Ftypescript-api-rest-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoniopaya22%2Ftypescript-api-rest-template/lists"}