- Typescript
- Express
- Typeorm (with Mysql)
- Jest
- Prettier
- Eslint
- Dependency Injection using InversifyJS
You can do using git command:
git clone https://github.com/heryTz/clean-express-app
- Define your environment variable in .env (see env.example)
- Define your database config in ormconfig.js (see ormconfig.example.js)
npm run dev
You can check these branches for the different base codes that exist
- master: The basic architecture
- foo-service: A example how you can implement a service
It doesn't work if you directly use the cli typeorm. Use the npm script typeorm that already exists in the package.json.
Then you may run the command like this:
npm run typeorm migration:run
If you need to pass parameter with dash to npm script, you will need to add them after --. For example, if you need to generate, the command is like this:
npm run typeorm migration:generate -- -n migrationNameHere
Please refer this documentation for more information (https://typeorm.io/#/using-cli/if-entities-files-are-in-typescript).