Skip to content

My portfolio website for small projects and web experiments.

Notifications You must be signed in to change notification settings

ardislu/ardis.lu

Repository files navigation

ardis.lu

Maintainability

This project contains the Angular codebase for my personal website ardis.lu.

Requirements

Setup

  1. Clone the repository
git clone https://github.com/ardislu/ardis.lu.git
  1. Install project dependencies
npm i
  1. Build the project and start a development web server
npm run start
  1. Open the web app in a web browser: http://localhost:4200/

Pre-commit hook

The npm postinstall script configures git locally to run a custom pre-commit hook located at .git-hooks/pre-commit.

The pre-commit file is a bash script that pipes any staged .js or .ts files to eslint and any staged .css or .scss files to stylelint.

Unit and e2e testing

This project uses Jest for unit testing (instead of Jasmine + Karma) and Playwright for e2e testing (instead of Protractor).

The Angular architects have been adapted for these frameworks so tests are still run with the usual npm run test and npm run e2e.

Cloudflare Tunnel

This project uses cloudflared in the tunnel npm script. This command exposes localhost over a publicly-accessible HTTPS URL.

A tunnel is required to test this website on other devices because some web APIs used in this site are restricted to secure contexts.

To use tunnel, you must set up cloudflared.

npm scripts

Modified npm start runs ng serve --hmr --host 0.0.0.0 instead of the default ng serve.

npm start

Build the web app then host it locally using local-web-server. Use to simulate production for e2e testing.

npm run stage

Build the web app then use source-map-explorer to analyze main.js. Use to identify and reduce bloat.

npm run analyze

Lint the entire project with ng lint (for Typescript and HTML) and stylelint (for SCSS).

npm run lint