Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2733dc9
feat: Commit package-lock.json
kirkhauck Mar 1, 2023
66182f6
feat: Add HTML skeleton without images
kirkhauck Mar 1, 2023
55f2e60
feat: Add room images
kirkhauck Mar 1, 2023
223995a
feat: Add back Turing logo due to errors
kirkhauck Mar 1, 2023
9bdf3d2
feat: Add images and adjust webpack to accept jpeg
kirkhauck Mar 1, 2023
667db2a
feat: Add CSS for page layout
kirkhauck Mar 1, 2023
eed9e7d
feat: Add color, font, and html title change
kirkhauck Mar 1, 2023
6d4e9d9
Merge pull request #24 from kirkhauck/Feature/dashboard
kirkhauck Mar 1, 2023
a9b657b
feat: Add classes, data, and test directories, and link test and clas…
kirkhauck Mar 1, 2023
2d08201
feat: Add and export sample data for testing
kirkhauck Mar 1, 2023
dcdc7c5
feat: Add initial Customer tests
kirkhauck Mar 1, 2023
23f7c79
refac: Remove .only from Customer-test describe block
kirkhauck Mar 1, 2023
a23b75f
feat: Add initial Room tests
kirkhauck Mar 1, 2023
da4f250
refac: Remove .only after describe block in Room-test.js
kirkhauck Mar 1, 2023
0c53617
feat: Add initial Booking tests
kirkhauck Mar 1, 2023
bfd3edd
Merge pull request #25 from kirkhauck/Feature/classes
kirkhauck Mar 1, 2023
e6ccdd5
feat: Add remaining options to room filter
kirkhauck Mar 1, 2023
fb4a505
feat: Add api fetches and login customer on window load
kirkhauck Mar 1, 2023
15816ee
refac: Adjust sample data to match api
kirkhauck Mar 1, 2023
94336c1
feat: Update tests to match sample data
kirkhauck Mar 1, 2023
a9e2e6c
feat: Add roomIDs property to Customer
kirkhauck Mar 1, 2023
6e03a9c
feat: Instatiate classes on window load
kirkhauck Mar 1, 2023
5e5a25c
refact: Remove bookings and associated tests from Customer
kirkhauck Mar 1, 2023
2e32cac
feat: Populate page with customer's bookings on window load
kirkhauck Mar 2, 2023
01a4d6f
feat: Calculate total cost of bookings and display on DOM
kirkhauck Mar 2, 2023
2f46517
feat: Add event listener for Check Vacancies button
kirkhauck Mar 2, 2023
dd61440
bug: Return correct bookings for some dates but not others
kirkhauck Mar 2, 2023
393b7f4
refac: Change sample data to match API data and edit tests to match
kirkhauck Mar 2, 2023
12e2047
feat: Add method to Customer to return customer's bookings
kirkhauck Mar 2, 2023
7dd43d7
feat: Add additional getCustomerBookings test
kirkhauck Mar 2, 2023
d22d597
feat: Integrate Customer.getCustomerBookings into showCustomerBooking…
kirkhauck Mar 2, 2023
d96df64
feat: Add Booking.getRoom method and integrated it with showCustomerB…
kirkhauck Mar 2, 2023
d1f9c7c
refac: Add Room methods to replace expressions in shoCustomerBookings…
kirkhauck Mar 2, 2023
c19730e
feat: Add BookingRepo class with getVacancies method
kirkhauck Mar 2, 2023
02300a8
feat: Return vacancies when user submits date
kirkhauck Mar 3, 2023
7af4f5e
feat: Show vacant rooms when user clicks Check Vacancies button
kirkhauck Mar 3, 2023
4bd030e
feat: Update display titles and allow user to go back to bookings
kirkhauck Mar 3, 2023
4433079
feat: Update BookingRepo.getVacancies to check vacancies by date and …
kirkhauck Mar 3, 2023
4a7d727
feat: Add ability to search vacancies by date and type
kirkhauck Mar 3, 2023
8b1cc71
feat: Reset search bar when customer returns to home view
kirkhauck Mar 3, 2023
ce0c56b
feat: POST to bookings API
kirkhauck Mar 3, 2023
210194f
feat: Replace book button with booked paragraph to prevent user from …
kirkhauck Mar 3, 2023
f58adcb
feat: Show apology if no rooms are available
kirkhauck Mar 3, 2023
433ab8c
Merge pull request #27 from kirkhauck/Feature/room-booking
kirkhauck Mar 3, 2023
c27b68f
feat: Add getTotalCost method to Customer
kirkhauck Mar 3, 2023
de45da8
feat: Make customer dashboard total dynamic
kirkhauck Mar 3, 2023
2426c73
fix: Set date input default value and min to today
kirkhauck Mar 3, 2023
8b7e599
Merge pull request #30 from kirkhauck/Fix/cost-empty-date
kirkhauck Mar 3, 2023
a54b6c4
fix: Float room booking paragraph and button to bottom of figure
kirkhauck Mar 3, 2023
3fdf184
fix: Prevent user from submitting an empty or incorrect date
kirkhauck Mar 3, 2023
271a974
fix: Change img alt and booked p to h6 to solve WAVE alerts
kirkhauck Mar 3, 2023
787a0dc
feat: Set max date input to 2100-12-31
kirkhauck Mar 3, 2023
dbf9a79
Merge pull request #31 from kirkhauck/Feature/accessibility
kirkhauck Mar 3, 2023
7da6954
bug: Fix issue where rooms with bidets were excluded from searches
kirkhauck Mar 5, 2023
4d15c4e
feat: Add HTML and CSS for login display
kirkhauck Mar 5, 2023
094b5d3
feat: Set up submit listener for login page and shows dashboard on su…
kirkhauck Mar 5, 2023
2af39c5
bug: Fix search bar layout to be inline and spaced evenly
kirkhauck Mar 5, 2023
bc6b217
feat: Login customer with proper credentials
kirkhauck Mar 5, 2023
6c28c29
bug: Arrange date after book button is clicked to mm/dd/yyyy
kirkhauck Mar 5, 2023
ace2f1e
Merge pull request #33 from kirkhauck/Feature/login-customer
kirkhauck Mar 5, 2023
14e80a1
refac: Adjust button and paragraph styling
kirkhauck Mar 5, 2023
b149a55
refac: Conform to Turing style guidelines
kirkhauck Mar 5, 2023
eb7fac6
refac: Remove unnecessary variables
kirkhauck Mar 5, 2023
4989f56
Merge pull request #36 from kirkhauck/Refactor/submission-refactor
kirkhauck Mar 5, 2023
cf10c95
feat: Add updated README.md
kirkhauck Mar 5, 2023
c545c27
Merge pull request #37 from kirkhauck/Feature/readme
kirkhauck Mar 5, 2023
3584570
feat: Fetch from vercel deployed API and update README.md
kirkhauck Mar 29, 2023
f4e2132
Merge pull request #38 from kirkhauck/Feature/vercel
kirkhauck Mar 29, 2023
2871eb8
feat: Update package.json for GitHub Pages deployment
kirkhauck Mar 30, 2023
9c6a214
Merge pull request #39 from kirkhauck/Feature/prepare-deployment
kirkhauck Mar 30, 2023
dec27bd
feat: Prepare for Vercel
kirkhauck Apr 3, 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
Binary file added .DS_Store
Binary file not shown.
123 changes: 49 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,74 @@
# Webpack Starter Kit
# Overlook Hotel

