Giter VIP home page Giter VIP logo

ab-noori / space-travelers-hub Goto Github PK

View Code? Open in Web Editor NEW
22.0 1.0 0.0 2.25 MB

In this project, we will be working with the real live data from the SpaceX API. Our task is to build a web application for a company that provides commercial and scientific space travel services. The application will allow users to book rockets and join selected space missions.

Home Page: https://ab-noori.github.io/Space-Travelers-Hub

License: MIT License

HTML 7.36% JavaScript 75.74% SCSS 16.89%
api gh-pages react-hooks react-redux react-router reactjs readux-toolkit redux redux-thunk create-react-app

space-travelers-hub's Introduction

Space Travelers' Hub

Desktop View Representation
screenshot
screenshot
screenshot

๐Ÿ“— Table of Contents

๐Ÿ“– [Space-Travelers-Hub]

[Space Travelers' Hub] In this project, we will work with actual live data from the SpaceX API. our task is to build a web application for a company that provides commercial and scientific space travel services. The application will allow users to book rockets and join selected space missions.

๐Ÿ›  Built With

Tech Stack

Key Features

  • [Responsive layout]
  • [UX/UI accessibility]
  • [Dynamic data]

(back to top)

๐Ÿš€ Live Demo

(back to top)

๐Ÿ’ป Getting Started

To get a local copy up and running, follow these steps:

Prerequisites

In order to run this project you need:

  • A browser of you choice.
  • A text editor of your choice.
  • An installed node.js on your local system

Setup

Clone this repository to your desired folder:

  • Use the following Commands:

    cd your-desired-folder
    git clone [email protected]:ab-noori/Space-Travelers-Hub.git
    

Install

  • Install this project with:

     npx create-react-app my-app
     cd my-app
     npm start
    

Usage

  • Use the following commands to run the project on your local system:

    npm run build
    npm run deploy
    

Run tests

  • Run the following script and style test:

    npx eslint "**/*.{js,jsx}"
    npx eslint "**/*.{js,jsx}" --fix
    
    npx stylelint "**/*.{css,scss}"
    npx stylelint "**/*.{css,scss}" --fix
    

Deployment

  • 1- install gh-pages with following command:

    npm i -D gh-pages
    
  • 2- Add homepage to project's jason file:

    "homepage": "https://ab-noori.github.io/Space-Travelers-Hub",
    
  • 3- Add the following scripts to the package.jason file:

    "predeploy": "npm run build",
    "deploy": "gh-pages -d build ",
    
  • 4- Finally run the following command:

    npm run deploy
    

(back to top)

๐Ÿ‘ฅ Authors

๐Ÿ‘ค Abdul Ali Noori

๐Ÿ‘ค Dennis Owusu Prahi

๐Ÿ”ญ Future Features

  • [fetched data from api into redux store]
  • [Used redux toolkit]
  • [Applied conditional rendering of component]

(back to top)

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

โญ๏ธ Show your support

If you like this project, give it a star.

(back to top)

๐Ÿ™ Acknowledgments

I would like to thank Microverse and my coding partners. Also, I want to give credit to Nerd's lesson YouTub Channel, its react tutorial is really helpful.

(back to top)

โ“ FAQ (OPTIONAL)

  • How to make it mobile friendly?

    • Put a viewport tag in the header
  • How to design the site?

    • Draw a mockup before starting to code

(back to top)

๐Ÿ“ License

This project is MIT licensed.

(back to top)

space-travelers-hub's People

Contributors

ab-noori avatar til2to avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

space-travelers-hub's Issues

[1pt] Create empty My profile - Setup (group task)

  • Create a route and a view component. Use <NavLink /> for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).
  • This view should be empty - you will add content in separate tasks.

[4pt] Display missions - Lists render

  • Use useSelector() Redux Hook to select the state slices and render lists of missions in corresponding routes. i.e.:
// get rockets data from the store
const rockets = useSelector(state => state.rockets);
  • You can style the whole application "by hand" or you could use React Bootstrap, a UI library that could speed up the process. This is a popular library and working with its components would be good practice.
  • Render a table with the missions' data (as per design).

[3pt] - Add all items counter on the Homepage - Student A

Even if the API gives you the number of items, you will create a specific function to calculate it.

Make sure that the correct number is displayed on the Homepage.

