Skip to content

Arash217/web-app-from-scratch-18-19

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COUNTRIES OVERVIEW

Summary

A single page application made with the help of Director and Handlebars to show an overview of all countries.

Overview

1. Live demo

Week 1 live demo

Week 2 live demo

Week 3 live demo

2. Usage

Fork and/or clone it. Serve the app from a webserver.

git clone https://github.com/Arash217/web-app-from-scratch-18-19

3. Restrictions

4. Features

  • Countries overview
  • Country details
  • Filter countries
  • Sort countries

5. Wishlist

  • Time-based cache
  • Error handling
  • ES6 modules
  • ES6 classes
  • Using higher order functions to maximise reusability
  • Shorter names for functions, variables, etc.
  • Handlebars templates in separate files

6. API

REST Countries is used to fetch countries data as JSON. The API is used in the overview page to retrieve and display the name, flag and country code of all countries. Additional data is requested and shown in the detail page.
There aren't any restrictions mentioned in the docs of REST Countries.

7. Best practices & Design patterns

Best practices:

  • Strict mode (not needed with ES6 modules)
  • Constants instead of variables
  • CamelCase
  • Line length under 80
  • End statements with semicolon
  • Avoid else, return early
  • Single quotes for strings

Design patterns:

  • IIFE (not needed with ES6 modules)
  • Proxy pattern for time-based cache
  • Template method pattern for rendering pages

8. Actor diagram

Week 2

Actor diagram

Week 3

Actor diagram

9. Interaction diagram

Note: the numbers are used to display the order of method execution.

Home

Actor diagram

Details

Actor diagram

Search and sort

Actor diagram

Licence

MIT © Arash Paknezad

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 62.2%
  • HTML 19.5%
  • CSS 18.3%