## Clone This Repo
## Abstract

That's right, _clone_ not fork. You will use this repo multiple times, but you can only fork a repository once. So here is what you need to do to clone the repo and still be able to push changes to your repo:
Overlook Hotel is an app mimicking a hotel website. As a user, you will first see a login screen. Upon entering the proper credentials, you will see your dashboard showing your current bookings and the total amount spent on rooms. The user can search for more rooms to book based on date and optional room type. The users, rooms, and bookings all utilize GET requests to a local API, and a POST request to bookings when a user books a room.
***

1. Clone down this repo. Since you don't want to name your project "webpack-starter-kit", you can use an optional argument when you run `git clone` (you replace the `[...]` with the terminal command arguments): `git clone [remote-address] [what you want to name the repo]`
1. Remove the default remote: `git remote rm origin` (notice that `git remote -v` not gives you back nothing)
1. Create a new repo on GitHub with the name of `[what you want to name the repo]` to be consistent with naming
1. Copy the address that you would use to clone down this repo - something like `git@github.com:...`
1. Add this remote to your cloned down repo: `git remote add origin [address you copied in the previous step]` - do not include the brackets
### Technologies Used:
- JavaScript
- HTML
- CSS
- WAVE/Lighthouse
- Webpack
- Mocha
- Chai
***

Now try to commit something (just add a line in the README) and push it up to your new repo. If everything is setup correctly, you should see the changes on GitHub.
### Installation Instructions:

## Setup
To clone a copy of the project to a remote repository, follow these steps:

