Giter VIP home page Giter VIP logo

nx-ng-nest-universal's Introduction

Nx Workspace with Angular Universal via Nest

This project was generated using Nx. It currently includes an Angular App with server side rendering (SSR) via Nest.

master branch -> nx workspace with two apps (angular + nest) -> Step 1. - 6.
single-app branch -> nx workspace with single app (angular) -> Step 1. - 4.



Steps to Reproduce

1. Create Nx Workspace

npx create-nx-workspace nx-ng-nest-universal --npm-scope=ss --style=scss

2. Generate Angular App

ng g app ng-test-app --prefix=ss-test --routing=true --style=scss

3. Add Angular Universal module for Nest

ng add @nestjs/ng-universal --clientProject=ng-test-app --project=ng-test-app

4. Adjustments to make everything work. (s. Commit)

1. rimraf yarn.lock && npm i (to avoid packages conflicts)
2. Fix fileReplacements for ng-test-app:server:production in angular.json
3. Edit webpack.server.config.js

✔️ Nx App + SSR working. Move on if you want to have nest as a seperated app in your workspace.


5. Generate Nest App

ng g node-app nest-test-app --framework=nestjs

6. Adjustments to use the freshly generated Nest App for SSR (s. Commit)

1. Mainly move and edit generated files from Step 3
2. Add @nestjs/ng-universal to nest app in workspace

✔️ Nx Workspace with seperated Nest App for SSR working.


Getting Started (Build and Serve)

> git clone https://github.com/servrox/nx-ng-nest-universal.git
> cd nx-ng-nest-universal\
> npm i

npm run build:ssr && npm run serve:ssr

> npm run go

or for development

> npm run serve

UI at http://localhost:4000/
API at http://localhost:4000/api


Built With

Authors

nx-ng-nest-universal's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.