Warning: client only.
Use the REST API from the backend spring-petclinic-rest project.
Start the backend server before using workflows that call the API. The frontend expects the Spring Petclinic REST API at http://localhost:9966/petclinic/api/.

Use Node.js 24.x and npm. The project uses Angular 22 and keeps the Angular CLI as a local dev dependency.
nvm use
npm ciFor a fresh dependency resolution during maintenance, run npm install and commit the regenerated package-lock.json.
Run npm start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run npm run ng -- generate component component-name to generate a new component. You can also use npm run ng -- generate directive|pipe|service|class|module.
Run npm run build to build the project. The build artifacts will be stored in the dist/ directory. Use npm run build -- --configuration production for a production build.
You can also build the application in a dedicated docker image using the provided Dockerfile as follows:
docker build -t spring-petclinic-angular:latest .Then you will be able to use it as follows:
docker run --rm -p 8080:8080 spring-petclinic-angular:latestThe documentation of the Spring Petclinic Angular application is generated by the compodoc tool.
Documentation URL: https://spring-petclinic.github.io/spring-petclinic-angular/
Regenerate the docs folder with compodoc:
compodoc -p src/tsconfig.app.json -d docsBuild Angular application:
npm run build -- --configuration production --base-href=/petclinic/ --deploy-url=/petclinic/
Create sub-directory /petclinic in default nginx directory /usr/share/nginx/html
Copy the Angular application build output from /dist to /usr/share/nginx/html/petclinic
Edit nginx config (nginx.conf file in /etc/nginx/ directory)
server {
listen 80 default_server;
root /usr/share/nginx/html;
index index.html;
location /petclinic/ {
alias /usr/share/nginx/html/petclinic/dist/;
try_files $uri$args $uri$args/ /petclinic/index.html;
}
}Reload nginx: nginx -s reload
Run app in browser: http://server_name/petclinic/
npm run build -- --configuration production --base-href=/petclinic/ --deploy-url=/petclinic/
Create sub-directory /petclinic in default Apache directory /var/www/html
Go into the Angular application build output under /dist and copy all files and subdirectories from it to /var/www/html/petclinic
Edit Apache config (/etc/https/conf/httpd.conf):
sudo vi /etc/httpd/conf/httpd.conf
Find the Directory /var/www/html> section and change the AllowOverride directive from None to All:
/etc/httpd/conf/httpd.conf
. . .
<Directory /var/www/html>
. . .
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
. . .
</Directory>
. . .sudo systemctl restart httpd
sudo vi /var/www/html/petclinic/.htaccess
Add the following line to the top of the file to activate the RewriteEngine, which instructs Apache to process any rules that follow:
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ index.html sudo systemctl restart httpd
Run npm test to execute the unit tests via Karma. Run npm run test-headless for a single Chrome Headless pass.
Run npm run e2e to execute the end-to-end tests via Playwright. The Playwright config starts the Angular dev server automatically. Install Playwright browsers first with npx playwright install --with-deps.
Run npm run lint to lint TypeScript and Angular templates with Angular ESLint.
To get more help on the Angular CLI use npm run ng -- help or visit the Angular CLI documentation.