Giter VIP home page Giter VIP logo

frontend-challenge's Introduction

SWAPI Character Explorer

SWAPI Character Explorer is a React application that allows users to explore characters from the Star Wars universe and view information about their homeworld.

Table of Contents

Demo

Live demo available here.

Features

  • Browse characters from the Star Wars universe.
  • View detailed information about each character, including their name, height, mass, gender and homeworld.
  • Filter characters from a specific planet.

Specifications

This application was developed following the mock-up and the established prerequisites in this document.

First, the components that make up the page and which entities/data are present on the screen were identified. Therefore, we have the following prototype:

With the main components defined, we have the following data model for the presented information:

export interface People {
  name: string;
  height: string;
  mass: string;
  gender: string;
  homeworld: string;
  url: string;
}

export interface Planet {
  name: string;
  url: string;
}

Tech Decisions

  • (SWR) Considering that we need to display information about Character and HomeWorld asynchronously, I decided to use the SWR library, which facilitates the management of information requests and has an intelligent cache system (stale-while-revalidate), improving the performance of the application and offering a smoother experience.

  • CSS Modules Considering the simplicity of the page styles, i decided to use only CSS modules for styling the page elements because it has a ready-to-use setup with Create React App and has the advantages of having style isolation avoiding conflicting class names, readability and maintenance (as associated styles are kept close to the component itself).

  • Relative Sizes (Responsiveness) Using relative sizes (rem) so that the elements of the page adapt to the screen size, thus achieving greater visual consistency and a more cohesive user experience.

  • Firebase Hosting Firebase Hosting offers a quick and easy deployment experience for hosting frontend applications, making it simple to display development results in a production environment.

Folder Structure

- api // all files/logics used to use in the API
- components // primitive components used in the entire app
- pages // all pages used on the route system
- types // the app global types

Tech Debts

  • Improve the component isolation, creating more basic components like Button, List and Select.
  • Create a infinity loading feature that loads more characters every time the user scrolls to the bottom of the page.
  • Add a search by name feature that finds a character by their name.
  • Add babel module resolver to simplify file imports.
  • Improve the image sizes for mobile devices.

Technologies Used

  • React
  • SWAPI (Star Wars API) for fetching character and homeworld data
  • React Router for navigation
  • SWR for fetch content and cache data
  • Firebase (for deployment)

Setup

How to set up and run the project locally.

  1. Clone the repository:
  git clone https://github.com/valtermartins1301/frontend-challenge.git
  1. Install dependencies:
  cd frontend-challenge
  yarn install
  1. Start the development server:
  yarn start
  1. Open http://localhost:3000 in your browser to view the app.

License

MIT

frontend-challenge's People

Contributors

valtermartins1301 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.