Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript capstone project #35

Merged
merged 131 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
e49c553
Created default npm package
mahammad-mostafa Aug 1, 2023
d6157ac
Ignored node folder
mahammad-mostafa Aug 1, 2023
da06c45
Linters configurations
mahammad-mostafa Aug 1, 2023
81e0b85
Included linters checks
mahammad-mostafa Aug 1, 2023
69d9185
Installed linters dependencies
mahammad-mostafa Aug 1, 2023
24b9009
Created WebPack configuration & Installed its dependencies
mahammad-mostafa Aug 1, 2023
73a2d3a
Installed Jest framework dependencies
mahammad-mostafa Aug 1, 2023
864da12
Documented project information
mahammad-mostafa Aug 1, 2023
39ab71e
Created default empty files in source directory
mahammad-mostafa Aug 1, 2023
27d6c11
Fixed authors social links
mahammad-mostafa Aug 1, 2023
960c56f
Fixed Lighthouse linter error
mahammad-mostafa Aug 1, 2023
2328a34
Merged setup project branch
mahammad-mostafa Aug 1, 2023
df10c4a
Built header section with styling
mahammad-mostafa Aug 1, 2023
44edf5c
Fixed end of css file linter error
mahammad-mostafa Aug 1, 2023
d6ddbf7
Merged add header branch
mahammad-mostafa Aug 1, 2023
7c5989b
Implemented template html structure
mahammad-mostafa Aug 1, 2023
c9b8c83
Generated build directory
mahammad-mostafa Aug 1, 2023
488a6d2
Added blank js files in modules directory
mahammad-mostafa Aug 1, 2023
e276a4c
Merged add footer branch
mahammad-mostafa Aug 1, 2023
d1b79d2
Initialize popup html element and import them into popup.js file
kambereBr Aug 1, 2023
89cbe65
Implement clearPopup method
kambereBr Aug 1, 2023
3c9ac45
Handles popup item details and extract data from api response object
kambereBr Aug 1, 2023
f22d180
Implement forms validations
kambereBr Aug 2, 2023
d2903d9
Fix linters errors
kambereBr Aug 2, 2023
a12099d
running the npm inint command
Felipe-Perez-Ferraro Aug 2, 2023
4e56c09
adding some changes in the html structure
Felipe-Perez-Ferraro Aug 2, 2023
1cde8a4
creating the dom.js file with all the Ids and selectors
Felipe-Perez-Ferraro Aug 2, 2023
60a8805
inserting the popup file created by bruno and imported the Reservatio…
Felipe-Perez-Ferraro Aug 2, 2023
f964cc1
created the reservation classwith get and post methods
Felipe-Perez-Ferraro Aug 2, 2023
f34c9f9
Make dom module a class
kambereBr Aug 2, 2023
a332532
Split renderPopup into small methods
kambereBr Aug 2, 2023
203ddcb
Implemented all api calls
mahammad-mostafa Aug 3, 2023
c5bc42b
Initialized network & created event handlers
mahammad-mostafa Aug 3, 2023
076fc35
Created methods for list likes & browsing
mahammad-mostafa Aug 3, 2023
fd6765e
Added several id attributes for important tags
mahammad-mostafa Aug 3, 2023
ff6cc24
Included few rules for basic page layout
mahammad-mostafa Aug 3, 2023
9e2c822
Created counter function for list items
mahammad-mostafa Aug 3, 2023
63ddd85
Imported items counter function
mahammad-mostafa Aug 3, 2023
9b8dc11
Remove renderPopup method from constructor, refactor renderDetails me…
kambereBr Aug 3, 2023
d192b42
ignore modules folder
Felipe-Perez-Ferraro Aug 3, 2023
49c3080
change the structure of the html to be equal to the network-calls branch
Felipe-Perez-Ferraro Aug 3, 2023
78f295e
running the build project
Felipe-Perez-Ferraro Aug 3, 2023
e709ad1
running the build project
Felipe-Perez-Ferraro Aug 3, 2023
55a353e
added the same index.js code as the network-calls app
Felipe-Perez-Ferraro Aug 3, 2023
ff74e33
adding all the dom elements in this file
Felipe-Perez-Ferraro Aug 3, 2023
d5b4455
creating a new class to import the form management
Felipe-Perez-Ferraro Aug 3, 2023
62c033c
function created by mahammad to check the ul child length
Felipe-Perez-Ferraro Aug 3, 2023
1a93a25
added the list file from the network-calls branch
Felipe-Perez-Ferraro Aug 3, 2023
5473425
added the Network class created by mahammad
Felipe-Perez-Ferraro Aug 3, 2023
6a71232
making some changes in the popup file to make it mnore readable
Felipe-Perez-Ferraro Aug 3, 2023
2584507
Split method renderPopup to handle form submission in a separated method
kambereBr Aug 3, 2023
c5c54fa
creating the Reservation class with the post method inside
Felipe-Perez-Ferraro Aug 3, 2023
efb67fe
requested changes by bruno, instead of import network i intialized in…
Felipe-Perez-Ferraro Aug 3, 2023
a9dc271
Added classes & h1 heading
mahammad-mostafa Aug 3, 2023
8e220b8
Created class rules instead of tag ones
mahammad-mostafa Aug 3, 2023
4758bd6
Changed submission parameters & variable names
mahammad-mostafa Aug 3, 2023
6fb2cbe
Used datasets instead of id attributes for buttons
mahammad-mostafa Aug 3, 2023
6e4135d
Added classes & data attributes in list items
mahammad-mostafa Aug 3, 2023
a9412a1
created the Comment class and added the postCommentMethod
Felipe-Perez-Ferraro Aug 3, 2023
525db99
Merged network calls branch
mahammad-mostafa Aug 3, 2023
46aa5a4
run the project
Felipe-Perez-Ferraro Aug 3, 2023
fa76f4a
added changes suggested by my partners
Felipe-Perez-Ferraro Aug 3, 2023
8bd648d
importing the formManagement methods
Felipe-Perez-Ferraro Aug 3, 2023
5beb52b
changing the structure of the Reservations class
Felipe-Perez-Ferraro Aug 3, 2023
827641c
Fix linters errors
kambereBr Aug 3, 2023
fd386d0
Separate renderDetails from renderInvolvement
kambereBr Aug 3, 2023
660a251
Change the class name for popup visibility
kambereBr Aug 3, 2023
5084e1a
Change the class name for form visibility
kambereBr Aug 3, 2023
0fe2161
changed the checkFilledForm method using a for of loop
Felipe-Perez-Ferraro Aug 3, 2023
7bb222d
removing check form class and list element from the index.html
Felipe-Perez-Ferraro Aug 3, 2023
7919a7a
resolve conflicts
Felipe-Perez-Ferraro Aug 3, 2023
ba043c8
Merge pull request Manage popup scenario.
kambereBr Aug 3, 2023
72bbdd4
fixing showing popup errors
Felipe-Perez-Ferraro Aug 3, 2023
6f78325
Merge branch 'development' into display-reservations-popup
Felipe-Perez-Ferraro Aug 3, 2023
e3d492b
deleting formManagement js file
Felipe-Perez-Ferraro Aug 3, 2023
b5da2a0
Merged development into display-reservations-popup
Felipe-Perez-Ferraro Aug 3, 2023
9ebfe77
removed the distribution folder
Felipe-Perez-Ferraro Aug 3, 2023
1e2e13b
Merge display-reservations-popup
Felipe-Perez-Ferraro Aug 3, 2023
cde8d5d
Merge branch 'development' into fix-popup-management
Felipe-Perez-Ferraro Aug 3, 2023
25f5e1a
Created counter file with listcounter function
Felipe-Perez-Ferraro Aug 4, 2023
e281568
Created input hidden for item_id
Felipe-Perez-Ferraro Aug 4, 2023
8e02212
deleting postCommentMethod and network parameter
Felipe-Perez-Ferraro Aug 4, 2023
92a53f0
changed event handlers and fixed method arguments
Felipe-Perez-Ferraro Aug 4, 2023
1257abc
changed event handlers and fixed method arguments
Felipe-Perez-Ferraro Aug 4, 2023
707a777
handled bad requests and fixed typos
Felipe-Perez-Ferraro Aug 4, 2023
d2e34f1
added eslinter for javascript
Felipe-Perez-Ferraro Aug 4, 2023
fc57998
fixing eslinter errors
Felipe-Perez-Ferraro Aug 4, 2023
7404b17
Merge fix-popup-management
Felipe-Perez-Ferraro Aug 4, 2023
a8c3349
Included font icons resources
mahammad-mostafa Aug 4, 2023
623c713
Add rules for assets files
mahammad-mostafa Aug 4, 2023
e303376
Introduced container class
mahammad-mostafa Aug 4, 2023
c1786c1
Implemented mobile menu toggling
mahammad-mostafa Aug 4, 2023
542fd6d
Restructured comments & reservations items list for styling
mahammad-mostafa Aug 4, 2023
b85030d
Restructured action buttons & likes count for styling
mahammad-mostafa Aug 4, 2023
a68be39
Styled whole project layout
mahammad-mostafa Aug 4, 2023
7738163
Fixed empty line linter error
mahammad-mostafa Aug 4, 2023
05c635d
Merged layout styling branch
mahammad-mostafa Aug 4, 2023
e9e8b92
Fixed typos in features section
mahammad-mostafa Aug 4, 2023
149759a
Added rules for image resources
mahammad-mostafa Aug 4, 2023
400d781
Blank image placeholder for missing images
mahammad-mostafa Aug 4, 2023
e8486ae
Included the loader icon
mahammad-mostafa Aug 4, 2023
e7a7500
Styled loader & popup transitions
mahammad-mostafa Aug 4, 2023
4c450f9
Added loader element
mahammad-mostafa Aug 4, 2023
c3f2296
Activated loader on network calls
mahammad-mostafa Aug 4, 2023
ed82039
Implemented menu links selection effect
mahammad-mostafa Aug 4, 2023
b4b8a76
Implemented transitions on opening & closing
mahammad-mostafa Aug 4, 2023
a7df433
Changed loader color to white
mahammad-mostafa Aug 4, 2023
889909d
Merged transition effects branch
mahammad-mostafa Aug 4, 2023
fbbb2e0
added .babelrc.json to transform ES6 modules into CommonJS notation
kambereBr Aug 4, 2023
c6649b4
install jsdom and babel
kambereBr Aug 4, 2023
a4b8396
check null and undefined data
kambereBr Aug 4, 2023
b466e75
added comments.test.js to test comments counter
kambereBr Aug 4, 2023
439f9bd
Installed babel dependency
mahammad-mostafa Aug 4, 2023
445d415
installing the babel Configuration
Felipe-Perez-Ferraro Aug 4, 2023
e26b65c
installing babel & jsdom configurations
Felipe-Perez-Ferraro Aug 4, 2023
175f8a3
Configured Babel to use ES6 modules with Jest
mahammad-mostafa Aug 4, 2023
02f12ee
made test on reservation counter dom
Felipe-Perez-Ferraro Aug 4, 2023
8d4c18f
fix linters formatting errors
kambereBr Aug 4, 2023
2c6d4d1
Merge branch 'development' into test-comments-feature
kambereBr Aug 4, 2023
c753a10
fixing describe reservation typing error
Felipe-Perez-Ferraro Aug 4, 2023
a8352d4
Installed jsdom dependency
mahammad-mostafa Aug 4, 2023
5d24d7a
Created three tests with edge cases
mahammad-mostafa Aug 4, 2023
dc7d5fa
Covered edge case of non existing element
mahammad-mostafa Aug 4, 2023
68552d4
Merge pull request #32 from mahammad-mostafa/test-comments-feature
kambereBr Aug 4, 2023
151f318
added the global jest dependencies to package.json
Felipe-Perez-Ferraro Aug 4, 2023
5775aab
Merge reservation-tests
Felipe-Perez-Ferraro Aug 4, 2023
a6a72a0
Merged testing items list branch
mahammad-mostafa Aug 4, 2023
832b826
Removed wrong description text
mahammad-mostafa Aug 5, 2023
fc78ee0
Included presentation video link
mahammad-mostafa Aug 5, 2023
39d030e
Generated project build in distribution directory
mahammad-mostafa Aug 5, 2023
1d066e8
Merged live demo branch
mahammad-mostafa Aug 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"env": {
"test": {
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
}
}
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"extends": ["airbnb-base"],
"rules": {
"no-shadow": "off",
"no-param-reassign": "off",
"eol-last": "off",
"import/extensions": [ 1, {
"js": "always", "json": "always"
}],
"import/no-cycle": [2, { "ignoreExternal": true }]
},
"ignorePatterns": [
"dist/",
"build/"
]
}
70 changes: 70 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Linters

