Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
455c2f2
Initial commit
daniabee Nov 8, 2022
2bddafb
Add customer.js file
daniabee Nov 8, 2022
7f45419
Add export to class file
daniabee Nov 8, 2022
7cdede7
Add room class and constructor
daniabee Nov 8, 2022
a3612d6
Add export to file
daniabee Nov 8, 2022
7829374
Create booking file
daniabee Nov 8, 2022
bd0a2a6
Add export default to file
daniabee Nov 8, 2022
a3969d7
Add hotel class
daniabee Nov 8, 2022
a039a20
Add export:
daniabee Nov 8, 2022
f5d47f8
Merge pull request #1 from daniabee/feature/customer_class
daniabee Nov 8, 2022
d5162cc
Merge pull request #2 from daniabee/feature/room_class
daniabee Nov 8, 2022
d08c376
Merge pull request #3 from daniabee/feature/booking_class
daniabee Nov 8, 2022
cbf0dc0
Merge pull request #4 from daniabee/feature/hotel_class
daniabee Nov 8, 2022
c3ad2ce
Initial commit
daniabee Nov 8, 2022
1fe6f6d
move classes files
daniabee Nov 8, 2022
f483f6d
Add sample data for customer
daniabee Nov 8, 2022
b306986
test for customer
daniabee Nov 8, 2022
6affaca
add room test
daniabee Nov 8, 2022
8168060
create test for booking
daniabee Nov 8, 2022
3138170
Add hotel test
daniabee Nov 9, 2022
e4fdaed
Add getMyBookings method
daniabee Nov 9, 2022
bcbe7a1
Add findCustomerBookings methods
daniabee Nov 9, 2022
08a0590
Add choose date method
daniabee Nov 9, 2022
6d89c6b
change ordering of data
daniabee Nov 9, 2022
7bc05cb
Refactor customer test
daniabee Nov 9, 2022
08b0f0b
add new testing to hotel
daniabee Nov 9, 2022
6a835dc
Add test for hotel create a booking
daniabee Nov 9, 2022
34b0926
add basic html
daniabee Nov 9, 2022
0cbad69
html
daniabee Nov 9, 2022
329530f
Add css
daniabee Nov 9, 2022
eb6d698
make sass
daniabee Nov 9, 2022
5313369
Merge pull request #5 from daniabee/feature/testing
LaurenBlack5280 Nov 10, 2022
759dc97
Merge pull request #6 from daniabee/feature/css-to-sass
LaurenBlack5280 Nov 10, 2022
91570df
implemented sass
daniabee Nov 10, 2022
8e410a0
form created
daniabee Nov 10, 2022
01cda00
add a response section
daniabee Nov 10, 2022
6d1f2d4
Merge pull request #7 from daniabee/feature/manage-my-bookings-form
daniabee Nov 10, 2022
d372399
Add refactored chosen date
daniabee Nov 11, 2022
ef34c5e
Add a new filter method
daniabee Nov 11, 2022
d208b1d
Add borders
daniabee Nov 11, 2022
5d0ee59
add room population function
daniabee Nov 11, 2022
f90f5b8
Added css for thumbnails
daniabee Nov 11, 2022
ea80123
Add functions for display
daniabee Nov 11, 2022
bd9e653
Merge pull request #8 from daniabee/feature/classes-adjustments
daniabee Nov 11, 2022
c5b66b8
'
daniabee Nov 11, 2022
27c52ae
Merge pull request #9 from daniabee/feature/change-pages
daniabee Nov 11, 2022
855a8c4
successfully fetched data
daniabee Nov 11, 2022
71d922a
add error handling to fetch)
daniabee Nov 11, 2022
55a29e6
add display booking functionality for a user
daniabee Nov 11, 2022
051be87
add error warning
daniabee Nov 11, 2022
b65e707
change booking css:
daniabee Nov 11, 2022
c910f68
css
daniabee Nov 11, 2022
1eae07e
Merge pull request #10 from daniabee/feature/fetch-data
daniabee Nov 11, 2022
8a2e4c0
Add post booking
daniabee Nov 12, 2022
7c1b49a
add valid date
daniabee Nov 12, 2022
bb1973e
add fixed get todays date
daniabee Nov 12, 2022
5db7cb7
Merge pull request #11 from daniabee/feature/error-handling
daniabee Nov 12, 2022
05adf75
add tabindex and event keys
daniabee Nov 12, 2022
44e39d0
add fixed number
daniabee Nov 12, 2022
8227eb0
add error handling
daniabee Nov 12, 2022
be823a5
fixed bug for finfd available rooms
daniabee Nov 12, 2022
75a39e1
Merge pull request #12 from daniabee/feature/accessibility
daniabee Nov 12, 2022
2c8119b
change labels
daniabee Nov 13, 2022
22adf9d
Merge pull request #13 from daniabee/feature/accessibility-refactor
daniabee Nov 13, 2022
3adc3de
fixed bug for calandering and displaying search
daniabee Nov 13, 2022
a2a3e8d
Merge pull request #14 from daniabee/feature/calander
daniabee Nov 13, 2022
bc8c3a7
readd styling
daniabee Nov 13, 2022
f4f587d
styling changes
daniabee Nov 13, 2022
fdaad0d
Merge pull request #15 from daniabee/feature/accessibility-brach
daniabee Nov 13, 2022
8736e92
add login feature
daniabee Nov 13, 2022
6a175a4
add testing for login method
daniabee Nov 13, 2022
506d1db
add login page and functions
daniabee Nov 13, 2022
0413d60
Merge pull request #16 from daniabee/feature/login
daniabee Nov 13, 2022
3e8e82a
added new error message
daniabee Nov 13, 2022
784ca25
add new methods
daniabee Nov 14, 2022
69c094f
Merge pull request #17 from daniabee/feature/update-classes
daniabee Nov 14, 2022
e201f62
add error handling for manager
daniabee Nov 14, 2022
8be3ef0
add manager functionality
daniabee Nov 15, 2022
d1a9a65
Merge pull request #18 from daniabee/feature/manager
daniabee Nov 15, 2022
76d125f
change error message
daniabee Nov 15, 2022
c8db3dd
add find by id
daniabee Nov 15, 2022
67293be
add error messaging
daniabee Nov 15, 2022
50bbe29
Merge pull request #19 from daniabee/feature/manager-refactor
daniabee Nov 15, 2022
ab703e4
add change
daniabee Nov 15, 2022
6d0d54e
Add fetch a customer
daniabee Nov 15, 2022
3022768
deleted console.logs
daniabee Nov 15, 2022
d89e865
add css changes to title
daniabee Nov 15, 2022
b56893f
Merge pull request #20 from daniabee/final/refactor
daniabee Nov 15, 2022
e924ed5
Update README.md
daniabee Nov 15, 2022
6777ab8
Update README.md
daniabee Nov 15, 2022
1b68212
Update README.md
daniabee Nov 15, 2022
b9d3f78
Update README.md
daniabee Nov 15, 2022
c40a80b
Update README.md
daniabee Nov 15, 2022
25aa60b
Update README.md
daniabee Nov 15, 2022
bb70087
Update README.md
daniabee Nov 15, 2022
dd67e3c
add sorted booking dates
daniabee Nov 15, 2022
4d4c3b2
Merge pull request #21 from daniabee/feature/sortDates
daniabee Nov 15, 2022
8220f0e
Update README.md
daniabee Jan 4, 2023
2fb78b1
Update README.md
daniabee Jul 27, 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
115 changes: 48 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,80 @@
# Webpack Starter Kit
# Overlook Hotel