After one person has gone through the steps of cloning down this repo and editing the remote, everyone should clone down the repo.
1. Clone down a local copy of [the repository](https://github.com/kirkhauck/overlook-hotel).
1. `cd` into the repository and run `npm install`.
1. You can open the project in your preferred text editor.
1. To host the page on your local server run first run `npm start`.
***

Then install the library dependencies. Run:
### Logging into the App

```bash
npm install
```
When you first open the app, you will be presented with a login screen. To login, enter the following credentials:

To verify that it is setup correctly, run `npm start` in your terminal. Go to `http://localhost:8080/` and you should see a page with the Turing logo image and a beautiful gradient background. If that's the case, you're good to go. Enter `control + c` in your terminal to stop the server at any time.
- Username: customer20 (can replace the number to view another user's dashboard)
- Password: overlook2021 (password for all users)

## Where to Add Your Code
### Preview of App:
![](demo.gif)
***

### JavaScript
### Context:

You have to be very intentional with where you add your feature code. This repo uses a tool called [webpack](https://webpack.js.org/) to combine many JavaScript files into one big file. Webpack enables you to have many, separate JavaScript files to keep your code organized and readable. Webpack expects all of your code files to be in a specific place, or else it doesn't know how to combine them all behind the scenes.
Completed as part of the Turing School of Software Development 2211 FE Mod 2 curriculum

**Create all of your feature code files in the `src` directory.**
Approximate hours to completion: 16
***

Since code is separated into multiple files, you need to use the `import` and `export` syntax to share code across file.
### Contributors:
[Kirk Hauck](https://github.com/kirkhauck)
***

Here is a video that walks through some information about [import and export](https://www.youtube.com/watch?v=_3oSWwapPKQ). There are a lot of resources out there about `import` and `export`, and resources will sometimes call them `ES6 modules`. It's something you will see in React and beyond.
### Learning Goals:

### HTML
Use OOP to drive the design of the application and the code
Work with an API to send and receive data
Solidify the code review process
Create a robust test suite that thoroughly tests all functionality of a client-side application
***

Add the HTML you need in the `index.html` file in the `./dist` directory. There is some boilerplate HTML that exists from the start that you can modify.
### Wins + Challenges:

### Images
**Win:**

Add your image files in the `src/images` directory. Similar to CSS files, you need to `import` image files in the JavaScript entry file (`scripts.js`). Then go into the HTML and add an `img` element with the `src` attribute pointing to the `images` directory. There is an example in the `index.html` file for you to see.
Created an app from the ground up with no provided instructions as to what classes or methods should be used.

## How to View Your Code in Action
**Win:**

In the terminal, run:
Successfully utilized GET and POST to use data from a local API.

```bash
npm start
```
**Challenge:**

You will see a bunch of lines output to your terminal. One of those lines will be something like:
Using `event.preventDefault()` with a button to submit a form with required fields. This method would prevent the notification from popping up telling the user to fill out a field. Learned how to listen form a `submit` event instead, which worked with `event.preventDefault()` to prevent page reloading while still allowing notifications for required fields.

```bash
Project is running at http://localhost:8080/
```
**Challenge:**

Go to `http://localhost:8080/` in your browser to view your code running in the browser.

---

## Test Files Organization

Similar to feature code, your test code needs to be put in a specific place for it to run successfully.

**Put all of your test files in the `test` directory.** As a convention, all test filenames should end with `-test.js`. For instance: `box-test.js`.

## Running Your Tests

Run your test suite using the command:

```bash
npm test
```

The test results will output to the terminal.

---

## Linting Your Code

Run the command in your terminal `npm run lint` to run the linter on your JavaScript code. There will be errors and warnings right from the start in this starter kit - the linter is still running successfully.

Your linter will look at the JavaScript files you have within the `src` directory and the `test` directory.

## Webpack?

If you look in the `package.json` file, you'll see one of the library dependencies called `webpack`. If you're interested in learning more about what Webpack is and how it works behind the scenes, take a look through the [Webpack configuration documentation](https://webpack.js.org/concepts/).

## Deploying to GitHub Pages

_If you are finished with the functionality and testing of your project_, then you can consider deploying your project to the web! This way anyone can play it without cloning down your repo.

[GitHub Pages](https://pages.github.com/) is a great way to deploy your project to the web. Don't worry about this until your project is free of bugs and well tested!

If you _are_ done, you can follow [this procedure](./gh-pages-procedure.md) to get your project live on GitHub Pages.
Planning a project without guidance as to classes or what class methods should be used. At first, planning and implementing features was chaotic. After research and seeking advice from peers, a new method was adopted where all functionality relating to DOM manipulation would be kept in `scripts.js` and all methods interacting with objects and data would be implemented as class methods. Using this process, the project was more organized and it became clear when and how to use classes.
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading