Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(examples): add with-nestjs example #8162

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Neosoulink
Copy link
Contributor

@Neosoulink Neosoulink commented May 16, 2024

Description

Related issue: #8131

I recently created an issue where I explained why it's useful to use Nestjs with Turborepo.
This PR adds a new example integration with nestjs!

I recorded a short video showing how it's working:

turborepo_with-nestjs_commands-test.mov

Testing Instructions

This new example is located at ./examples/with-nestjs/.

It uses a basic turborepo nextjs for apps/web and a customized nestjs app located at apps/api.

To launch all the apps and packages in dev mode, run pnpm run dev.

The apps/api server includes a basic resource (CRUD) example where the apps/web use the apps/api links.findAll API methods to retrieve the displayed links.
They use the same package @repo/api to retrieve the shared entity and dtos.
Even if the @repo/api mainly uses the nestjs configuration, it can be used for Nextjs and/or any other kind of apps.

For more information, I documented it in the root/README

That's it for now. I tried not to put too many things in this example and follow the flow of other examples...
Please let me know if I missed anything. I'll be glad to have your feedback.

cc: @anthonyshew

Will close #8131

### Description

- Add the `with-nestjs` example
- Init a basic `web nextjs` app
- Init a basic `api nestjs` app
- use the basic turborepo config
### Description

- Set general `eslint` & `perttier` config into `@repo/eslint-config`
  - Add a base `eslint` config file
- Move common `eslint` & `prettier` support into `@repo/eslint-repo`
- Add a base `prettier` file
- Remove format script from `apps/api` and use root `format` script
### Description

- Mix the root `,gitignore` with the `nestjs` generated `.gitignore`
### Description

- Add a new tsconfig file for `nestjs` into `@repo/typescript-config`.
- Add `@repo/typescript-config` as `apps/api` dev-dependency.
  - Extends `@repo/typescript-config/nestjs.json`
### Description

- Add `@repo/jest-config`  package
  - Configure a base common jest config file
  - Add a `nestjs` config file
  - Add a `nextjs` config file
- Use `playwright` for `NextJs` e2e testing
  - Add a base unit & e2e Nextjs testes
- Sync testes command with turborepo
### Description

- Add a `@repo/api` package
  - Use `nestjs` environment setup
  - Add links `entity` and `dto` examples
- Sync/Use `@repo/api` into `apps/api`
  - Add `Link` resource (CRUD) example
- Sync/Use `@repo/api` into `apps/web`
  - Retrieve links frorm `apps/api`
  - Refactor root page unit-test for async component
### Description

- Update the root `README` documentation
- Update the `apps/api` `README` documentation
- Update the `apps/web` `README` documentation
@Neosoulink Neosoulink requested review from anthonyshew and a team as code owners May 16, 2024 19:22
@Neosoulink Neosoulink requested a review from paulogdm May 16, 2024 19:22
@turbo-orchestrator turbo-orchestrator bot added area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels May 16, 2024
Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:20pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:20pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:20pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:20pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:20pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:20pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:20pm

Copy link

vercel bot commented May 16, 2024

@Neosoulink is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@ijjk
Copy link
Member

ijjk commented May 16, 2024

Allow CI Workflow Run

  • approve CI run for commit: 763f23f

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@Neosoulink Neosoulink changed the title Feat | with-nestjs example integration feat(examples): add with-nestjs example May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples needs: triage New issues get this label. Remove it after triage owned-by: turborepo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examples: with-nestjs example implementation
2 participants