/bazel-nx-example

⚡ Example monorepo for Nest + Angular built with Bazel

Primary LanguageTypeScript

Bazel at Scalio

Bazel Nx-Monorepo Starter

A full-stack starter app written in Typescript using Nx, Angular, and NestJS -- built using Bazel

 

Overview

This project was created to demonstrate a fully fledged full-stack typescript application built with Bazel. It showcases basic CRUD operations, authentication, routing, code-sharing between frontend and backend and more.

Frontend application was built according to Angular 8 JWT Authentication Example.

The full list of cool technologies used in this project:

  • Lazy loading of each module in the Angular app.
  • Monorepo architecture using Nx that allows TypeScript interfaces to be shared between frontend and backend.
  • Swagger module for documentation.
    • After the build you can see the documentation for REST API at http://localhost:3000/api.
  • Passport for login using JWT.
    • To access protected routes you should use the HTTP Header: Authentication: 'Bearer <token>'
  • TypeORM + Postgres for persisting data.
  • Docker-compose used to run database, frontend and the backend.
  • Bazel build tool for faster builds

Build & Run

The easiest way to run the API, DB and frontend all together is docker-compose:

docker-compose up --build

Without docker, things are a little more complicated:

# installation
yarn install -D

# run frontend
yarn start

# run backend
# assuming DB is already running
yarn start api

After the build the app should be available at http://localhost:4200/ and API docs are at http://localhost:3000/api.

Credits

Created by @rayman1104 @ Scalio

About us