Github Profile Search Web App Using LWC

Hey There!

We gonna build Github Profile Search Web App using Lightning web components with Github API. follow the steps, Let’s begin 🙂

STEP 1:  Create your Github Profile Search App

Follow The CLI steps to setup your app.
Note : you must have Node.js installed, with at least npm 5.2+.
npx lwc-create-app you-app-name

cd your-app-name

npm run watch

Now you will have an app folder structure like this.

STEP 2: Work with your component files

Now you just check the src folder, Modules and components will be there.

open your following files and paste the code

  • App.html
  • App.js
  • App.css

Create an API Request to fetch the data


import { LightningElement, track } from 'lwc';

const QUERY_URL = '';

export default class MiscRestCall extends LightningElement {
    @track searchKey = 'Kumaresan';
    @track profiles;
    @track error;

    handleSearchKeyChange(event) {
        this.searchKey =;

        fetch(QUERY_URL + this.searchKey)
            .then(response => {
                if (!response.ok) {
                    this.error = response;
                return response.json();
            .then(jsonResponse => {
                this.profiles = jsonResponse;
            .catch(error => {
                this.profiles = error;
                this.profiles = undefined;
<!-- APP.html -->
    <div class="search">

    <div if:true={profiles}>
            <template for:each={profiles.items} for:item="profile">
                <div key={} class="search-results">
                    <img src={profile.avatar_url} alt="" />
.search {
    text-align: center;
.search input {
    border-radius: 41px;
    height: 50px;
    padding: 10px;
    width: 350px;
    border: 1px solid black;
.search input:focus,
.search input:active,
.search input:hover {
    background: transparent;
    outline-color: transparent;
.search-results {
    border: 1px solid #9e9e9e38;
    height: 70px;
    width: 300px;
    border-radius: 10px;
    display: inline-block;
    margin: 10px;
.search-results p {
    font-size: 20px;
    margin-left: 10px;
    display: inline-block;
    text-transform: capitalize;
.search-results img {
    height: 50px;
    width: auto;
    border-radius: 50px;
    float: right;
    margin-top: 10px;
    margin-right: 10px;

STEP 3: Run your app

Finally, run your app using CLI

npm run watch

Hope you got the Github Profile Search App, you can also download the source code from my GitHub page 

Leave A Comment