- Login to https://app.8base.com
- Create
Propertiestable with fieldsTitle,Description,Pictures,Bedrooms,Sq Footage,Bathrooms,Garage,Pool. - Create couple properties in Data
- Check you can query them using the API
- Clone repo:
git clone https://github.com/8base/uhack.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