Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chuksjoshuaa/hotel-projects
Full stack hotel web application. Get all lists of hotels and their various hotel brand. Users can post, update and delete the various hotels created. Project was built with Bootstrap, GraphQL, React.js, Node.js, Typescript, Typeorm, PostgreSQL, Redis and so much more
https://github.com/chuksjoshuaa/hotel-projects
apollo-client bootstrap5 css3 graphql html5 nodejs postgresql railway reactjs redis typeorm typescript urql vercel
Last synced: about 1 month ago
JSON representation
Full stack hotel web application. Get all lists of hotels and their various hotel brand. Users can post, update and delete the various hotels created. Project was built with Bootstrap, GraphQL, React.js, Node.js, Typescript, Typeorm, PostgreSQL, Redis and so much more
- Host: GitHub
- URL: https://github.com/chuksjoshuaa/hotel-projects
- Owner: ChuksJoshuaa
- Created: 2022-12-07T12:40:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T15:05:58.000Z (about 2 years ago)
- Last Synced: 2024-11-13T02:08:42.588Z (3 months ago)
- Topics: apollo-client, bootstrap5, css3, graphql, html5, nodejs, postgresql, railway, reactjs, redis, typeorm, typescript, urql, vercel
- Language: TypeScript
- Homepage: https://hotel-projects.vercel.app
- Size: 710 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hotel Full Stack Web Application.
![]()
## GraphQL Queries & Mutations## Queries
### Get names of all brands
```
query Brands {
brands {
id
name
createdAt
updatedAt
}
}
```### Get a single brand
```
query Brand($id: Int!) {
brand(id: $id) {
id
name
createdAt
updatedAt
}
}
```### Get names of all hotels
```
query Hotels {
hotels {
id
name
description
image
price
city
address
country
brandId
authorId
createdAt
updatedAt
}
}```
### Get a single hotel
```
query Hotel($id: Int!) {
hotel(id: $id) {
id
name
description
image
price
city
address
country
authorId
createdAt
updatedAt
brandId
}
}```
### Get filtered hotels by brand
```
query FilterHotels($brandId: Int!) {
filterHotels(brandId: $brandId) {
id
name
description
image
price
city
address
country
authorId
createdAt
updatedAt
brandId
}
}```
##Mutations
### Create a new brand
```
mutation CreateBrand($input: BrandInput!) {
createBrand(input: $input) {
id
name
authorId
createdAt
updatedAt
}
}```
### Create a new hotel
```
mutation CreateHotel($input: HotelInput!) {
createHotel(input: $input) {
id
name
description
image
price
city
address
country
brandId
authorId
createdAt
updatedAt
brandId
}
}```
### Delete a brand and return a boolean
```
mutation DeleteBrand($id: Int!) {
deleteBrand(id: $id)
}```
### Delete an hotel and return a boolean
```
mutation DeleteHotel($id: Int!) {
deleteHotel(id: $id)
}```
### update an hotel brand
```
mutation UpdateBrand($id: Int!, $name: String!) {
updateBrand(id: $id, name: $name) {
id
name
createdAt
updatedAt
}
}```
### update an hotel
```
mutation UpdateHotel(
$id: Int!
$name: String!
$description: String!
$brandName: String!
$address: String!
$city: String!
$image: String!
$country: String!
$price: Int!
) {
updateHotel(
id: $id
name: $name
description: $description
brandName: $brandName
address: $address
city: $city
image: $image
country: $country
price: $price
) {
id
name
description
image
price
city
address
country
brandId
authorId
createdAt
updatedAt
}
```### Login
```
mutation Login($email: String!, $password: String!) {
login(email: $email, password: $password) {
errors {
field
message
}
user {
id
username
createdAt
updatedAt
}
}
}```
### Register
```
mutation Register($options: UserPasswordInput!) {
register(options: $options) {
errors {
field
message
}
user {
id
username
createdAt
updatedAt
}
}
}```
### Logout
```
mutation Logout {
logout
}```