This project is a React-based web application that displays SpaceX launch programs with filtering options for launch year, successful launches, and successful landings.
- Fetches and displays SpaceX launch data using APIs
- Filters launches based on:
- Launch Year
- Successful Launch
- Successful Landing
- Uses Redux for state management
- Responsive UI using Tailwind CSS
- React.js
- Redux
- Axios (for API calls)
- Tailwind CSS
- Clone the repository:
git clone https://github.com/sohamgaikwad1502/SpaceX_Assignment.git
- Navigate to the project directory:
cd space-x - Install dependencies:
npm install
- Start the development server:
npm run dev
src/
│── components/
│ ├── Home.jsx
│ ├── Launches.jsx
│── utils/
│ ├── constants.js
│ ├── slices/
│ ├── initialDataSlice.js
│ ├── launchSlice.js
│ ├── launchAndLandSlice.js
├── store.js
│── App.jsx
│── main.jsx
WITHOUT_ANY_FILTERS- Fetches all launchesWITH_LAUNCH_AND_LAND- Fetches launches with successful landingsWITH_LAUNCH_SUCCESS- Fetches launches with successful launchesWITH_ALL_FILTERS- Fetches launches filtered by year
- The application fetches SpaceX launch data using Axios.
- The
fetchAll,fetchLaunchAndLand,fetchlaunchsuccessfunction retrieves data based on the APIS and their filters.
- The
Launchescomponent filters launches dynamically using React state (useState) anduseEffect. - It extracts data from the Redux store using
useSelector. - The component filters data based on:
- Launch Year: Filters based on
launch_year. - Successful Launch: Filters based on
launch_success. - Successful Landing: Extracts
land_successfromrocket.first_stage.cores.
- Launch Year: Filters based on
- The component updates the displayed launches whenever filters change.
- The Redux store maintains initial launch data and filtered data.
- Slices (
initialDataSlice,launchSlice,launchAndLandSlice) manage different parts of the state. - The state updates dynamically when new filters are applied.
- The
Launchescomponent displays filtered launch details inside responsive cards. - Uses Tailwind CSS for styling.
- Shows mission patches, mission name, year, and success status.
- Displays a message when no launches match the filters.
- Select a launch year to filter launches.
- Toggle between successful launches and landings.
- View detailed launch information including:
- Mission Name
- Flight Number
- Launch Year
- Mission IDs
- Success Status