Skip to content

docs(readme.md): refactor readme to be more focused, added logo #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 28 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<img src="public/images/logo-blk.png" height="50" align="right">

# Homebase React

[![CI](https://github.com/homebaseio/homebase-react/workflows/CI/badge.svg)](https://github.com/homebaseio/homebase-react/actions?query=workflow%3ACI)
Expand All @@ -8,7 +10,10 @@

*The graph database for delightful React state management*

## Installation

Homebase React makes state management painless by enabling you to plug a relational graph database into your React application with just 3 lines of code. This is the same database that powers Roam Research and many other ClojureScript applications, but with an API that's familiar to React and JS developers.

## Install

```bash
# NPM
Expand All @@ -17,22 +22,22 @@ npm install homebase-react --save
# Yarn
yarn add homebase-react
```
## Features
- The simplest and most declarative state management solution
- The power of a backend relational graph database, but without having to wait on the network
- Convenient JSON query syntax
- Powerful Clojure style [Datalog](https://docs.datomic.com/on-prem/query.html) query syntax if you need it
- Traverse your data graph like it's a big JSON object
- Backup your data to the cloud

## Purpose

Data should be a first class citizen on the client. We deserve the ergonomics and power of relational databases not just on the server, but in our React applications.

Homebase React lets you plug a relational database into your React application with just 3 lines of code. In fact, it's the same database that powers Roam Research and many other ClojureScript applications, but with an API that's familiar to React and JS developers.

- Replace Redux with something simpler and more declarative
- Stop spending time wiring up custom datatypes, reducers, caches and other bespoke state mumbo jumbo
- Gain all the benefits of relational data like a single source of truth
- Traverse your data graph like it's one big JSON object
- Query your database with a convenient JSON query syntax
- Query your database with Clojure style [Datalog](https://docs.datomic.com/on-prem/query.html) if you need more power
- It's just data
## Roadmap

The goal of Homebase React is to be immediately more intuitive than any denormalized JSON store and over time we will eliminate all the tedious aspects of manipulating data on clients. Homebase React makes it easier to work with complex data on client by making our applications [local-first](https://news.ycombinator.com/item?id=21581444).
1. Document integration with more backends
1. Swap [Datascript](https://github.com/tonsky/datascript) out for [Datahike](https://github.com/replikativ/datahike)
1. Immutability
1. History / Change Tracking
2. Persist to IndexedDB
3. [Local-first](https://www.inkandswitch.com/local-first.html) conflict resolution for offline caching and sync between multiple devices

## Examples
### Live Demos
Expand All @@ -41,7 +46,6 @@ You can see our hosted live demos [here](https://homebaseio.github.io/homebase-r
### Code Examples
You can clone and run our React code examples [here](https://github.com/homebaseio/homebase-react-examples).


## API Overview

### `HomebaseProvider`
Expand All @@ -52,13 +56,12 @@ The HomebaseProvider wraps your React app and makes a relational database access
import { HomebaseProvider, useEntity, useTransact, useQuery } from 'homebase-react'

const config = {
// Schema is not a type system like in most DBs.
// That is something we're considering, but for now it is
// mainly applied at query time to simplify relational queries.
// The only schema currently supported is:
// Schema is not a type system,
// it's a way to simplify relational queries at query time.
// The schema currently supported is:
// `type: 'ref'` which is a relationship and
// `unique: 'identity` which enforces a uniqueness constraint
// and let's you lookup entities by their unique attributes.
// and lets you lookup entities by their unique attributes.
schema: {
todo: {
project: { type: 'ref' },
Expand Down Expand Up @@ -132,9 +135,9 @@ transact([['retractEntity', 1]])

### `useQuery`

Use queries to return an array of entities that meet a given criteria. Our query API is powered by datalog, but exposed as JSON similar to a JS SQL driver or Mongo DB. Datalog is similar to SQL and is incredibly powerful. However only a subset of features are currently available in JSON.
Use queries to return an array of entities that meet a given criteria. Our query API is powered by Datalog, but exposed as JSON similar to a JS SQL driver or MongoDB. Datalog is similar to SQL and is incredibly powerful. However, only a subset of features are currently available in JSON.

We are very interested in what features the community wants, and will prioritize based on feedback. In the meantime you can further filter results with JS `filter()` and `sort()`.
We will prioritize features based on community feedback so please open an issue if there's something you need. In the meantime you can further filter results with JS `filter()` and `sort()`.

```js
// Finds all todos with a name
Expand Down Expand Up @@ -167,6 +170,8 @@ This hook returns the current database client with some helpful functions for sy

Check out the [Firebase example](https://homebaseio.github.io/homebase-react/#!/example.todo_firebase) for a demonstration of how you might integrate a backend.



## Performance

Homebase React tracks the attributes consumed in each component via the `entity.get` function and scopes those attributes to their respective `useEntity` or `useQuery` hook. Re-renders are only triggered when an attribute changes.
Expand Down Expand Up @@ -201,17 +206,6 @@ const Todo = React.memo(({ todo }) => {

## Docs
https://www.notion.so/Homebase-Alpha-Docs-0f0e22f3adcd4e9d87a13440ab0c7a0b

## Roadmap

1. Improve performance
1. Document integration with backends
1. Swap [Datascript](https://github.com/tonsky/datascript) out for [Datahike](https://github.com/replikativ/datahike)
1. Immutability
1. History / Change Tracking
1. Persist to IndexDB
1. Local-first conflict resolution for offline caching and sync between multiple devices

## Development

```bash
Expand Down
Binary file added public/images/logo-blk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.