This Angular application is used by administrators to update the CSSS site database.
Install dependencies and start the local server:
npm install
npm startThe application is served at http://localhost:8080/ and reloads when source files change.
npm start regenerates the backend API client before starting Angular.
Generate TypeScript constraint objects from the local OpenAPI 3.1 document:
npm run api:constraintsThe command reads src/app/api/backend-api.schema.json and writes
src/app/api/backend-api.constraints.ts. Generated constraints keep requiredness and nullability
separate and expose values such as minLength, maxLength, numeric bounds, patterns, array bounds,
formats, enums, and defaults.
Use those values with Signal Forms validators:
import { honoraryMemberCreateConstraints } from '@api/backend-api.constraints';
const constraints = honoraryMemberCreateConstraints;
if (constraints.name.required) {
required(path.name);
}
maxLength(path.name, constraints.name.maxLength);npm run prebuild, npm start, and npm run build regenerate the constraint file after generating
the local API client. Handwritten cross-field and UI-only validation remains in the dialogs.
The separately packaged schematic in schematics/ creates the table, dialog, source service,
and their specs. Build and link it locally before generating:
cd schematics
npm install
npm run build
npm link
cd ..
npm link csss-crudRun the generator from the application root:
ng generate csss-crud:crud <feature-name> --model <ResponseType> --create-type <CreateType>--model is the API response interface and --create-type is the create-request interface.
For example, using the generated candidate API models:
ng generate csss-crud:crud candidates --model Candidate --create-type CandidateCreateFiles are created under src/app/pages/dashboard/<feature-name>. The schematic deliberately
does not edit routes or navigation. After generation:
- Verify the source service inferred the correct API service, method names, and signatures.
- Verify its primary key and add valid default model values.
- Add the Signal Forms model and fields, then apply its generated API constraints.
- Define the AG Grid columns.
- Add the feature to the dashboard routes.
- Add its top-bar navigation item.
Generation fails if any destination file already exists.
Application unit tests use Angular's Vitest builder:
npm test -- --watch=falseRun the schematic's Node-environment Vitest suite from the application root:
npm run test:schematicsnpm run lint
npx ng buildnpm run build also regenerates the backend API client before invoking the Angular build.