This is a monorepo handled via nx, meaning a few things will be simplified for us.
Please have a look at the documentation.
# using fnm to set node version - https://github.com/Schniz/fnm
fnm use
# installing pnpm - https://pnpm.io/installation
curl -fsSL https://get.pnpm.io/install.sh | sh -
# Installing dependencies
pnpm i
# starting app worker
pnpm start workernx comes with its own CLI. Here is a short list of commands that may be handy:
| Action | Command |
|---|---|
| 🆘 Get help!!! | pnpm nx help |
| 🚀 Run front and server locally | pnpm dev |
pnpm nx run <project>:<action> |
|
pnpm nx run-many --target=<action> --all |
|
pnpm nx run-many --target=<action> --projects=<project1>,<project2> |
|
pnpm nx affected:<action> |
|
| ✅ Run tests for a project (watch) | pnpm test-changes <project> or pnpm nx test --project=<project> --watch |
| ✅ Run all tests for a project (watchAll) | pnpm test --watchAll or pnpm nx test --project=<project> --watchAll |
| ✅ Run all tests | pnpm test or pnpm nx run-many --target=test --parallel --all |
| 📊 Dependencies graph | pnpm nx dep-graph |
Actions are defined by project in project.json files. Here are a few standard actions:
| Action | Description |
|---|---|
| 🛠️ build | Builds the app/lib. Use --prod flag for a production build |
| 🚀 serve | Runs the app |
| Run the linter against project files | |
| ✅ test | Runs tests |
| ☑️ e2e | Runs end to end tests |
| 🎯 sonar | Runs sonarcloud scan for the app |
| 📘 version | Bumps package version |
| 🎉 publish | Publishes the package on npm registry |
| flag | Description |
|---|---|
⬛ --target=x |
specifies which action to run |
⬛ --skip-nx-cache |
disables nx caching; the command will be ran fully |
⬛ --verbose |
prints additional error stack trace on failure |
⬛ --projects=x,x |
run-many: specifies which projects to run the action against |
⬛ --parallel=x |
run-many: allows x tasks to be ran in parallel |
| Responsibility | Documentation |
|---|---|
| 🎁 Project tool | nx |
| 🗃️ Package manager | pnpm |
| 🧰 Language | Typescript |
ESLint |
|
| ✏️ Code formatting | Prettier |
| ⚛️ Backend framework | Express |
| 📡 Http requests | axios |
| 🧪 Testing library | Jest |
| 💪 CI/CD | Github actions |
| 🔬 Codebase analysis | Sonarcloud |