/cmi-viaduc-web-frontend

The present repository provides the source code of an Angular application that constitutes the public part of the online access.

Primary LanguageTypeScriptGNU Affero General Public License v3.0AGPL-3.0

cmi-viaduc-web-frontend

Context

The Viaduc project includes 6 code repositories. The present repository cmi-viaduc-web-frontend provides the source code of an Angular application that constitutes the public part of the online access. Together with the internal management application (cmi-viaduc-web-management), it uses a common code library (cmi-viaduc-web-core). The front-end applications are hosted in an ASP.NET container (see backend repository cmi-viaduc-backend) and communicate with the system via web API. With the release 2.0.0.1113, two new repositories were added to provide the system with IIIF viewer capabilities. There is the actual IIIF-Viewer (cmi-iiif-frontend) and the required backend (cmi-iiif-backend) that adds the required IIIF services like search.

The Big-Picture

Note: A general description of the repositories can be found in the repository cmi-viaduc.

Architecture and components

This is an Angular CLI project in the form of an application. The files generated by the build process are stored in the client folder within the CMI.Viaduc.Web.Frontend WebAPI project.

The application contains the GUI for the main application, the public area of the online access.

Modules

  • app
    • Components that are directly accessed by routing (1st level route) (pages)
  • client
    • Components and services used within the pages, e.g. for searching, ordering, navigation, etc.

First steps

Preparations

  • Node.js download, LTS version
  • Make sure that old angular/cli versions are uninstalled
    • npm uninstall angular-cli
    • npm uninstall @angular/cli
    • npm cache clean --force
  • Install Angular CLI
    • npm install -g @angular/cli
  • Clone repository cmi-viaduc-web-core to a directory (e.g. C:\Viaduc)
  • Clone repository cmi-viaduc-web-frontend into the same root directory (e.g. C:\Viaduc)
  • Change to the cmi-viaduc-web-core directory with a command line
    • Run: npm i to install the dependencies
    • Run: npm run build to build the library

Install

  • Use the command line to change to the cmi-viaduc-web-frontend directory
    • Run: npm run link to link cmi-viaduc-web-core as a component
    • Run: npm i to install the dependencies
    • Run: npm run build build the project to a dist folder inside cmi-viaduc-web-frontend.

Customization

General

  • Pay attention to TSLint
  • Move business logic into services

Run tests

  • Run tests once ng test --watch=false
  • Run tests as watcher ng test

Execute

  • Variant a.)
    • build using npm run build and start ASP.NET (CMI.Viaduc.Web.Frontend)
  • Variant b.)
    • Start running build (file-watch) using npm run start and ASP.NET (CMI.Viaduc.Web.Frontend)

Authors

License

GNU Affero General Public License (AGPLv3), see LICENSE

Contribute

This repository is a copy which is updated regularly - therefore contributions via pull requests are not possible. However, independent copies (forks) are possible under consideration of the AGPLV3 license.

Contact

  • For general questions (and technical support), please contact the Swiss Federal Archives by e-mail at bundesarchiv@bar.admin.ch.
  • Technical questions or problems concerning the source code can be posted here on GitHub via the "Issues" interface.