{"id":20247887,"url":"https://github.com/capdilla/express-typescript-boilerplate","last_synced_at":"2025-10-06T19:24:24.993Z","repository":{"id":187340980,"uuid":"676735072","full_name":"capdilla/express-typescript-boilerplate","owner":"capdilla","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-09T22:58:56.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-14T02:18:51.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/capdilla.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}},"created_at":"2023-08-09T22:20:52.000Z","updated_at":"2023-08-09T22:48:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9ac4a16-5ef6-4e15-9128-398ffc84cf55","html_url":"https://github.com/capdilla/express-typescript-boilerplate","commit_stats":null,"previous_names":["capdilla/express-typescript-boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Fexpress-typescript-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Fexpress-typescript-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Fexpress-typescript-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capdilla%2Fexpress-typescript-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capdilla","download_url":"https://codeload.github.com/capdilla/express-typescript-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241694006,"owners_count":20004541,"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":[],"created_at":"2024-11-14T09:43:49.292Z","updated_at":"2025-10-06T19:24:19.934Z","avatar_url":"https://github.com/capdilla.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typescript Express Boiler plate\n\nSteps to run this project:\n\n1. Change the ` \"name\": \"backend-typescript\"` by the name of the project\n2. Run `rm -r .git` for clean git and set to your new repo\n\n## Tech\n\n- Typescript\n- Sequelize-typescript\n- Swagger\n- TSOA (Typescript Open API)\n\n## How it works\n\n\n### How work routes and Swagger\n`tsoa` reads the controllers folder and takes all the files there with the `.controllers.ts` extension and generate the `routes.ts` and the `swagger.json`, do not upload this generated files to the repo\n\n## Folder Structure\n```\n├── README.md\n├── cert # Certificated like ssl or private and public\n│   ├── generateCerts.js\n│   ├── private.key\n│   └── public.key\n├── config # Configuration files, keys, secrets, DB, etc\n│   ├── config.js\n│   └── dbConfig.js\n├── docker-compose.yml \n├── migrations\n├── server.ts\n├── src\n│   ├── controllers\n│   │   ├── auth.controller.ts\n│   │   └── example.controller.ts\n│   ├── enums\n│   │   ├── Roles.ts\n│   │   └── SecurityNames.ts\n│   ├── helpers\n│   │   ├── getCerts.helper.ts\n│   │   ├── getModelFields.ts\n│   │   ├── hasKey.ts\n│   │   ├── jwt.helper.ts\n│   │   └── logger.ts\n│   ├── interfaces\n│   │   ├── ExpressRequest.ts\n│   │   ├── LogedUser.ts\n│   │   └── Response.ts\n│   ├── middlewares\n│   │   ├── auth.middleware.ts\n│   │   ├── errorHandler.middleware.ts\n│   │   └── logger.middleware.ts\n│   ├── models\n│   │   ├── index.ts\n│   │   ├── posts.model.ts # example model\n│   │   └── user.model.ts # example model\n│   ├── services\n│   │   ├── auth.service.ts\n│   │   └── example.service.ts\n│   ├── routes.ts # auto generate file, Do not upload to repo\n│   └── swagger.json # auto generate file, Do not upload to repo\n├── startServer.ts\n├── tests\n│   └── controllers\n│       └── auth.test.ts\n├── tsconfig.json\n└── tsoa.json\n\n```\n\n## Run project\n\n- ```\n  npm install\n  ```\n\n- Create the private and public keys for sign the jwt token\n\n  ```\n  npm run dev-certs\n  ```\n\n- ```\n  npm run dev\n  ```\n\nAlso if you need a local db you can use `docker-compose up` this will be create a local db and a client for posgres\n\n## Migrations\n\n- Create a new migration\n\n  ```\n  npm run create-migration my-migration-name\n  ```\n\n- run all the migrations availables\n\n  ```\n  npm run migrate\n  ```\n\n- revert the last migration\n\n  ```\n  npm run undo-migrate\n  ```\n\n- Revert all migrations\n\n  ```\n    npm run undo-migrate-all\n  ```\n\n## Seeds\n\n`NOTE: SUPER IMPORTANT: do not use seed to save constanst values in the database and do not use seeds in production. if you need to save constanst values in the DB use a normal migration, keep seeds only for testing data`\n\n- create a seed\n\n  ```\n    npm run create-seed user-seed\n  ```\n\n- run seed\n  ```\n  npm run seeds\n  ```\n\n## Testing\n\n- First make sure that you have created a testing DB\n\n- create migrations for testing table `(just run this command if you have new migrations)`\n\n  ```\n  npm run migrate-testing\n  ```\n\n- OPTIONAL create seeds for testing\n\n  ```\n  npm run seeds-testing\n  ```\n\n- ```\n  npm test\n  ```\n\n## Production\n\n- ```\n  npm run build\n  ```\n\n- `VERY IMPORTANT` be careful with the private.key and the public.key generated in the production mode, if you lose this files all your users will going to need to relogin in the app\n\n  ```\n  npm run prod-cert\n  ```\n\n- Run the server prod\n\n  ```\n  npm run prod\n  ```\n\n\n## Dev Tools \n\nother dev tools available in this boilerplate\n\n1. `postgres` continaer if you need to use a database in local running in port `5432`\n2. `pgadmin` a client admin for `postgres` running in `http://localhost:5050/` and you can access with the credentials in the `docker-compose.yml`\n\njust install `docker` and run `docker-compose up`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapdilla%2Fexpress-typescript-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapdilla%2Fexpress-typescript-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapdilla%2Fexpress-typescript-boilerplate/lists"}