Skip to content

edukera/ng-base

Repository files navigation

NgBase

This project was generated with Angular CLI version 18.0.3.

Firebase

Firebase is used for:

  • authentication
  • firestore
  • hosting

API Keys

Find firebase API keys in firebase console under project parameters, and create the .env file at the root of the project:

FIREBASE_API_KEY="XXXX"
FIREBASE_AUTH_DOMAIN="XXXX"
FIREBASE_PROJECT_ID="XXXX"
FIREBASE_STORAGE_BUCKET="XXXX"
FIREBASE_MESSAGING_SENDER_ID="XXXX"
FIREBASE_APP_ID="XXXX"
FIREBASE_MEASUREMENT_ID="XXXX"

where XXXXs are replaced with actual values. These values are injected in the environment.ts file at build time, with the help of custom-webpack package.

Action link

Edit %LINK% for email templates (firebase console/authnetication/models/edit). Replace

https://ng-base-2b40d.firebaseapp.com/__/auth/action
  • with prod link:
http://ng-base-2b40d.firebaseapp.com/en/action
  • with dev link when testing locally:
http://localhost:4200/action

I18N

Localization

Run the following command to generate (en) localization file:

ng extract-i18n --output-path src/locale

This generates the src/locale/messages.xlf file for transaltion.

Then translate and create the src/locale/messages.fr.xlf file, either manually or with dedicated translation tools like localazy.

More information on angular internationalization and localization here.

Test locally

Run ng build --localize to build the project. The build artifacts will be stored in the dist/ directory:

  • dist/ng-base/en
  • dist/ng-base/fr

Then copy /utils/404.html to dist/ng-base directory with and start a local http server:

cp ./utils/404.html ./dist/ng-base
cd dist/ng-base
http-server -p 8080

http-server is an nodejs http server.

Build & Deploy

Build & deploy on firebase hosting with:

npm run build
firebase deploy

Style

Theme Palettes

Ng-base defines the Material Design 3 palette for a light and dark theme. A palette defines 6 sets of colors (primary, secondary, terciary, neutral, neutral-variant and error), each set containing 16 colors (26 for neutral), hence a total of 106 colors! However Angular CLI provides a tool to generate a palette from one to four 'seed' colors:

ng generate @angular/material:m3-theme

Check the default light and dark themes.

Tier tool like themes.angular-material.dev may be used to visualize the material components from seed colors.

Icons

The 'outline' font set is used by default. Remove line:

{ provide: MAT_ICON_DEFAULT_OPTIONS, useValue: { fontSet: 'material-icons-outlined' } }

from app.config.ts file to use the default plain font set.

Resources

Technical Docs

Typewriter effect

The login typewriter effect is inspired by this source.

Images

The login image is from www.cleanpng.com (online source).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published