This is just a project to show a nice project structure that fits well almost any project that tries to archive a nice Clean/Hexagonal Architecture.
This is just a couple of ideas and my own opinion, feel free to customize to fet
your project needs as well as your ideas, or even use the steps below to reproduce
the scafold from scratch... Then, after know how to do, Im pretty sure that you
will never comeback to this repository... if you think that is the case, ⭐️ STAR me up! ⭐
yarn init -y
mkdit src
git initConsider to add a .gitignore file
yarn add typescript eslint sucrase jest ts-jest -Dyarn tsc --init
yarn add @types/node @types/jest -DAdd "include": ["**/*.*"] and "exclude": ["node_modules", "dist"] to tsconfig.json,
then, add/uncomment "outDir": "./dist" and "rootDir": "./src"
References | TypeScript | @types/...
yarn jest --initThen, add preset: "ts-jest" to jest.config.js
References | Jest | Jest with Typescript (ts-jest)
yarn eslint --init
yarn add -D eslint-config-standard-with-typescript
rm package-lock.json && yarnThen, on .eslintrc.js:
- Change
extends: 'standard-with-typescript' - Add
project: './tsconfig.json'toparserOptions - Add
jest: truetoenv
If you are on a JetBrains IDE:
- On
Settings>Code Style>JavaScript,- then,
Set from...>JavaScript Standard Style
- then,
- On
Settings>Code Style>TypeScript,- then,
Set from...>JavaScript(to copy from the step above) - on the Cog icon:
Export>EditorConfig File
- then,
- On
Settings, search forESLint- check:
Automatic ESLint configuration - check:
Run eslint --fix on save... the ESLint magic is ready!
- check:
References | ESLint | Standard | Standard with TypeScript
Choose your weapons, they say... Both Sucrase and TS-node are like Babel but better/easier/faster/no-setup. I chose Sucrase here because Sucrase is faster, but TS-node is a more complex solution.
References | Sucrase | TS-node
yarn add awilix express apollo-server-express graphqlThen, check src folder from this repo if you need some ideas
References | Awilix | Express | Apollo Server | Apollo Server with Express | GraphQL
Also... check package.json for some smart scripts 😉
[]: https://github.com/standard/eslint-config-standard-with-typescript#readme