## Clone This Repo
## Introduction

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:
The Overlook Hotel is an application where users can book hotel rooms. The user can book rooms by date, and by room type as long as there is availability. Customers can also view their upcoming and past stays. As a manager, users can see hotel information, add and delete bookings for a customer, and see any customers bookings.

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 `[email protected]:...`
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
This application was written by [Dani Bagley ](https://github.com/daniabee)

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.
**Login View**

## Setup

After one person has gone through the steps of cloning down this repo and editing the remote, everyone should clone down the repo.

Then install the library dependencies. Run:

```bash
npm install
```

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.

## Where to Add Your Code

### JavaScript
Upon opening the applications, the user is shown a login page where they can login with a customers username and password or managers username and password.

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.
<img width="1440" alt="loginView" src="https://user-images.githubusercontent.com/108088961/201993218-a12ed7d3-0de7-41d9-9625-b0070c087251.png">

**Create all of your feature code files in the `src` directory.**
**Welcome View**

Since code is separated into multiple files, you need to use the `import` and `export` syntax to share code across file.
When the user logs in, they are taken to a welcome page that displays their name or their employee title.

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.
<img width="1422" alt="WelcomView" src="https://user-images.githubusercontent.com/108088961/201993749-4ad89b26-c0a6-46e4-8b89-7e34414d95eb.png">

### HTML
**Check Availability By Date & Room Type**

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.
A user can check room availabilty by date. They can narrow their search by choosing what type of room they are looking for.

### Images
https://user-images.githubusercontent.com/108088961/201994789-dd03e275-e7a9-4ead-bbfc-04ba34ea381e.mov

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.
**Book Room**

## How to View Your Code in Action
A user can double click or tab to the room and press enter to book a room for the current set or loged in customer.

In the terminal, run:
https://user-images.githubusercontent.com/108088961/201995246-8f182d94-0ce0-4daf-8f39-65a3d85d0618.mov

```bash
npm start
```
**See Customer Bookings**

You will see a bunch of lines output to your terminal. One of those lines will be something like:
A user can see all bookings associated with a customer.

```bash
Project is running at http://localhost:8080/
```
<img width="1424" alt="CustomerBookings" src="https://user-images.githubusercontent.com/108088961/201995517-de66e54f-84ad-49f4-8660-8378b4a21301.png">

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

---
A manager can add and search rooms like a customer, but they can choose which costumer they are booking for and see todays information for the hotel in their dashboard.

## Test Files Organization
<img width="1440" alt="ManagerDashboard" src="https://user-images.githubusercontent.com/108088961/201995921-098b853a-c8c5-4720-958e-91c2399ed865.png">

Similar to feature code, your test code needs to be put in a specific place for it to run successfully.
**Manager View of Customer Bookings**

**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`.
Only a manager can delete bookings and only future bookings can be deleted. Bookings that can be deleted show up with a red text saying the user can double click to delete the booking or the user can tab to the booking and press enter.

## Running Your Tests
<img width="1424" alt="ManagerViewOfCustomerBookings" src="https://user-images.githubusercontent.com/108088961/201996327-fa50462d-c588-4eee-a44d-f36ebf176d13.png">

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.
## Setup

Your linter will look at the JavaScript files you have within the `src` directory and the `test` directory.
1. Clone down this [repo](https://github.com/turingschool-examples/overlook-api)
2. cd into the directory and run `npm install`
3. Run `npm start`.
4. cd out of that directory and clone down this [repo](https://github.com:/daniabee/Hotel-Dani)
5. cd into the director and run `npm install`
6. Run `npm start`
7. Go to `http://localhos:8080/` to view the webpage

## Webpack?
## Technologies used

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/).
- Mocha
- Chai
- Javascript
- HTML
- CSS/SASS
- Github
- Get & Post Netork Requests
- Webpack