Respect the following rules:

  • Each counter should be implemented as a separate module.
  • A counter function should look for specific DOM elements (e.g. for the comments counter it should look for comments) and make the counting based on what is actually displayed on the page.
  • A counter function should cover all the edge cases you can think about.

[1pt] Create basic structure for Missions - Setup

  • Create a route and a view component. Use <NavLink /> for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).
  • Create a directory for all Redux state slice files.

Team3 [4pt] Display dragons - Lists render

  • Use useSelector() Redux Hook to select the state slices and render lists of dragons in corresponding routes. i.e.:
// get rockets data from the store
const rockets = useSelector(state => state.rockets);
  • You can style the whole application "by hand" or you could use React Bootstrap, a UI library that could speed up the process. This is a popular library and working with its components would be good practice.

  • Render a list of dragons (as per design). For the image of a dragon use the first image in the array of flickr_images.

Team3 [1pt] Switch badges for Dragons - Conditional components

Dragons that have already been reserved should show a "Reserved" badge and "Cancel reservation" button instead of the default "Reserve dragon" (as per design).

Use the React conditional rendering syntax:

{rocket.reserved && ( 
    // render Cancel Rocket button
)}

Team3 [4pt] Fetch dragons - Fetch data

Fetch data from the Dragons endpoint (https://api.spacexdata.com/v3/dragons) when a user navigates to the Dragons section.

Once the data are fetched, dispatch an action to store the selected data in Redux store:

  • id
  • name
  • type
  • flickr_images

NOTE: Make sure you only dispatch those actions once and do not add data to store on every re-render (i.e. when changing views / using navigation).

[4pt] - Display Reservations pop up with selected item's details - Student C

Create a reservations popup only with the top section (displaying details of the selected item)

Screenshot 2021-06-27 at 22 10 45

When the popup loads, the webapp retrieves data from the selected API and shows details about the selected item.

Add event to button prepared by your teammate that will open your popup. You need to communicate with your team member to make sure that you do not block each other (most likely the easiest solution is to merge the list of items feature to the dev branch before you try to add that event).

[3pt] Implement mission joining - Actions

  • When a user clicks the "Join Mission" button, action needs to be dispatched to update the store. You need to get the ID of the selected mission and update the state. Remember you mustn't mutate the state. Instead, you need to return a new state object with all missions, but the selected mission will have an extra key reserved with its value set to true. You could use a JS filter() or map() to set the value of the new state - i.e.:
const newState = state.map(rocket => {
    if(mission.id !== id) 
        return mission;
    return { ...mission, reserved: true };
});
  • Regardless of which method you choose, make sure you place all your logic in the reducer. In the React view file, you should only dispatch the action with the correct rocket ID as an argument.

[4pt] - Display list of items on the Homepage - Student A

Create the main part of the homepage that keeps the layout from the wireframe:

Screenshot 2021-06-27 at 21 50 23

When the page loads, the webapp retrieves data from the selected API and shows the list of items on screen with the basic data (e.g. title + image).

Prepare also "Comments" and "Reservations" buttons. They should be doing nothing - just being displayed.

This task does not include displaying the number of likes for each item.

This task does not include the counter of the items.

[4pt] Fetch rockets - Fetch data

Fetch data from the Rockets endpoint (https://api.spacexdata.com/v3/rockets) when the application starts (as Rockets is the default view).

Once the data are fetched, dispatch an action to store the selected data in Redux store:

  • id
  • name
  • type
  • flickr_images

NOTE: Make sure you only dispatch those actions once and do not add data to store on every re-render (i.e. when changing views / using navigation).

[1pt] Switch badges for Missions - Conditional components

Missions that the user has joined already should show a badge "Active Member" instead of the default "NOT A MEMBER" and a button "Leave Mission" instead of the "Join Mission" button (as per design).

Use the React conditional rendering syntax:

{rocket.reserved && ( 
    // render Cancel Rocket button
)}

[3pt] - Add reservations counter - Student C

Even if the API gives you the number of reservations you will create a specific function to calculate it.

Make sure that the correct number is displayed on the Reservations pop up.

Respect the following rules:

  • Each counter should be implemented as a separate module.
  • A counter function should look for specific DOM elements (e.g. for the comments counter it should look for comments) and make the counting based on what is actually displayed on the page.
  • A counter function should cover all the edge cases you can think about.

Team3 [3pt] Implement dragon booking - Actions

  • When a user clicks the "Reserve dragon" button, action needs to be dispatched to update the store. You need to get the ID of the reserved dragon and update the state. Remember you mustn't mutate the state. Instead, you need to return a new state object with all dragons, but the selected rocket will have an extra key reserved with its value set to true. You could use a JS filter() or map() to set the value of the new state - i.e.:
const newState = state.map(rocket => {
    if(dragon.id !== id) 
        return dragon;
    return { ...dragon, reserved: true };
});
  • Regardless of which method you choose, make sure you place all your logic in the reducer. In the React view file, you should only dispatch the action with the correct dragon ID as an argument.

[3pt] - Add comments counter - Student B

Even if the API gives you the number of comments you will create a specific function to calculate it.

Make sure that the correct number is displayed on the Comments pop up.

Respect the following rules:

  • Each counter should be implemented as a separate module.
  • A counter function should look for specific DOM elements (e.g. for the comments counter it should look for comments) and make the counting based on what is actually displayed on the page.
  • A counter function should cover all the edge cases you can think about.

[1pt] Create basic structure for Rockets - Setup

  • Create a route and a view component. Use <NavLink /> for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).
  • Create a directory for all Redux state slice files.

[4pt] -Display Comments pop up with selected item's details - Student B

Create a comments popup only with the top section (displaying details of the selected item)

Screenshot 2021-06-27 at 22 10 45

When the popup loads, the webapp retrieves data from the selected API and shows details about the selected item.

Add event to button prepared by your teammate that will open your popup. You need to communicate with your team member to make sure that you do not block each other (most likely the easiest solution is to merge the list of items feature to the dev branch before you try to add that event).

[0.5pt] Find external API - group task

Find an API to base the development of the webapp around it. The API should allow you to

  • Get a list of items with a unique item id (or generate the unique id).
  • For a given item, get detailed information about it.
    choose an APIs that doesn't need authentication. if you select an API that requires authentication, you should implement it on your own. Also, if you select an API that provides image resources your webapp will be more visual.

[1pt] Switch badges for Rockets - Conditional components

Rockets that have already been reserved should show a "Reserved" badge and "Cancel reservation" button instead of the default "Reserve rocket" (as per design)

Use the React conditional rendering syntax:

{rocket.reserved && ( 
    // render Cancel Rocket button
)}

[4pt] Display rockets - Lists render

  • Use useSelector() Redux Hook to select the state slices and render lists of rockets in corresponding routes. i.e.:
// get rockets data from the store
const rockets = useSelector(state => state.rockets);
  • You can style the whole application "by hand" or you could use React Bootstrap, a UI library that could speed up the process. This is a popular library and working with its components would be good practice.
  • Render a list of rockets (as per design). For the image of a rocket use the first image in the array of flickr_images.

[4pt] Fetch missions - Fetch data

Fetch data from the Missions endpoint (https://api.spacexdata.com/v3/missions) when a user navigates to the Missions section.

Once the data are fetched, dispatch an action to store the selected data in Redux store:

  • mission_id
  • mission_name
  • description

NOTE: Make sure you only dispatch those actions once and do not add data to store on every re-render (i.e. when changing views / using navigation).

Team3 [1pt] Create basic structure for Dragons - Setup

  • Create a route and a view component. Use <NavLink /> for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).
  • Create a directory for all Redux state slice files.

[1pt] Implement mission leaving - Actions

  • Follow the same logic as with the "Join mission" - but you need to set the reserved key to false.
  • Dispatch these actions upon click on the corresponding buttons.

[3pt] Implement rocket booking - Actions

  • When a user clicks the "Reserve rocket" button, action needs to be dispatched to update the store. You need to get the ID of the reserved rocket and update the state. Remember you mustn't mutate the state. Instead, you need to return a new state object with all rockets, but the selected rocket will have an extra key reserved with its value set to true. You could use a JS filter() or map() to set the value of the new state - i.e.:
const newState = state.map(rocket => {
    if(rocket.id !== id) 
        return rocket;
    return { ...rocket, reserved: true };
});
  • Regardless of which method you choose, make sure you place all your logic in the reducer. In the React view file, you should only dispatch the action with the correct rocket ID as an argument.

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.