Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
utarwyn committed Apr 15, 2024
1 parent 4a3ae61 commit dd43c70
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 40 deletions.
84 changes: 46 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,70 @@
# HiringFulll
<div align="center">

<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
# Fulll 🤝 Hiring process

**This workspace has been generated by [Nx, Smart Monorepos · Fast CI.](https://nx.dev)**
**My work for the [Fulll hiring process](https://github.com/fulll/hiring).**

## Integrate with editors
✨ This workspace has been generated by Nx, Smart Monorepos · Fast CI. ✨

Enhance your Nx experience by installing [Nx Console](https://nx.dev/nx-console) for your favorite editor. Nx Console
provides an interactive UI to view your projects, run tasks, generate code, and more! Available for VSCode, IntelliJ and
comes with a LSP for Vim users.
</div>

## Start the application
---

Run `npx nx serve fizzbuzz` to start the development server. Happy coding!
## Features

## Build for production
- Fizzbuzz algorithm and CLI (Algo test)
- Vehicle fleet CLI (Backend test)
- ~6-7 hours of work on it

Run `npx nx build fizzbuzz` to build the application. The build artifacts are stored in the output directory (e.g. `dist/` or `build/`), ready to be deployed.
## Architecture

## Running tasks
This repository is a monorepo managed by [Nx](https://nx.dev/).

To execute tasks with Nx use the following syntax:
It contains libraries for core programs, and client applications to consume these libraries:

```
npx nx <target> <project> <...options>
```
- Libraries
- Fizzbuzz
- Vehicle Fleet
- Applications
- Fizzbuzz CLI
- Fizzbuzz CLI (end-to-end tests)
- Fleet CLI
- Fleet CLI (end-to-end tests)

You can also run multiple targets:
> This way we can imagine creating new applications (like APIs or GUIs) to also consume the libraries.
```
npx nx run-many -t <target1> <target2>
```
## Commands

..or add `-p` to filter specific projects
```shell
# Install dependencies
pnpm install

```
npx nx run-many -t <target1> <target2> -p <proj1> <proj2>
```
# Lint, test (including e2e) or build all projects
pnpm nx run-many --target=lint
pnpm nx run-many --target=test
pnpm nx run-many --target=build

Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/features/run-tasks).
# Run Fizzbuzz CLI
pnpm run fizzbuzz-cli
pnpm run fizzbuzz-cli -- --args=--max=200

## Set up CI!
# Run Fleet CLI
# (you need to set environment variable MONGO_URL first)
pnpm run fleet-cli -- --args=create,fleet-1 # example to create a fleet
```

Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
## Q&A

- [Set up remote caching](https://nx.dev/features/share-your-cache)
- [Set up task distribution across multiple machines](https://nx.dev/nx-cloud/features/distribute-task-execution)
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
- **For code quality, you can use some tools : which one and why (in a few words) ?**

## Explore the project graph
I am using ESLint (as part of the Nx workspace) to lint the code during the development and inside the CI.
I have also prepared a step inside the GitHub action to run a SonarCloud analysis in the CI, but we can
connect a similar service too (Codecov, Coveralls, etc.). Prettier is also installed to improve code readibility.
We could also add a pre-commit Git hook to lint the code right before a commit (using husky/lint-staged).

Run `npx nx graph` to show the graph of the workspace.
It will show tasks that you can run with Nx.

- [Learn more about Exploring the Project Graph](https://nx.dev/core-features/explore-graph)
- **You can consider to setup a ci/cd process : describe the necessary actions in a few words**

## Connect with us!
At the moment I have created a basic pipeline which runs lint, test and build targets through Nx. This ensures
that only affected code is processed each commit/PR (very interesting for monorepos like this one).

- [Join the community](https://nx.dev/community)
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Follow us on Twitter](https://twitter.com/nxdevtools)
1 change: 1 addition & 0 deletions apps/fizzbuzz-cli-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"targets": {
"test": {
"executor": "@nx/jest:jest",
"dependsOn": ["^build"],
"outputs": ["{workspaceRoot}/coverage/{e2eProjectRoot}"],
"options": {
"jestConfig": "apps/fizzbuzz-cli-e2e/jest.config.ts",
Expand Down
4 changes: 3 additions & 1 deletion apps/fizzbuzz-cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"buildTarget": "fizzbuzz-cli:build:development"
},
"production": {
"buildTarget": "fizzbuzz-cli:build:production"
"buildTarget": "fizzbuzz-cli:build:production",
"inspect": false,
"watch": false
}
}
},
Expand Down
4 changes: 3 additions & 1 deletion apps/fleet-cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"buildTarget": "fleet-cli:build:development"
},
"production": {
"buildTarget": "fleet-cli:build:production"
"buildTarget": "fleet-cli:build:production",
"inspect": false,
"watch": false
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"fizzbuzz-cli": "nx run fizzbuzz-cli:serve:production",
"fleet-cli": "nx run fleet-cli:serve:production",
"test": "nx run-many --target=test"
},
"private": true,
Expand Down

0 comments on commit dd43c70

Please sign in to comment.