zen

โ›ฉ Nest + Prisma + Apollo + Angular ๐Ÿฎ Full Stack GraphQL Starter Kit โ›ฉ

Stars
185
Committers
4

Bot releases are visible (Hide)

zen - v15.0.0 - Nx v19, Angular v18, Angular Material v18 update Latest Release

Published by ZenSoftware 4 months ago

  • Updated to Nx v19 and ran all migrations.
  • Updated to Angular v18
  • Updated to Angular Material v18. Updated the SASS (.scss) theme for this version of Angular Material that is now abiding by the major updates to Material v3. I generated two themes utilizing ng generate @angular/material:m3-theme and integrated a basic light and dark theme for the repo. The themes are directly importing the SASS styles and can be tweaked to your own taste under the theme folder.
  • Updated Prisma to v5.15.0
  • Scrubbed out all deprecated packages and updated every dependency within the project.
  • Implemented Prisma's new createMany and createManyAndReturn feature. Please delete your resolvers within apps/api/src/app/graphql/resolvers/prisma and regenerate them. You may keep the User.ts resolver file as it already has been regenerated for you. No other significant changes should be needed if you've managed to merge all the other changes successfully.
  • Refactored the code generation of GraphQL resolvers for Prisma models. There are now some minor efficiency gains that have been made.
  • Went through all the feature branches and updated those as well. Recompiled and tested all of them to ensure that they are still in working order.
  • @zen/grid now shows the refresh button by default.
  • @zen/grid now defaults to @Input() sortable: SortSettings = { mode: 'multiple' }; instead of single.
  • @zen/grid under the kendo branch now has working filtering for Prisma's Filter on "-to-one" relations. This will allow you to have columns within the grid that can now be filtered over with nested objects. As an example:

apps/api/prisma/schema.prisma

model User {
  id            String   @id @default(uuid())
  ...
  address       Address? @relation(fields: [addressId], references: [id])
  addressId     String?
}

model Address {
  id      String  @id @default(uuid())
  country String?
  ...
  User    User[]
}

libs/graphql/src/lib/fields/User.gql.ts

import gql from 'graphql-tag';
import { AddressFields } from './Address.gql';
export const UserFields = gql`
  fragment UserFields on User {
    id
    address {
      ...AddressFields
    }
  }
  ${AddressFields}
`;

libs/main/src/lib/zen-portal/zen-super/zen-user-manager/zen-user-grid/zen-user-grid.component.ts

const DEFAULT_SETTINGS: KendoGridSettings<UserFields> = {
  columnsConfig: [
    {
      field: 'address.country',
      title: 'Country',
      filter: 'text',
      custom: { nullable: true },
    },
  ],
};

๐Ÿงช๐Ÿฅฝ๐Ÿชฝ

  • Publicized the unity branch and will be committing to maintaining and improving it for the long term.
  • Updated the README.md files of the project to describe what is included and provided instructions on how to get your development environment setup and compile the Unity WebGL project.
  • Updated all dependencies to the latest stable versions. Notably:
    • Updated the repo to Nx v18 and ran all migrations
    • Updated Prisma
    • Updated Apollo
    • Update Angular
    • Update Angular Material
    • Updated Nest
  • Polish, polish, and more polish

This project is rock-solid with now more than 3 years of refinement. It combines the best libraries I could possibly find within the ecosystems that this project is utilizing. The starter kit is highly robust with hyper lean implementations. git merge in whichever features you need for any particular project and git pull in changes from this repo for your own git clone of this repo to keep your own projects up to date with the latest updates.

Roadmap:

  • Integrate standard leg humping mechanic that is highly modular and robust
  • Imbue the full might of #BlueDickLanguage into this repo
zen - v13.0.0 Angular v17 Update

Published by ZenSoftware 11 months ago

  • Updated all dependencies. Including an update to Angular v17.
  • Regenerated the Nx repo utilizing Nx v17
  • Converted all ngIf and ngFor structural directives to Angular's new control flow syntax.
  • Introduced i18n branch with all text extracted into JSON files ready to be translated.

Breaking Changes

  • loggedIn and userRoles fields within AuthService have been changed from Angular signals to rxjs observables. This change was necessary to update to Angular v17.
zen - v12.0.0 Updated Prisma to v5.5.2

Published by ZenSoftware 12 months ago

  • Updated Prisma to v5.5.2

