- Login to https://app.8base.com
- Create a
Propertiestable with the following fields:
Title: TextDescription: TextPictures: File (Allow Many)Bedrooms: NumberSq Footage: NumberBathrooms: NumberGarage: SwitchPool: 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.jsand complete thePROPERTIES_LIST_QUERYGraphQL 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.jsand complete thePROPERTY_CREATE_MUTATIONGraphQL 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.ymlandsrc/propertyShare.js - Deploy server logic using
8base deploy - Test the feature in the app