Skip to content

AndrewJBateman/ionic-angular-infoapp

Repository files navigation

⚡ Ionic Angular InfoApp

  • App to search for info from an API and display it using the Ionic framework.
  • Uses a movie database API to develop the app.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • An active search bar enables the user to search for movies, with a list of matches appearing below. Each returned movie card can be clicked on to see more details.
  • The API searches the The Open Movie Database for search matches.

📷 Screenshots

Home Page Home Page

📶 Technologies

💾 Setup

  • Get yourself an API key from the The Open Movie Database - it's free :-)
  • Add your movie database access credentials to environment.ts for dev. work
  • npm i
  • To start the server on localhost://8100 type: 'ionic serve'
  • The Ionic DevApp was installed on an Android device from the Google Play app store.

💻 Code Examples

  • functions to search for info and retrieve more detailed info.
// Get data from the Omdb Api
  // map the result to return only the results "Search" that we need
  // @param {string} title Search Term
  // @param {SearchType} type movie, series, episode or empty
  // @returns Observable with the search results
  searchData(title: string, type: SearchType): Observable<OmdbSearchResult> {
    return this.http
      .get<Observable<OmdbSearchResult>>(
        `${this.url}?&apikey=${this.apiKey}&s=${encodeURI(title)}&type=${type}`
      )
      .pipe(
        map((results) => {
          console.log("RAW: ", results);
          return results["Search"];
        })
      );
  }
  // Get detailed information using the "i" (not "id") parameter
  // @param {string} id imdbID to retrieve information
  // @returns Observable with detailed information
  getDetails(id: string): Observable<any> {
    return this.http
      .get<Observable<OmdbDetailResponse>>(
        `${this.url}?i=${id}&plot=full&apikey=${this.apiKey}`
      ).pipe(tap(res => console.log("response: ", res)))
  }

🆒 Features

  • Working search bar
  • Ion icons look cool although I have made no attempt to optimise this app for a compact build file, otherwise I would replace with svg files
  • API response interface models added
  • API search function code commenting is good - I have Simon Grimm to thank for that fine example

📋 Status & To-do list

  • Status: Working.
  • To-do: Nothing

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact

  • Repo created by ABateman, email: gomezbateman@gmail.com

About

📋 App to search for info from an API and display it using the Ionic framework. Currently using a movie database API to develop the app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published