-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Ralph-1/catalogue
Catalogue
- Loading branch information
Showing
66 changed files
with
1,498 additions
and
11,652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-react" | ||
], | ||
"plugins": ["@babel/plugin-syntax-jsx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"jest": true | ||
}, | ||
"parser": "@babel/eslint-parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"extends": ["airbnb", "plugin:react/recommended"], | ||
"plugins": ["react"], | ||
"rules": { | ||
"react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }], | ||
"react/react-in-jsx-scope": "off", | ||
"import/no-unresolved": "off", | ||
"no-shadow": "off" | ||
}, | ||
"ignorePatterns": [ | ||
"dist/", | ||
"build/" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Linters | ||
|
||
on: pull_request | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
eslint: | ||
name: ESLint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup ESLint | ||
run: | | ||
npm install --save-dev eslint@7.x eslint-config-airbnb@18.x eslint-plugin-import@2.x eslint-plugin-jsx-a11y@6.x eslint-plugin-react@7.x eslint-plugin-react-hooks@4.x @babel/eslint-parser@7.x @babel/core@7.x @babel/plugin-syntax-jsx@7.x @babel/preset-env@7.x @babel/preset-react@7.x | ||
[ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.eslintrc.json | ||
[ -f .babelrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.babelrc | ||
- name: ESLint Report | ||
run: npx eslint . | ||
stylelint: | ||
name: Stylelint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup Stylelint | ||
run: | | ||
npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x | ||
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.stylelintrc.json | ||
- name: Stylelint Report | ||
run: npx stylelint "**/*.{css,scss}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": ["stylelint-config-standard"], | ||
"plugins": ["stylelint-scss", "stylelint-csstree-validator"], | ||
"rules": { | ||
"at-rule-no-unknown": null, | ||
"scss/at-rule-no-unknown": true, | ||
"csstree/validator": true | ||
}, | ||
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*.js", "**/*.jsx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,83 @@ | ||
# Getting Started with Create React App | ||
<h1 align="center"> The Secret Recipies</h1> | ||
|
||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
This is Microverse's final project in React/Redux's course. | ||
|
||
## Available Scripts | ||
The objective of this project was to create a single page recipe catalogue using React, Redux and TheMealDB API. | ||
|
||
In the project directory, you can run: | ||
## Table of contents | ||
- [About](#about) | ||
- [The catalogue](#the-catalogue) | ||
- [How to open](#how-to-open) | ||
- [Tests](#tests) | ||
- [Technologies used](#technologies-used) | ||
- [Author](#author) | ||
- [Contribution](#contribution) | ||
- [Disclaimer](#disclaimer) | ||
|
||
### `yarn start` | ||
## About | ||
|
||
Runs the app in the development mode.\ | ||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
This project's goal was to build a browsable list of items that you can filter and access to the details of one item. The list should be accessed from an API, so I choose the [TheMealDB-API][TheMealDB-API] and filtered it to store only meals based on their categories. | ||
|
||
The page will reload if you make edits.\ | ||
You will also see any lint errors in the console. | ||
Link to a live version [here][live-version]. | ||
|
||
### `yarn test` | ||
Repository: `https://github.com/Ralph-1/The-Sercet-Recipes` | ||
|
||
Launches the test runner in the interactive watch mode.\ | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
## The catalogue | ||
|
||
### `yarn build` | ||
When you open the catalog the React APP downloads the data from the server using an API and stores it in the Redux store. | ||
- A user can view all the meals categories in the CookBook | ||
![initScreenshot][initScreenshot] | ||
|
||
Builds the app for production to the `build` folder.\ | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
- A user can click on any category and get to see the meals listed under that category. | ||
![mealsScreenshot][mealsScreenshot] | ||
|
||
The build is minified and the filenames include the hashes.\ | ||
Your app is ready to be deployed! | ||
- Under each category, a user sees a variety of dishes to make a choice from and each dish chosen has a list of all the ingredients that were used to prepare it, area where it originates from and the category it belongs to: | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
![descriptionScreenshot][descriptionScreenshot] | ||
|
||
### `yarn eject` | ||
### How to open | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
You can open the catalog online by clicking [here][live-version] or locally following these steps: | ||
|
||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
* Click on the green button "Clone or Download" | ||
* Click on Download ZIP or clone the repository to your desired directory | ||
* Extract the project (This step is for those who download the ZIP) | ||
* In your terminal, navigate to the folder | ||
* Run `npm install` or `yarn install` | ||
* Run `npm start` or `yarn start` | ||
|
||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. | ||
A tab will be opened in the browser. | ||
|
||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. | ||
### Tests | ||
To run the tests, open a terminal in this project directory and run | ||
`npm test` or `yarn test` | ||
|
||
## Learn More | ||
### Technologies used | ||
|
||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
To create this project I used: | ||
|
||
To learn React, check out the [React documentation](https://reactjs.org/). | ||
* JavaScript | ||
* A bit of HTML and CSS | ||
* Eslint | ||
* React | ||
* Redux | ||
* PropTypes | ||
* [TheMealDB-API][TheMealDB-API] | ||
|
||
### Code Splitting | ||
## Author | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) | ||
👤 **Ralph Oburu** | ||
|
||
### Analyzing the Bundle Size | ||
- Github: [Ralph-1](https://github.com/ralph-1) | ||
- Twitter: [@NotRalph0](https://twitter.com/NotRalph0) | ||
- LinkedIn: [Ralph](https://linkedin.com/in/ralph-oburu) | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) | ||
### Contribution 🤝 | ||
Contributions, issues and feature requests are welcome! | ||
|
||
### Making a Progressive Web App | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) | ||
|
||
### Advanced Configuration | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) | ||
|
||
### Deployment | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) | ||
|
||
### `yarn build` fails to minify | ||
|
||
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) | ||
<!-- Links --> | ||
[TheMealDB-API]: https://www.themealdb.com/api.php | ||
[live-version]: https://hungry-johnson-4b570f.netlify.app/ | ||
[initScreenshot]: ./src/assets/images/intial.png | ||
[mealsScreenshot]: ./src/assets/images/meals.png | ||
[descriptionScreenshot]: ./src/assets/images/description.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { | ||
fetchProductsError, | ||
fetchProductsPending, | ||
fetchProductsSuccess, | ||
} from './index'; | ||
|
||
const fetchMeals = (type) => (dispatch) => { | ||
dispatch(fetchProductsPending); | ||
fetch(`https://www.themealdb.com/api/json/v1/1/filter.php?c=${type}`) | ||
.then((res) => res.json()) | ||
.then((res) => { | ||
if (res.error) { | ||
throw (res.error); | ||
} | ||
dispatch(fetchProductsSuccess(res.meals)); | ||
}) | ||
.catch((error) => { | ||
dispatch(fetchProductsError(error)); | ||
}); | ||
}; | ||
|
||
export default fetchMeals; |
Oops, something went wrong.