{"id":19710653,"url":"https://github.com/rootstrap/node-ts-api-base-legacy","last_synced_at":"2026-03-02T06:31:10.750Z","repository":{"id":40937558,"uuid":"193959252","full_name":"rootstrap/node-ts-api-base-legacy","owner":"rootstrap","description":"Base Project for NodeJs + TypeScript Backends","archived":false,"fork":false,"pushed_at":"2023-01-23T23:56:58.000Z","size":1710,"stargazers_count":3,"open_issues_count":25,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T01:05:07.675Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootstrap.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}},"created_at":"2019-06-26T18:38:27.000Z","updated_at":"2020-12-15T20:43:15.000Z","dependencies_parsed_at":"2023-02-13T05:15:53.613Z","dependency_job_id":null,"html_url":"https://github.com/rootstrap/node-ts-api-base-legacy","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/rootstrap/node-ts-api-base-legacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fnode-ts-api-base-legacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fnode-ts-api-base-legacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fnode-ts-api-base-legacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fnode-ts-api-base-legacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootstrap","download_url":"https://codeload.github.com/rootstrap/node-ts-api-base-legacy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fnode-ts-api-base-legacy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29994122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-11T22:08:04.568Z","updated_at":"2026-03-02T06:31:10.675Z","avatar_url":"https://github.com/rootstrap.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"NodeJS \u0026 TypeScript Template\n=========================================\n## Overview\nNode-TS is a base template created to help start new backend projects using NodeJS and TypeScript.\nThe main objective is helping new projects start feature development by providing a base architecture and basic services setup, using standard tooling and best practices.\n\n## Architecture \u0026 Folder structure\nThe project is structured using a layered architecture, separating Persistence, Business logic and Routing. Specifically, Repositories, Services and Routers\n\nModels are used to define your database entities and are passed through layers before. Then, serializers are in charge of exposing the correct data to the end user (so, at router level in this case).\n\nThe folder structure is [component-based](https://github.com/i0natan/nodebestpractices/blob/master/sections/projectstructre/breakintcomponents.md).\nAssign a folder in your project root for each business component and make it self-contained - other components are allowed to consume its functionality only through its public interface or API (in this case, the `index.ts` file).\n\nApart from that, the following folders are present:\n- `dist`: Stores all .js files built by the TypeScript compiler.\n- `public`: Exposes publicly hosted files.\n- `src`: Root folder for our codebase.\n- `constants`: Constant definition such as status codes, enums, etc.\n- `db`: Database related configurations and migration files.\n- `models`: All entity models.\n- `middlewares`: Express Middlewares.\n- `utils`: Helpers such as loggers, date handling, etc.\n- `tasks`: Used to store any standalone custom script that you would expose on your `package.json`\n\n## Environment setup\n- `Dotenv` is set up to manage environment variables locally, use the `.env.sample` file as a base and use one `.env` file per environment (so, development, test and production).\n- `ormconfig` stores the base configuration for TypeORM.\n\n## Scripts\nThe following scripts are provided as tooling to interact with the database, tests, builds, etc:\n\n- `npm run lint`: Runs tslint with automatic fixes enabled.\n- `npm run build`: Builds all files for release.\n- `npm run dev`: Spins up the TS compiler and the backend concurrently for developing using hot reload.\n- `npm run start`: Starts the backend (from the dist folder).\n- `npm run db:sync`: Syncs the database, it **should not be used in production, since it can override data**.\n- `npm run db:drop`: Drops the database\n- `npm run db:migrate`: Runs migrations\n- `npm run db:revert`: Revert latest executed migration\n- `npm run db:logsync`: Compares the current db schema to see if new changes would need to be applied when running db:sync.\n- `npm run typeorm:migration:generate -- -n migrationName`: Generates a new migration.\n- `npm run typeorm:migration:create -- -n migrationName`: Creates a new empty migration.\n- `npm run test`: run tests.\n- `npm run test:coverage`: run tests with coverage metrics.\n\n## Dependencies\n- `express`: http://expressjs.com/ for our routing layer.\n- `typeorm`: https://github.com/typeorm/typeorm as our ORM.\n- `@hapi/joi`: https://github.com/hapijs/joi for json validation.\n- `pino`: https://github.com/hapijs/joi for logging.\n- `dotenv`: https://github.com/motdotla/dotenv for environment management.\n- `pg`: https://github.com/motdotla/dotenv PostgreSQL adapter.\n- `body-parser`: https://github.com/expressjs/body-parser middleware json parsing.\n- `bull`: https://github.com/OptimalBits/bull#readme queue processing.\n- `nodemailer`: https://nodemailer.com/ as our mail engine.\n\n### Test Dependencies\n- `mocha`: https://mochajs.org/ as our testing framework.\n- `chai`: http://chaijs.com assertion library.\n- `sinon`: https://sinonjs.org/ for mocks and stubs.\n- `supertest`: https://github.com/visionmedia/supertest for router testing.\n\n## Roadmap\nThe following features are planned to be added:\n\n- [X] CircleCI configuration.\n- [X] Docker configuration.\n- [X] Error handling middleware.\n- [ ] Session management using Passport.\n- [X] Background jobs example setup.\n\n## License\n\n**Node-ts-api-base** is available under the MIT license. See the LICENSE file for more info.\n\n## Credits\n\n**Node-ts-api-base** is maintained by [Rootstrap](http://www.rootstrap.com) with the help of our [contributors](https://github.com/rootstrap/node-ts-api-base/contributors).\n\n[\u003cimg src=\"https://s3-us-west-1.amazonaws.com/rootstrap.com/img/rs.png\" width=\"100\"/\u003e](http://www.rootstrap.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fnode-ts-api-base-legacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootstrap%2Fnode-ts-api-base-legacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fnode-ts-api-base-legacy/lists"}