## Deploying to GitHub Pages
## Ending Thoughts

_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.
At this point in my journey as a software developer, I am very proud of this application. Being able to navigate network requests for the first time was a very big win. Another win was being able to change the origonal webpack loader to handle SASS files.

[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!
Possible Improvements:

If you _are_ done, you can follow [this procedure](./gh-pages-procedure.md) to get your project live on GitHub Pages.
- Add an additional view or section to display past bookings and upcoming bookings, rather than displaying them in the same place.
- Adding dynamic functionality for error handling as do dry up my code even further.
- Cleaning up the error handling css and styling to be more visually appealing.
146 changes: 133 additions & 13 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,136 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Webpack Starter Kit</title>
</head>
<body>
<img src="./images/turing-logo.png" alt="turing logo">

<!-- Do not include the scripts.js or class files here - it is done by the webpack server -->
<script src="bundle.js"></script>

</body>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Cantata+One&family=Great+Vibes&display=swap"
rel="stylesheet"
/>
<title>Hotel Dani</title>
</head>
<body>
<span class="title"
><h1 id="The">The</h1>
<h1 id="Overlook">Overlook</h1>
</span>
<nav class="navigation">
<section class="first-navigation hide">
<button class="create-bookings-button">My Dashboard</button>
<button class="manage-bookings-button">Manage Bookings</button>
</section>
<button class="sign-in hide">Sign In</button>
</nav>
<main class="main">
<span class="main-box">
<h2 class="welcome welcome-styling hide">Welcome</h2>
<section class="log-in">
<h2 class="bad-login hide">Not a valid user!</h2>
<form id="content">
<div class="input-bar">
<label for="name"
><img
class="icon-image"
src="/images/user.png"
alt="user icon"
/>Username</label
>
<input type="text" id="name" class="input" />
</div>
<div class="input-bar">
<label for="password"
><img
class="icon-image"
src="/images/lock.png"
alt="lock icon"
/>Password</label
>
<input
type="password"
id="password"
class="input"
value="overlook2021"
/>
</div>
</form>
<button type="submit" id="login-btn">Login</button>
</section>
<section class="manage-bookings hide">
<h2>
You have not choosen a customer's bookings to view yet! Please
choose a customer.
</h2>
</section>
<section class="add-booking hide">
<form id="booking-form">
<div class="form-group calendar-section" id="calendarSection">
<label class="book-room-titles" for="calendar"
>Check availability:</label
>
<input
class="book-room-titles calendar"
type="date"
id="calendar"
name="booking"
value=""
min=""
/>
</div>
<div class="form-group">
<label for="select-room"
>What room type are you looking for?</label
>
<select id="select-room" class="form-control" required="">
<option disabled="" selected="" value="">
What room type are you looking for?
</option>
<option value="no-preference">No preference</option>
<option value="residential suite">Residential Suite</option>
<option value="suite">Suite</option>
<option value="single room">Single Room</option>
<option value="junior suite">Junior Suite</option>
</select>
</div>
<div class="form-group">
<button type="submit" id="submit-booking" class="submit-button">
Search
</button>
</div>
<section class="managers-form-section hide">
<div class="form-group">
<label for="find-customer"
>Type custmers name to manage their bookings:</label
>
<input type="text" id="find-customer" class="input" />
</div>
<div class="form-group">
<button id="search-customers" class="submit-button">
Choose Customer
</button>
</div>
<section class="hotel-information">
<h2 class="hotel-info">Hotel Information:</h2>
<h2 id="rooms-available" class="hotel-info">PLACEHOLDER</h2>
<h2 id="total-revenue" class="hotel-info">PLACEHOLDER</h2>
<h2 id="percentage-occupied" class="hotel-info">PLACEHOLDER</h2>
<h2 id="current-searched-customer" class="hotel-info">
Customer: None selected
</h2>
</section>
</section>
</form>
<section class="booking-results">
<h2 id="available-rooms">Double click on a room to book it!</h2>
<section class="room-thumbnails">
<!-- ROOMS GO HERE -->
</section>
</section>
</section>
</span>
</main>
<script src="bundle.js"></script>
</body>
</html>
Loading