Breaking Changes

  • There have been changes to the typings for Prisma count in their latest release. This requires deleting and regenerating the Nest GraphQL resolvers under apps/api/src/app/graphql/resolvers/prisma. The User GraphQL resolvers can be kept as the changes have been pushed to the repository.
zen - v11.3.0 Nx v17 update

Published by ZenSoftware 12 months ago

  • Updated repo to Nx v17
  • Updated dependencies
zen - v11.2.0 Dependencies update

Published by ZenSoftware about 1 year ago

  • Updated all dependencies

Breaking Changes

zen - v11.1.0 Prisma v5 update

Published by ZenSoftware about 1 year ago

Pal.Js v6.0.5 has resolved the issues that blocked us from upgrading to Prisma v5. The code generating templates have been updated. Resolvers under apps/api/src/app/graphql/resolvers/prisma can be deleted and regenerated. Though, the User.ts resolver can be kept as it has been regenerated and committed to the repo.

zen - v11.0.0 Pal.Js v6 update

Published by ZenSoftware about 1 year ago

Updated all dependencies we are not blocked on. Notably the largest change is an upgrade to Pal.Js v6. Code generation scripts have been adapted to accommodate for the changes.

zen - v10.0.0 Project structure updates and new defaults

Published by ZenSoftware over 1 year ago

๐ŸŽ‰ This major release completes many large milestones. There has been a refactor across the project to consolidate code into fewer libraries and a new project structure that is more organized to enable better management of domain assets. There is much more clarity of where things belong and there is a better conceptual model for consumers of core libraries. The new default configurations that come out of the box should be sufficient for the majority of projects.

The starter kit is now in a pristine state and the solutions provided are feature complete. Nearly every line of code has been reviewed and rewrites have been done across the project for cleaner and leaner solutions.

Furthermore, debugging with VSCode works well for both the api (Nest) and portal (Angular) apps. There have been problems within the Nx community with not having breakpoints working. Fortunately, there are workarounds that this project implements to ensure everything is operating as expected.

Tech stack

The project dependencies have been updated to the latest version across the board. We are not blocked from updating to the latest version for almost any of our dependencies. We're riding on the bleeding edge of all solutions available.

Noteable updates for this version include:

  • Nx updated to v16.3.2
  • Angular updated to v16.0.5
  • Prisma updated to v4.15.0
  • apollo-angular updated to v5.0.0
  • @graphql-codegen/cli has been updated to v4.0.1

Documentation

  • Better coverage of documenting project environment configurations.

Kendo branch

๐ŸŽ The kendo branch has integrated new features.

  • @zen/grid component is able to export data grid results to JSON.
  • Updated to newest theme and packages.

Refactors

  • GraphQL resolvers for the Prisma endpoints now have their code generated output to its own prisma subfolder within the GraphQL resolvers folder.
  • Default auth scheme is now set to RBAC for the code generating script at tools/generate.ts.
  • @casl/prisma integration is marked as experimental but its integration is kept as the project's solution for ABAC and is still feature complete.
  • The Angular component has been moved from its own library @zen/layout to @zen/components and @zen/layout has been removed.
  • @zen/auth has had a major overhaul for all its Angular components to make everything more reusable.
zen - v9.0.0 Angular v16 update and standalone component migration

Published by ZenSoftware over 1 year ago

  • Updated to Angular v16
  • Updated to Node v20
  • Updated to Nx v16
  • Updated to Apollo v4
  • Migrated entire project from Angular NgModules to standalone components
  • Refactored code to replace all Apollo reactive variables with Angular signals

Breaking changes

  • AuthService userRoles & loggedIn fields are now Angular signals
zen - v8.0.0 Authorization Overhaul

Published by ZenSoftware over 1 year ago

This major release contains a complete overhaul for authorization. A lot of thought went into creating a more maintainable authorization scheme. View @zen/nest-auth README.md for documentation. Previously there were specific guards & decorators depending on whether they were being applied to HTTP or GraphQL contexts. These have all been reconciled into guards & decorators that work for both contexts. For example, @GqlUser & @HttpUser have been replaced with @CurrentUser.

Furthermore, the code generation of the GraphQL resolvers for the Prisma CRUD endpoints have been rewritten to properly implement @casl/prisma. It required some experience with the library to really work out how to best integrated CASL into the api. Authorization is in a much better place for this release.

