Giter Site home page Giter Site logo

vallalr / oort-frontend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reliefapplications/ems-frontend

0.0 0.0 0.0 89.28 MB

Home Page: https://reliefapplications.github.io/oort-frontend/

License: GNU General Public License v3.0

Shell 0.03% JavaScript 0.51% TypeScript 81.15% CSS 0.01% Makefile 0.01% HTML 16.68% SCSS 1.61%

oort-frontend's Introduction

OORT Front-end

Github Pages Storybook

Versions

Branch Version CI
main GitHub package.json version (branch) Version
next GitHub package.json version (branch) Version
beta GitHub package.json version (branch) Version

Introduction

This front-end was made using Angular. It uses multiple external packages, but the relevant ones are:

It was made for a Proof of Concept of a UI Builder for WHO.

To read more about the project, and how to setup the back-end, please refer to the documentation of the project.

In top of Angular, Nx was installed, to better split projects and libs.

General

The project is seperated into three sub-projects:

  • back-office, an application accessible to administrators
  • front-office, an application that would depend on the logged user
  • web-widgets, an application to genereate the web components

One library exists:

  • safe, a library for common ui / capacity, shared with other projects

Library changes should automatically be detected when serving the other projects.

Azure configuration

If you want to deploy on Azure, build back-office and front-office:

npx nx run back-office:build:azure-dev
npx nx run front-office:build:azure-dev

For prod, replace azure-dev with azure-prod. For uat, replace azure-dev with azure-uat.

The compiled applications can be found there in ./dist/apps/ folder.

Useful commands

Development server

To serve a project, run:

npx nx run <project>:server:<config>

Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

For example:

npx nx run back-office:serve

will serve back-office with default development configuration.

npx nx run back-office:serve:oort-local

will serve back-office, connecting to the deployed back-end for development.

Code scaffolding

Generate a component:

npx nx g component <component-name>

Generate a module:

npx nx g module <module-name>

You can also use npx nx generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run npx nx run <project>:build:<config> to build a project. The build artifacts will be stored in the dist/apps/ directory.

Prettify scss and html

Run npx prettier --write "**/*.{scss,html}" to execute prettier and update all scss / html files locally.

Analyze bundle

Start by building apps adding --stats-json flag. For example:

npx nx run back-office:build -- --stats-json

Then, run webpack-bundle-analyzer command to see the tree of your bundles:

npx webpack-bundle-analyzer dist/apps/back-office/stats.json

Storybook

UI library has its own storybook definition. To execute storybook locally, you can run:

npx nx run ui:storybook

To build it, you can run:

npx nx run ui:build-storybook

Pushing the code on the repo should automatically deploy storybook on a public environment.

Web components

To test web components, you can:

Common issues

Javascript heap out of memory

In case you encounter any memory issue, open your terminal and type following command, depending on your vscode terminal. You should then be able to pass your commands as before.

Bash

export NODE_OPTIONS="--max-old-space-size=4096"

In case you still face issues, you can still increase it:

export NODE_OPTIONS="--max-old-space-size=8192"

Powershell

set NODE_OPTIONS="--max-old-space-size=4096"

In case you still face issues, you can still increase it:

set NODE_OPTIONS="--max-old-space-size=8192"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.