Giter Site home page Giter Site logo

flickr-photos-app's Introduction

FlickrPhotosApp

This is an Angular application implementing a photo search by using the Flickr API. This application is developed by using two methods of search results display. You can switch from one method to the other by using the toggle button above the search input filed. In the first view images are displayed in a grid view, using the Infinite scroll and Masonry modules. In the second view images are displayed in one cell per image view, using a more performant scroll module called cdk virtual scroll viewport. This two views display is done to showcase both cases considering the performance.

Main functionalities of the project

  • Search images by keyword
  • Display images in a grid view using Infinite Scroll
  • Display images in one image per cell view using CDK virtual scroll viewport
  • Open one image in FullScreen mode and display Title and Owner of the image

Structure of the code

This project was generated with Angular CLI version 12.1.3.

Angular Modules/ Packages used

  1. Angular Material --> Is used as the main UI component library to style elements inside our components, such as input fild, dialog of full screen, grid view of images
  2. ngx-infinite-scroll -->
  3. CDK scrolling (ScrollingModule)-->
    • Displays large lists of elements performantly by only rendering the items that fit on-screen. Loading hundreds of elements can be slow in any browser; virtual scrolling enables a performant way to simulate all items being rendered by making the height of the container element the same as the height of total number of elements to be rendered, and then only rendering the items in view. Virtual scrolling is different from strategies like infinite scroll where it renders a set amount of elements and then when you hit the end renders the rest.
    • In our project it is used to create a more performant search function (https://material.angular.io/cdk/scrolling/api)
  4. ngx-masonry -->

Project Structure

Components

  • App Component --> It is the main component
  • images-search --> It is the main view of search function and images display and it is the parent component of two views/ components: images-cdk-scroll and images-infinite-scroll. In this component we call the API that retrives all flickr images from the service flickr.service, we have created the open dialog or fullscreen image function that will be used in child components.
  • images-cdk-scroll --> Uses CDK scrolling (ScrollingModule) to scroll images. For the moment the view is developed in one image per cell since cdk does not allow grid view by default. This component uses/ emits the functions created in parent component by using @Output and EventEmitter.
  • images-infinite-scroll --> Uses ngx-masonry and ngx-infinite-scroll to load images. It is build in a grid view mode. This component uses/ emits the functions created in parent component by using @Output and EventEmitter.
  • fullscreen-image --> Here we can find the fullscreen image dialog and related details such as title and owner of image.

Services

  • flickr service --> Here there is a function that does an api call to flickr api to retrive images and their details by keyword added by user

Models

Here we have all the interfaces used in the app

  • FlickrOutput --> used for all photos array
  • FlickrPhoto --> used for a single photo object
  • SearchedImages --> used for images that are searched and selected to view in fullscreen mode

Environments folder

Here we have two files used for any environmental variables. In our case here we have the api_key of flicker used in the params of the api call done in the service

Global Styles

  • All global styles are added in style.sass file which are used in several components.
  • Overall the pink-bluegrey theme of angular material is used, considering the icon of flickr

How to run the App

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

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

flickr-photos-app's People

Contributors

erkah avatar

Watchers

 avatar

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.