Thank you for contributing to the WISdoM frontend project! This document outlines everything you need to know to get started and contribute effectively.
This repository contains the entire frontend source code for the
WISdoM project.
All previous frontend-*
repositories have been archived in favor of a
monolithic structure, which Angular supports better than a multi repo.
We use Angular as it provides a robust and structured
approach to web development compared to libraries like React or Vue.
Though the learning curve may be steep, the final codebase remains clean and
maintainable.
We use Bulma as our CSS framework. It's lightweight, JS-free, and easy to integrate. Some additional behavior is built around Bulma; check:
src/variables.scss
: for custom variables.src/common/directives/
: for Bulma-compatible Angular directives.
-
Use Volta to manage your Node version. Do not install Node manually. Volta can also install a global Node version, so don't be scared.
-
Install project dependencies via:
npm install
If you want to use VSCode, make sure you check
out the .vscode
directory for helpful preconfigured settings.
Recommend Extensions:
- Angular Language Service: Angular code assistance.
- Todo Tree: List all TODOs across the project.
- Thunder Client: API endpoint testing.
- Pretty TypeScript Errors: Readable TS error messages.
- Scope to This: Simplifies file navigation in large projects.
VSCode Settings:
cSpell.language
: Set toen
andde
for mixed English-German strings.typescript.tsdk
: Uses workspace TypeScript for TOML support.
Run scripts via npm run
.
Key scripts include:
start
: Start local development server.build
: Build the application for production.lint
: Run the linter.fmt
: Format the codebase.doc
: Generate documentation.
Ensure you run lint
and fmt
before pushing.
The CI enforces this.
In order to automatically format and lint the codebase, you can use husky (https://typicode.github.io/husky/get-started.html) install via
npm install --global husky
and make sure npm still functions with repeating
npm install
Then, whenever you commit anything via git or GitHub Desktop, both scripts get executed before the commit happens and you don't have to do so manually
Key directories:
public
: Static files copied directly intodist
for hosting.src
: Application code, split into:api
: Services for backend API interaction.common
: Shared components, utilities, and tools (highly documented).core
: Authentication, app frame, and core utilities.modules
: Individual feature modules (most work happens here).types
: Additional type definitions.- Important Files:
config.ts
: App configuration.i18n.ts
: Configures translation files and namespaces for the application.routes.ts
: Application routes.proxy.conf.json
: Local API proxy for development.styles.scss
: Global styles.variables.scss
: Shared Bulma variables.
-
Familiarize with Angular:
- Read some Angular docs.
- Consider completing the Angular tutorial.
- Make sure you understand Signals.
-
Workspace Setup:
- Create a new directory in
src/modules
for your feature. - Avoid generating unnecessary files.
- Create a new directory in
-
API Integration:
- Add new services in
src/api
. - Use
src/common/http-contexts.ts
for HTTP contexts. - Validate responses using AJV and
httpContexts.validateSchema
.
- Add new services in
-
Components:
- Build standalone components (Angular standard).
- Use Bulma classes and directives from
src/common/directives
.
-
Translations:
- Add an
i18n.toml
file in your module directory. - Include it in
src/i18n.ts
and choose a clear namespace. - Use translations via
TranslatePipe
orTranslateDirective
.
- Add an
-
Custom Signals:
- Check
src/common/signals.ts
for existing signals before creating new ones.
- Check
-
Styling:
- Use Bulma for consistency.
- Import
variables.scss
if you need Bulma variables or shared styles.
-
Exports:
- Each file should export a single symbol for better namespace management.
- Use the
namespace
keyword to group multiple symbols under one export.
-
Routing:
- Add routes to
src/routes.ts
, usually as a child for the""
route. - Make the route accessible by adding a
routerLink
tosrc/core/sidebar/sidebar.component.html
.
The project is licensed under the EUPL-1.2. Ensure any dependencies are compatible. Most MIT and Apache-licensed packages are fine.
Before submitting a PR:
- Run
npm run lint
andnpm run fmt
to pass CI checks. (see ## Git Pre-Commit Hooks above) - Ensure your module aligns with the project's structure and standards.
- Familiarize yourself with
src/common
— it might already contain what you need.
Happy coding! 🚀