{"id":13406464,"url":"https://github.com/maximegris/typescript-express-sequelize","last_synced_at":"2025-04-09T20:15:40.669Z","repository":{"id":47116573,"uuid":"84645343","full_name":"maximegris/typescript-express-sequelize","owner":"maximegris","description":"Easily bootstrap your NodeJS project with Express, Sequelize and Typescript :+1:","archived":false,"fork":false,"pushed_at":"2024-03-25T21:05:54.000Z","size":120,"stargazers_count":184,"open_issues_count":6,"forks_count":55,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-09T20:15:36.312Z","etag":null,"topics":["express","nodejs","sequelize","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximegris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":null,"patreon":"maximegris","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":"maximegris","otechie":null,"custom":null}},"created_at":"2017-03-11T11:32:04.000Z","updated_at":"2025-03-18T17:07:59.000Z","dependencies_parsed_at":"2024-10-31T14:03:36.968Z","dependency_job_id":"774bb0f2-f33d-446d-9cc3-86254582c1e5","html_url":"https://github.com/maximegris/typescript-express-sequelize","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximegris%2Ftypescript-express-sequelize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximegris%2Ftypescript-express-sequelize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximegris%2Ftypescript-express-sequelize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximegris%2Ftypescript-express-sequelize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximegris","download_url":"https://codeload.github.com/maximegris/typescript-express-sequelize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["express","nodejs","sequelize","typescript"],"created_at":"2024-07-30T19:02:30.961Z","updated_at":"2025-04-09T20:15:40.632Z","avatar_url":"https://github.com/maximegris.png","language":"TypeScript","readme":"[![Logo](./sequelize.png)](http://docs.sequelizejs.com)\n\n[![Build Status](https://travis-ci.org/maximegris/typescript-express-sequelize.svg?branch=master)](https://travis-ci.org/maximegris/typescript-express-sequelize)\n[![License](https://img.shields.io/badge/license-Apache2-blue.svg?style=flat)](https://github.com/maximegris/typescript-express-sequelize/blob/master/LICENSE.md)\n\n# Introduction\n\nEasily bootstrap your Typescript project with NodeJS + Express + Sequelize ORM. :heart:\n\n## Installation\n\nRun one of the command below\n\n```bash\nnpm install\n```\n\n```bash\nnpm install -g yarn\nyarn\n```\n\nThe build tasks use **Gulp tasks runner**. Typescript is transpiled to Javascript in the /build directory.\nThis sample use PostgreSQL database but you can easily change it and use your favorite relational database (npm or yarn command) :\n```bash\nnpm install --save mysql // For both mysql and mariadb dialects\nnpm install --save sqlite3\nnpm install --save tedious // MSSQL\n```\n\n## Configure your database\n\nSequelize configuration and entities can be found in /Src/sqlz directory.\n\n| Directory | Description |\n|---|---|\n| config  | Your database configuration. |\n| migrations  | Your database migrations scripts. Keep this files in Javascript and run sequelize db:migrate to migrate your database schema. |\n| models | Sequelize entities. |\n\nFirst, define your database schema in config/config.json file.\nUse [Sequelize CLI](http://docs.sequelizejs.com/en/v3/docs/migrations/) to initialize your database.\n\nIn models/ directory, the index.ts file define the DbConnection interface. When you create a new Sequelize entity, add its reference in this interface to fully use Typescript's superpower !\n\n## Run the project\n\n```bash\nnpm start\n```\n\nYour web server is now exposed on http://localhost:3000\n\n### GET   /api/languages\ncurl -X GET -H 'Content-Type: application/json' http://localhost:3000/api/languages\n\n### POST   /api/languages\ncurl -X POST -H 'Content-Type: application/json' -d '{\"label\":\"French\",\"name\":\"fr\"}' http://localhost:3000/api/languages\n\n### GET  /api/appusers\ncurl -X GET -H 'Content-Type: application/json' http://localhost:3000/api/appusers\n\n### POST  /api/appusers\ncurl -X POST -H 'Content-Type: application/json' -d '{\"email\":\"foo@bar.com\",\"pwd\":\"something\"}' http://localhost:3000/api/appusers\n\n## Build\n\n```bash\nnpm run build\n```\n\n## Lint your code before you commit!\n\nIn a collaborative project, it's always a pain when you have to work on files not correctly formatted.\nNow before each commit, yout typescript files are linted based on your tsconfig.json \u003e  .editorconfig \u003e tslint.json files.\n\n```bash\nλ git commit -m \"Example precommit\"\n\n\u003e husky - npm run -s precommit\n\n25l[14:22:30] Running tasks for src/**/*.ts [started]\n[14:22:30] prettify [started]\n[14:22:31] prettify [completed]\n[14:22:31] git add [started]\n[14:22:31] git add [completed]\n[14:22:31] Running tasks for src/**/*.ts [completed]\n25h25h[master 23c4321] Example precommit\n 1 file changed, 1 insertion(+), 1 deletion(-)\n```\n\nBy the way you can also run the command with a npm script\n\n```bash\nnpm run prettify\n```\n\n## Debug with Typescript and VSCode\n\nAdd breakpoints to your Typescript source code and launch in VSCode the \"Debug Typescript\" task.\nWhen you'll access to an endpoint, you will be able to debug directly in your Typescript's files.\n\n## Questions and issues\n\nThe [github issue tracker](https://github.com/maximegris/typescript-express-sequelize/issues) is **_only_** for bug reports and feature requests.\n\n## Roadmap\n- [x] Add Sequelize Typescript example with association\n- [x] Manage multiple database configuration with NODE_ENV\n- [ ] Add Swagger API Framework\n","funding_links":["https://patreon.com/maximegris","https://issuehunt.io/r/maximegris"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximegris%2Ftypescript-express-sequelize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximegris%2Ftypescript-express-sequelize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximegris%2Ftypescript-express-sequelize/lists"}