Home

Awesome

PLEASE NOTE: THIS PROJECT IS NOT MUCH MAINTAINED ANY MORE Currently, it's running on Angular 14.2.4. You may need to use Node v16.17.1, to get the NPM installation and build running. Also you probably need to use "$npm install --force" to force the very old ngx-siema dependency to behave.. it still runs tho.

CAS FEE PROJEKT 2 : SPA Shop Front End Implementation

Check out this project online at http://shop.andre-abt.com Note: The pixelated product images are there because of image licensing reasons.

Installation

Clone repository

git clone git@github.com:monobasic/Angular-6-Demo-Shop.git

Install Angular-Cli globally

npm install -g @angular/cli

Install NPM packages

cd Angular-6-Demo-Shop
npm install

Run development server

ng serve

Runs a webpack-development server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Checkout the shop

Point your browser to localhost:4200. In any case the dev build is not working, there is an already built app available on http://shop.andre-abt.com for checking out. Deeplinking for the Angular router is handled via .htaccess config.

Run unit tests

ng test

Executes the unit tests via Karma.

Running end-to-end tests

ng e2e

Executes the end-to-end tests via Protractor.

Build app for prod

ng build --prod --build-optimizer

This builds the app for prod environment into a /dist folder. Uses the Angular-AOT-mode to precompile the the app. This reduces the app-footstep (compiler is around 1/3 of bundle).

Firebase Data Structure and Security Setup

There are demo json files in the data folder for you to check out.

Background

The initial idea for this project was to implement a SPA based shop frontend which can be coupled to existing shop backends via REST API. The performance of a SPA application would be very nice to make the shopping process for users as fluid as possible. Imagine adding items to the cart, browsing and filtering products, typeahead search, updating your favorites/wish list - all handled by the front end application.

Although this would have been cool, it's most likely a bit out of scope to provide all the API mappings for different shops like Shopify, Woocommerce, PrestaShop, Magento and the likes.

So we decided to implement basic shop functionality for now and base the project target more around finding conclusions for challenges we will face during the process.

Feature Set

Shop functionality

Shop Front Page

Products

Product CRUD

Rating

Cart

Checkout

Authentication

Account

Orders

Security

General

Custom Express/MongoDB Backend

Implementation started with a custom MEAN-architecture, which used a mLab-database. We switched to «serverless» with Firebase due to several reasons:

The unfinished project can be found under: CAS-FEE-PROJEKT-2-CUSTOM-MEAN-BACKEND

Special Mentions

UX-Test

UX-Tests are documented in ux-testing/ux-test.md.

Possible future features and updates

Final verdict

General outcome

Angular is great as a foundation for bigger web projects and multiple developers involved. The framework has a very defined structure and this helps, keeping things un-messy. However, third party components are rare right now, so even for basic UI stuff like carousels one need to spend a lot of time, to re-create well known jquery moduls functionalites in "the Angular way".

Theming/jQuery

Theme / third party ui component integration – as common as it is in the daily web agency business – is a challenge. Many themes are based around a styling framework like Bootstrap, HTML/CSS and user interface logic code in jQuery. As it seems some of the well known UI components like Isotope grid, imagesLoaded, Carsoussels and so on are not ported to Angular5 yet.

Learning curve

Angular & RxJS both have a steep learning curve.

SEO

Without using Angular Universal and server side rendering, its not possible to provide meta page title and description. This makes SEO - still a big topic around SPAs – harder. For a shop application, indexing and deep linking to shop product details are most probably the most important thing. Also xml file generation for google merchant could be a issue.

UI performance

UI performance and User experience is great for a shop on SPA basis. Instant feedback for user interactions, like rating of products via Firebase, is very cool too.

Firebase Backend

Firebase provides a whole lot of functionalities which make things like user-management a lot easier. However the security rules configuration needs a lot of attention. In general there is a lot of potential for security holes.

Testing

Karma tests run quite slow, this could be a issue if you have a lot of tests when the app is growing. Jest, the testing framework of Facebook/React would be a good alternative. We did some research and it was quite easy to integrate into an Angular application. Also worth mentioning: we found our way around, but if you need to mock AngularFire and/or Firebase API stuff, this could be major pain in the ass ;)

Extra extra

If you want to see how this project came to life according to its git-repo, checkout this awesome and funny video made with Gource (how to here):

<img width="906" alt="bildschirmfoto 2018-04-22 um 16 38 46" src="https://user-images.githubusercontent.com/16070364/39096101-ac275aec-464b-11e8-884d-c623920a43a6.png">