Features

  • Regenerated the entire monorepo utilizing the latest version of Nx.
  • All dependencies updated.
  • The monorepo now works with other package managers, specifically pnpm.
  • Went through the package.json with a fine tooth comb and removed all unnecessary dependencies.
  • Scrubbed out all dead code from the repo.
  • Theme has been updated to accommodate for the major changes made in @angular/material v15.
  • TypeScript strict & noImplicitAny flags has been enabled for the Nest app. This ensures many more guarantees for correctness.
  • strictPropertyInitialization flag has been disabled due to class-validator not playing well with it.
  • For scalability reasons, the user's id field is now a String @default(uuid()) instead of Int @default(autoincrement()).
  • kendo branch has been updated to the newest release of Kendo v11.
  • otel branch now integrates Prisma tracing.
  • Added more tests throughout the repo.
  • Dockerfile that builds the API for production now utilizes pnpm instead of npm.
  • Added a 404 Page not found component for the Angular app.
  • Removed @zen/api-interfaces library and consolidated everything under @zen/common.
  • Integrated Storybook for the @zen/auth & @zen/components libraries. This allows for a simple way to browse the catalogue of components available.
  • Refactored the services that the code generated GraphQL resolvers depend on to enable the resolvers to be unit testable.
  • Polish, polish and more polish. ๐ŸŽ
zen - v7.0.0 Angular v15 and Prisma 4 upgrades

Published by ZenSoftware almost 2 years ago

  • Updated to Angular v15
  • Updated to Prisma v4
  • Updated to PalJS v5
  • Integrated @casl/angular & @casl/prisma

There was a need for a major refactoring of the project to convert it from a monolith into something much more modular. One in which multiple Nx apps could be backed by their own respective databases. Housing their own schema.prisma file under apps/<APP_NAME>/schema.prisma, rather than a single prisma/schema.prisma file existing at the root.

  • Customized the output paths to Prisma client
  • Refactoring the Nest auth code into a standalone library named nest-auth in which multiple Nest apps could import
  • Overhauling the code generation scripts under tools
  • Make PrismaSelect work with custom output path https://github.com/paljs/prisma-tools/issues/210
  • Custom file for casl-prisma integration via the recommended casl-prisma.ts

Bug fixes

zen - v6.0.0 Nest v9 & Angular v14

Published by ZenSoftware about 2 years ago

๐ŸŽ New optional tech integrations

zen - v5.0.4 Sign in with Google & Commitizen

Published by ZenSoftware over 2 years ago

  • Integrated sign in with Google via Google OpenID Connect. Serves as an example of how to add OpenID connect providers with @nestjs/passport
  • Integrated Commitizen for standardized git commits.
  • Changed GitHub default branch from main to base. This project is intended to be a base for several forked projects. Duplicate branch names are not allowed, so we do not want to take up the main branch name. Forked projects can keep their projects up to date with the latest version of this repo by adding this repo as a remote, pulling changes, and then merging base into their own main branch.
  • Added an example of uploading an array of files via GraphQL.
  • Re-named all git tags from vX.X.X to zX.X.X to not occupy conventional semantic versioning tags of forked projects.
  • Hide Login link on /login page.
  • Exposed userId in AuthService.
  • Fixed height issues with <zen-layout>
  • All dependencies updated to latest version.
  • Created options for ForbidNestedCreateGuard of type { allow: string[] } to list fields to allow
    nested creates while forbidding all other nested creates within mutation arguments. This maximizes
    flexibility to describe what is safe to expose on the API surface layer.

BREAKING CHANGE: Renamed RejectNestedCreateGuard to ForbidNestedCreateGuard

zen - v4.1.0 RejectNestedCreateGuard for mutations

Published by ZenSoftware over 2 years ago

zen - v4.0.0 Nx 14 update

Published by ZenSoftware over 2 years ago

  • Updated project from Nx v13 to v14
  • All dependencies updated
  • Small refactor of @zen/auth to clean up code
zen - v3.2.0 replaced subscriptions-transport-ws for graphql-ws

Published by ZenSoftware over 2 years ago

  • @apollo/client v3.5.10 now supports the newer GraphQL subscription library graphql-ws. The starter kit is now converted to utilize the newer library as a substitute for the older library subscriptions-transport-ws.
  • All dependencies have been updated
zen - v3.0.8 Updated to Font Awesome v6

Published by ZenSoftware over 2 years ago

zen - v3.0.0 Update to @nestjs/graphql v10

Published by ZenSoftware over 2 years ago