- Login to https://app.8base.com
- Create a
Properties
table with the following fields:
Title: Text
Description: Text
Pictures: File (Allow Many)
Bedrooms: Number
Sq Footage: Number
Bathrooms: Number
Garage: Switch
Pool: Switch
- Click on "Data" and manually add a few Properties.
- Check that you can query your data using "API Explorer"
- Clone repo:
git clone https://github.com/8base/hackathon-starter-kit.git
- Go to the client directory
cd client
; - Edit
src/routes/properties/PropertiesTable.js
and complete thePROPERTIES_LIST_QUERY
GraphQL query:
const PROPERTIES_LIST_QUERY = gql`
query PropertiesList {
propertiesList {
items {
id
createdAt
updatedAt
pictures {
items {
id
downloadUrl
shareUrl
}
}
bedrooms
title
description
sqFootage
bathrooms
garage
pool
}
}
}
`;
- Edit
src/routes/properties/PropertyCreateDialog.js
and complete thePROPERTY_CREATE_MUTATION
GraphQL mutation:
const PROPERTY_CREATE_MUTATION = gql`
mutation PropertyCreate($data: PropertyCreateInput!) {
propertyCreate(data: $data) {
id
}
}
`;
- Install dependencies
yarn
; - Get 8base API endpoint for your account;
- Start app via
cross-env REACT_APP_8BASE_API_ENDPOINT=!YOUR_ENDPOINT! npm start
;
- Install 8base CLI:
yarn global add 8base
- Login using CLI
8base login
; - Go to the server directory
cd ../server
- Take a look at
8base.yml
andsrc/propertyShare.js
- Deploy server logic using
8base deploy
- Test the feature in the app