Giter VIP home page Giter VIP logo

microverse-fullstack-program / space-traveler-hub-v2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 17.31 MB

Space Travelers' Hub is a SPA which provides users to reserve specific rockets and dragons with a mission which is fetched from external APIs. It also displays the selected services on the Profile page.

Home Page: https://space-traveler-hub-5v0q.onrender.com/

License: MIT License

HTML 4.17% JavaScript 92.11% CSS 3.72%
babel-es6 babel-webpack eslint html-css-javascript javascript jest-snapshots jsx-syntax react-bootstrap react-components react-redux react-router react-router-dom reacthooks reactjs redux-middleware redux-store redux-thunk redux-toolkit stylelint testing-library

space-traveler-hub-v2's Introduction

logo

Space Traveler's Hub

๐Ÿ“— Table of Contents

๐Ÿ“– About

Space Traveler's Hub is a web application for a company that provides commercial and scientific space travel services. The application will allow users/scientists to book rockets and join selected space missions. The Space Travelers' Hub consists of Rockets, Missions, and the My Profile section.

  • Rockets /Dragons Section - this section displays a list of all available SpaceX rockets. Users can book each rocket by clicking the reservation button or cancel the previously made booking. The same layout is used to form the Dragons section [added only if your team has 3 members].
  • Missions Section - this section displays a list of current missions along with their brief description and participation status. There is also a button next to each mission that allows users to join the selected mission or leave the mission the user joined earlier.
  • My Profile Section - The My Profile section displays all reserved rockets and space missions.

Building this application will allow to learn how to use React and Redux in the context of a real application and get hand exprience on front-end development.

๐Ÿ›  Built With

Tech Stack

  • JavaScript ES6 Module
  • ReactJS
  • Redux
  • babel-Webpack
  • Jest Test
  • React Testing Library
  • HTML&CSS and JavaScript
  • VS Editor
  • GitHub and Gitflow

Database

  • API dependdencies
Client
Server
Database

Key Feature

  • API enabled - fetch external API
  • Joining and Leaving Missions to space
  • Rocket Booking and Cancel reservation
  • Filtering reserved Rockets and Joined Missions

(back to top)

๐Ÿš€ Live Demo

(back to top)

๐Ÿ’ป Getting Started

To get the content of this project locally you need to run the following commands in your terminal.

Prerequisites

In order to run this project you need to install the following packages/modules

Setup

  1. Install git if not already installed

  2. Use VScode: open terminal in VScode

  3. Download the Zip file or clone the repo with:

git clone https://github.com/Microverse-Fullstack-Program/space-traveler-hub-v2
  1. To access cloned directory, run and navigate to the directory where you cloned the repo:
cd space-traveler

Install Depedancy and Run app

To install linters and other project's dependencies run:

npm install

Usage

To run the project, execute the following command:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

Getting Started with Create React App

(back to top)

Run Test for Linters

For tracking linter errors locally you need to follow these steps:

  1. For tracking linter errors in HTML files run:
npx hint .
  1. For tracking linter errors in CSS or SASS files run:
npx stylelint "\*_/_.{css,scss}"
  1. For tracking linter errors in JavaScript files run:
npx eslint .

Test Command

For unit testing of the app run:

npm test

WhatsApp Image 2023-04-21 at 08 48 57

(back to top)

๐Ÿ‘ฅ Authors:

The collaborators of this project are.

๐Ÿ‘ค Author 1: Zewdie Habtie

๐Ÿ‘ค Author 2: Chere Lemma

(back to top)

๐Ÿ”ญ Future Features

  • Mobile version resposiveness.

(back to top)

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

Kindly raise issue here

(back to top)

โญ๏ธ Show your support

If you like this project, kindly follow me on GitHub ๐Ÿ˜Š

(back to top)

๐Ÿ™ Acknowledgments

I would like to thank Microverseinc for.

Much appreciation goes to Space X for the availability of the API to practice.

(back to top)

๐Ÿ“ License

This project is MIT licensed.

(back to top)

space-traveler-hub-v2's People

Contributors

cherelemma avatar zewdiemc avatar

space-traveler-hub-v2's Issues

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.

Milestone 3 [Space Traveler Hub]: Create empty my profile

Hello @ZewdieMc ,
In this PR, I implemented the following ??

  • Created an empty Profile component
  • Create a route for Profile component
  • Add simple style for Profile page

General Requirements
? No linters error.
? Followed the Git-flow.
? Followed JS, HTML&CSS best practices
? Documented work professionally.

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

[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
)}

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.

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.

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

Website header

Hi @cherelemma ,
In this PR, I implemented the following ??

  • Created a navigation bar
  • Included the logo image in the nav bar
  • Created Links to the navigation items using the react-router NavLink component.
  • Installed React-Redux, React-router, and React-Logger

[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
)}

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

[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] 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).

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

[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] 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.

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

[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).

Milestone 5 - Fetch missions data

Hi @ZewdieMc ,
In this milestone PR, I implemented the functionalities of fetching mission data.

  • Fetched missions data from spacexdata.com API
  • Updated the slice function to update the state
  • Created Missions view page
  • Added style for the Missions view page

General Requirements

? No linters error.
? Followed the Git-flow.
? Followed JS, HTML&CSS best practices
? Documented work professionally.

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.