Skip to content

Commit

Permalink
Merge branch 'main' into working
Browse files Browse the repository at this point in the history
  • Loading branch information
SVinnik99 authored Feb 2, 2024
2 parents d1dad85 + 6c39de2 commit 801a54c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 45 deletions.
33 changes: 1 addition & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,11 @@

> _Periodic Tables_ is a reservation system for fine dining restaurants.
> The software is used only by restaurant personnel when a customer calls to request a reservation.
> At this point, the customers will not access the system online.
You can find the live application here: https://pablosperiodictables-6pwr.onrender.com

### API Documentation
You can find the live application here: https://restaurant-reservation-frontend-ebwe.onrender.com/

##### Endpoints

- "https://pablosperiodictables.onrender.com/reservations": Information for all reservations in the database.
- "https://pablosperiodictables.onrender.com/reservations/:reservation_id": Information for a single reservation.
- "https://pablosperiodictables.onrender.com/reservations/:reservation_id/seat": Assign a reservation to a table.
- "https://pablosperiodictables.onrender.com/reservations/:reservation_id/status": Update a reservation's status.
- "https://pablosperiodictables.onrender.com/tables": Information for all the tables in the restaurant.
- "https://pablosperiodictables.onrender.com/tables/:table_id/seat": Assign a reservation to a table.

##### HTTP Methods

- "https://pablosperiodictables.onrender.com/reservations": GET, POST.
- "https://pablosperiodictables.onrender.com/reservations/:reservation_id": GET, PUT.
- "https://pablosperiodictables.onrender.com/reservations/:reservation_id/seat": POST.
- "https://pablosperiodictables.onrender.com/reservations/:reservation_id/status": PUT.
- "https://pablosperiodictables.onrender.com/tables": GET, POST.
- "https://pablosperiodictables.onrender.com/tables/:table_id/seat": PUT, DELETE.

##### Request and Response Format

Expand All @@ -39,16 +21,3 @@ React, Node.js, Express, Knex, and PostgreSQL.
1. Run `npm install` to install project dependencies.
1. Run `npm run start:dev` to start your server in development mode.

### Screenshots

![Dashboard](/screenshots/dashboard.png)
_Caption: The main interface of the application with a list of reservations and tables._

![Creating a Reservation](/screenshots/create_reservation.png)
_Caption: Adding a new reservation to the list._

![Responsive Design](/screenshots/responsive_design.png)
_Caption: The application adapts to different screen sizes._

![Error Handling](/screenshots/error_handling.png)
_Caption: How errors are displayed to the user._
8 changes: 4 additions & 4 deletions back-end/knexfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ require("dotenv").config();
const path = require("path");

const {
DATABASE_URL = "postgresql://postgres@localhost/postgres",
DATABASE_URL_DEVELOPMENT = "postgresql://postgres@localhost/postgres",
DATABASE_URL_TEST = "postgresql://postgres@localhost/postgres",
DATABASE_URL_PREVIEW = "postgresql://postgres@localhost/postgres",
DATABASE_URL = "postgres://pcubeheq:[email protected]/pcubeheq",
DATABASE_URL_DEVELOPMENT = "postgres://pcubeheq:[email protected]/pcubeheq",
DATABASE_URL_TEST = "postgres://pcubeheq:[email protected]/pcubeheq",
DATABASE_URL_PREVIEW = "postgres://pcubeheq:[email protected]/pcubeheq",
DEBUG,
} = process.env;

Expand Down
5 changes: 3 additions & 2 deletions front-end/src/Edit/EditReservation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { useEffect, useState } from "react";
import { useParams, useHistory } from "react-router";
import { getReservation, updateReservation } from "../utils/api";
import ErrorAlert from "../layout/ErrorAlert";
import ReservationForm from "../Reservations/NewReservation";
import EditReservationForm from "../Reservations/EditReservationForm"
import EditReservationForm from "../reservations/EditReservationForm"
import ReservationForm from "../reservations/NewReservation";


function EditReservation() {
const { reservation_id } = useParams();
Expand Down
4 changes: 2 additions & 2 deletions front-end/src/Search/SearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useHistory } from "react-router-dom";
import "../App.css";
import { listReservations } from "../utils/api";
import ErrorAlert from "../layout/ErrorAlert";
import ReservationDetail from "../Reservations/ReservationDetail";
import ReservationDetail from "../reservations/ReservationDetail";

function SearchForm() {
const [numberToBeSearched, setNumberToBeSearched] = useState({
Expand Down Expand Up @@ -94,4 +94,4 @@ function SearchForm() {
);
}

export default SearchForm;
export default SearchForm;
4 changes: 2 additions & 2 deletions front-end/src/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { listReservations } from "../utils/api";
import { previous, next, today } from "../utils/date-time";
import ErrorAlert from "../layout/ErrorAlert";
import { useLocation, useHistory } from "react-router-dom";
import ReservationDetail from "../Reservations/ReservationDetail";
import TableList from "../Tables/TableList";
import ReservationDetail from "../reservations/ReservationDetail";
import TableList from "../tables/TableList";
import { listTables } from "../utils/api";

/**
Expand Down
6 changes: 3 additions & 3 deletions front-end/src/layout/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Redirect, Route, Switch } from "react-router-dom";
import Dashboard from "../dashboard/Dashboard";
import NotFound from "./NotFound";
import { today } from "../utils/date-time";
import NewReservation from "../Reservations/NewReservation";
import Tables from "../Tables";
import NewReservation from "../reservations/NewReservation";
import tables from "../tables";
import Seat from "../Seat";
import Search from "../Search";
import Edit from "../Edit";
Expand Down Expand Up @@ -49,7 +49,7 @@ function Routes() {
<Search />
</Route>
<Route exact={true} path="/tables/new">
<Tables />
<tables />
</Route>
<Route>
<NotFound />
Expand Down

0 comments on commit 801a54c

Please sign in to comment.