@wizdm/downloader

Cross origin downloader helper


Keywords
Angular, Download, cors, spa
License
MIT
Install
npm install @wizdm/downloader@1.2.0

Documentation

Wizdm

status stability contribution issues ngversion license

Live demo: https://wizdm.io

Wizdm is a boilerplate to kickstart serverless single page applications based on Angular and Firebase. Designed to help aspiring startuppers bootstrapping their side projects into functioning prototypes ready to launch.

Developers' notes

The project revolves around a web-app running on Angular + Angular Material + FlexLayout with a minimal clean interface to fit both desktop and mobile. Icon set comes from both Material and FontAwesome. Including Hammerjs to handle gestures for material components. Using Moment for time and locale management.

Firebase

The app relies on several firebase services:

  • Firebase Hosting to host the production demo app at https://wizdm.io
  • Firebase Auth for user authentication
  • Cloud Firestore realtime database for user's profile and content
  • Cloud Storage for user's images and files
  • Cloud Functions to run key tasks server-side

Take a look on @wizdm/connect library abstracting the communication layer with all the firebase services.

Internationalization

The project uses a content resolver to dynamically load contents in different languages by pre-fetching localilzed content from 'assets/i18n'.

At first start, the resolver checks the authenticated user language preferences falling back detecting the browser language when unavailable (aka the user is not logged in). This provides the useful side effect of preventing the initial page from flickering between unlogged and logged-in statuses while an already logged-in user is loading the app from scratch.

The router is used to switch among languages, so, from the user perspective, it looks like having multiple apps in different languages (e.g. https://wizdm.io/en/home for English or https://wizdm.io/it/home for Italian).

The localized content is provided by means of the wmContent directive granting smooth transitions while switching languages without the need of reloading the full page nor the app.

Take a look on @wizdm/content package for further information.

Development server

Run ng serve for a dev server. Navigate to https://localhost:4200/. The app will automatically reload if you change any of the source files. Be aware that --ssl option is enabled by default using local ssl/server.crt and ssl/servr.key files.

Code scaffolding

The workspace is arranged as a monorepo. This means both the source code of the web application(s) and the potentially shared libraries are stored in the same single repository.

/
├──/animate  - Animate On Scroll
├──/connect  - Firebase package
├──/content  - Content resolving (multi-language)
├──/elements - UI components
├──/emoji    - Emoji support
├──/markdown - Markdown renedrer
├──/wizdm    - The main app
:
├── angular.json        ⎫
├── firebase.json       ⎪
├── package.json        ⎬ Config files
├── tsconfig.json       ⎪
├── tsconfig.base.json  ⎪
└── tslint.json         ⎭

Run ng generate component component-name to generate a new component to be added to the wizdm default project or specify --project=project-name otherwise. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

To generate a new library, run ng generate lib library-name that will be automatically added to the workspace as a publishable package.

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

Run ng test to execute the unit tests via Karma.

Run ng e2e to execute the end-to-end tests via Protractor.

Run firebase deploy to upload the last build.

Repository

Source code is now mantained on GitHub.

Resources