This project is a Angular (With SSR) + Nestjs monorepo using Nx. It is a full-stack application that demonstrates how to structure and manage frontend and backend applications within a single Nx workspace.
Feel free to contribute to this project by creating a pull request.
- Check on how to build for bun runtime
- Pre rendering routes doesn't spin up the server, so the HTTP calls are not working (Made a build workaround npm script)
- With Angular Material: https://github.com/cskiwi/angular-nestjs-material-starter
- With TypeORM and Postgres: TODO
The directory structure of this Nx monorepo is organized as follows:
- apps/app: This is the main Angular application with SSR enabled.
- apps/api: This directory is used for running the backend server during development.
- libs/backend/root: This directory contains the entry point for the backend services. It includes necessary configurations and files to initialize and run the backend application.
- libs/frontend/root: This directory contains the entry point for the frontend services. It includes necessary configurations and files to initialize and run the frontend application.
Ensure you have the following installed on your machine:
- Node.js (latest LTS version recommended)
- Bun
- Nx CLI
-
Clone the repository:
git clone <repository-url> cd <repository-name>
-
Install the dependencies:
bun install
To run the application:
bun start
This will start the development server and the application will be available at http://localhost:4200
.
To build the Angular application for production:
bun run build
This will run all the required build steps.
I've included a routes.txt generator, so you can add the routes you want to pre-render in the routes.txt
file.
You can remove that library and build steps if you don't want to pre-render the routes.
To run the Application:
node dist/apps/app/server/server.mjs
NOTE: I'm still looking into running this with bun.
To run unit tests:
nx run-many -t test
To run end-to-end tests:
nx e2e app-e2e