on: pull_request

env:
FORCE_COLOR: 1

jobs:
lighthouse:
name: Lighthouse
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Setup Lighthouse
run: npm install -g @lhci/[email protected]
- name: Lighthouse Report
run: lhci autorun --upload.target=temporary-public-storage --collect.staticDistDir=.
webhint:
name: Webhint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Setup Webhint
run: |
npm install --save-dev [email protected]
[ -f .hintrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.hintrc
- name: Webhint Report
run: npx hint .
stylelint:
name: Stylelint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Setup Stylelint
run: |
npm install --save-dev [email protected] [email protected] [email protected] [email protected]
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.stylelintrc.json
- name: Stylelint Report
run: npx stylelint "**/*.{css,scss}"
eslint:
name: ESLint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Setup ESLint
run: |
npm install --save-dev [email protected] [email protected] [email protected] [email protected]
[ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.eslintrc.json
- name: ESLint Report
run: npx eslint .
nodechecker:
name: node_modules checker
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check node_modules existence
run: |
if [ -d "node_modules/" ]; then echo -e "\e[1;31mThe node_modules/ folder was pushed to the repo. Please remove it from the GitHub repository and try again."; echo -e "\e[1;32mYou can set up a .gitignore file with this folder included on it to prevent this from happening in the future." && exit 1; fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
18 changes: 18 additions & 0 deletions .hintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"connector": {
"name": "local",
"options": {
"pattern": ["**", "!.git/**", "!node_modules/**"]
}
},
"extends": ["development"],
"formatters": ["stylish"],
"hints": [
"button-type",
"disown-opener",
"html-checker",
"meta-charset-utf-8",
"meta-viewport",
"no-inline-styles:error"
]
}
20 changes: 20 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": ["stylelint-config-standard"],
"plugins": ["stylelint-scss", "stylelint-csstree-validator"],
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen"]
}
],
"scss/at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen"]
}
],
"csstree/validator": true
},
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*.js", "**/*.jsx"]
}
167 changes: 167 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<a name="title"></a>

<!-- TITLE -->

# 🏷️ Delicious Meals App

This is the capstone project in the second module of the **Microverse** program.
<br/>
Check the below contents for further details about this project.

<!-- CONTENTS -->

# 📗 Contents

- [Description](#description)
- [Instructions](#instructions)
- [Authors](#authors)
- [Future](#future)
- [Contributions](#contributions)
- [Support](#support)
- [Acknowledgements](#acknowledgements)
- [License](#license)

<!-- DESCRIPTION -->

<a name="description"></a>

# 📖 Description

This project is a simple meal recipes app with `ES6` modules and bundled with `WebPack`.
It consumes data from two external `API`s and follows `GitFlow` workflow.
Data is loaded with asynchronous calls using `async` functions & `promises`.
Unit testing is applied during this project using `Jest` framweork.
All project files are contained in `src` directory.
Also config linters for (`HTML` / `CSS3` / `JavaScript`) in the `.github` folder.

📌 **Live Demo:**
- See the project live from [here](https://mahammad-mostafa.github.io/delicious-meals-app/dist).
- Check the presentation video from [here](https://drive.google.com/file/d/1iQXqlGEEQ7VRIuIBgGGwm4gcyA74OB6O).

📌 **Tech Stack:**
- Page strucutre is built with `HTML5`
- Styling is built with `CSS3`
- Dynamic content is built with `JavaScript`
- Bundling is done with `WebPack`
- Unit testing is done with `Jest`

📌 **Key Features:**
- Single page app with all content loaded dynamically
- Responsive layout with all screen sizes
- Meal recipes data is fetched from TheMealDB api
- Interaction data is fetched from involvement api
- Each item displays (thumbnail image / recipe title / total likes)
- Two buttons available (comments / reservations)
- Comment button opens a popup to display item details and comments
- New comments are displyed automatically with name & date
- Reservation button opens a popup to display item details and reservations
- New reservations are displyed automatically with name & date

<p align="right"><a href="#title">back to top</a></p>

<!-- INSTRUCTIONS -->

<a name="instructions"></a>

# 🛠️ Instructions

You can easily download or fork this repository and work on it immadiately!

📌 **Prerequisites:**
- `NodeJS` for installing & running all packages

📌 **Setup:**
- Install all dependencies with `npm`
```
npm install
```
- For live development on `localhost:8080` run:
```
npm run start
```

📌 **Deployment:**
- You can deploy this project by uploading files in the `dist` folder to a live server.
- Create the distribution build using this command:
```
npm run build
```

<p align="right"><a href="#title">back to top</a></p>

<!-- AUTHORS -->

<a name="authors"></a>

# 👥 Authors

📌 **Mahammad:**
- [GitHub](https://github.com/mahammad-mostafa)
- [Twitter](https://twitter.com/mahammad_mostfa)
- [LinkedIn](https://linkedin.com/in/mahammad-mostafa)

📌 **Bruno:**
- [GitHub](https://github.com/kambereBr)
- [Twitter](https://twitter.com/kambereBr)
- [LinkedIn](https://www.linkedin.com/in/bruno-kambere-399447138/)

📌 **Felipe:**
- [GitHub](https://github.com/Felipe-Perez-Ferraro)

<p align="right"><a href="#title">back to top</a></p>

<!-- FUTURE -->

<a name="future"></a>

# 🔭 Future

Some additional features I may implement in the project:
- [ ] Using `CSS` preprocessors and their relevant loaders
- [ ] Implement two `WebPack` configurations for production & development

<p align="right"><a href="#title">back to top</a></p>

<!-- CONTRIBUTIONS -->

<a name="contributions"></a>

# 🤝🏻 Contributions

Wish to contribute to this project?
<br/>
Contributions, issues, and feature requests are more than welcome!
<br/>
Feel free to check the [issues](../../issues) page too.

<p align="right"><a href="#title">back to top</a></p>

<!-- SUPPORT -->

<a name="support"></a>

# ⭐️ Support

Like this project? Show your support by starring!

<p align="right"><a href="#title">back to top</a></p>

<!-- ACKNOWLEDGEMENTS -->

<a name="acknowledgements"></a>

# 🙏🏻 Acknowledgements

I thank everyone at **Microverse** for guiding me through this project.

<p align="right"><a href="#title">back to top</a></p>

<!-- LICENSE -->

<a name="license"></a>

# 📝 License

This project is [MIT](LICENSE.md) licensed.

<p align="right"><a href="#title">back to top</a></p>
Binary file added dist/blank.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/icons.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Delicious Meals</title><script defer="defer" src="main.js"></script></head><body><header><nav class="container"><h1 id="logo"><span class="icon-logo"></span>Delicious Meals</h1><button class="icon-menu" type="button"></button><ul id="menu"></ul></nav></header><main class="container"><section id="list"><ul id="list-block"></ul></section><section id="popup"><div id="popup-block"><button id="popup-close" class="icon-close" type="button"></button> <img id="popup-image" alt=""/><h2 id="popup-title"></h2><p id="popup-description"></p><h3 id="popup-list-title"></h3><ul id="popup-list"></ul><h3 id="popup-form-title"></h3><form id="popup-form-comment" class="popup-form"><input type="hidden" name="item_id"/> <input name="username" placeholder="your name" required/> <textarea name="comment" placeholder="your insights" required></textarea> <button type="submit">Comment</button></form><form id="popup-form-reservation" class="popup-form"><input type="hidden" name="item_id"/> <input name="username" placeholder="your name" required/> <input type="date" name="date_start" placeholder="start date" required/> <input type="date" name="date_end" placeholder="end date" required/> <button type="submit">Reserve</button></form></div></section><section id="loader"><span class="icon-loader"></span></section></main><footer><p class="container">Created by Microverse under CC license</p></footer></body></html>
1 change: 1 addition & 0 deletions dist/main.js

Large diffs are not rendered by default.

Loading