Migrate getting started & rules guide to GitHub Wiki

This commit is contained in:
Sidney Alcantara
2020-10-03 17:30:28 +10:00
parent 63505097a5
commit df05d5fc92
3 changed files with 18 additions and 318 deletions

143
README.md
View File

@@ -1,146 +1,39 @@
# [![Firetable](./www/src/assets/firetable-with-wordmark.svg)](https://firetable.io/)
Firetable is a spreadsheet-like UI for Firestore.
No more building admin portals to let business users to access data from Google
Cloud.
[![Firetable: Combine the power of Firestore with the simplicity of spreadsheets](https://firetable.io/social-image.jpg)](https://firetable.io)
![Commit](https://img.shields.io/github/last-commit/AntlerVC/firetable?color=%23ed4747)
<!-- [![Discord Shield](https://discordapp.com/api/guilds/746329234720686132/widget.png?style=shield)](https://discord.gg/Vdshr9E) -->
## Firetable UI
### Firetable UI [(Live Demo)](https://try.firetable.io)
<big>[**Live Demo →**](https://try.firetable.io)</big>
Supports fields such as images, files, single/multi select, in addition to
standard fields. Functions such as row resizing, csv data import/export and much more!
standard fields. Functions such as row resizing, CSV data import/export and much
more!
![Firetable screenshot](https://firetable.io/demo.gif)
## Setup instructions
# Getting started
### Installation requirements
To set up Firetable, you must be comfortable with working with the command line.
Make sure you have the following installed:
You must have at least a basic understanding of how to use npm and install npm
packages globally.
- [Git](https://git-scm.com/downloads)
- [Node](https://nodejs.org/en/download/) 10, 11, or 12
- [Yarn](https://classic.yarnpkg.com/en/docs/install/)
<big>[**Read the getting started guide →**](wiki/Getting-Started)</big>
### 1. Create and set up a Firebase project
# Issues
- Create a new project using the
[Firebase Console](https://console.firebase.google.com/)
- Create a Firestore database
- Set up Firestore Security Rules: use Test Mode or set up required permissions.
Below are sample rules that allow for unlimited access to the entire database
just for quick testing purpose:
```
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
```
[Or follow this guide for setting up custom rules](RULES.md)
- Upgrade project to the Blaze Plan
- Enable the Google sign-in method in **Authentication / Sign-in method**
- **⚠️ IMPORTANT:** If you try to sign in and see “This account does not have
any roles”, run
[the following script](https://github.com/AntlerVC/firetable/blob/develop/RULES.md#custom-claims)
on your Firebase Authentication user.
### 2. Run the Firetable CLI
The Firetable CLI automates the steps required to set up your Firetable app
locally.
Before using it, make sure you have the Firebase CLI installed.
[Instructions](https://firebase.google.com/docs/cli)
```
yarn global add firetable
```
Then run the following command, specifying the directory for your Firetable app.
```
firetable init [directory]
```
Now you can run Firetable locally using
```
cd [directory]
firetable start
```
### Manually set up Firetable app
If you dont want to run the Firetable CLI, follow these steps:
#### 1. Clone this repo
```
git clone https://github.com/AntlerVC/firetable.git
```
#### 2. Set React app environment variables
Create a .env file in the `www` directory
- Get the Firebase **Project ID** and **Web API Key** from your Firebase
Projects **Settings** page. Click the cog icon on the left sidebar (under the
Firebase logo) and click **Project settings**
- (Optional) Get the generated **Application ID** and **Search-Only API Key**
from the Algolia **API Keys** page
```
REACT_APP_FIREBASE_PROJECT_ID=
REACT_APP_FIREBASE_PROJECT_WEB_API_KEY=
REACT_APP_ALGOLIA_APP_ID=
REACT_APP_ALGOLIA_SEARCH_API_KEY=
```
#### 3. Install front-end dependencies
```
cd www
yarn
```
#### 4. Run project locally
```
yarn start
```
## Issues
[Please create issues here.](https://github.com/antlervc/firetable/issues)
[Create issues here.](https://github.com/antlervc/firetable/issues)
Make sure to provide console log outputs and screenshots!
### Known Issue: “This account does not have any roles”
# Roadmap and feature requests
If you try to sign in and see “This account does not have any roles”, run
[the following script](https://github.com/AntlerVC/firetable/blob/develop/RULES.md#custom-claims)
on your Firebase Authentication user.
## Roadmap and feature requests
- [View our roadmap here](ROADMAP.md)
- [View our ideas and feature requests here](https://github.com/AntlerVC/firetable/projects/1)
- [Roadmap](wiki/Roadmap)
- [View our ideas and feature requests](https://github.com/AntlerVC/firetable/projects/1)
---
## About Antler Engineering
# About Antler Engineering
Firetable is created and being actively developed by
[Antler Engineering](https://twitter.com/AntlerEng).
@@ -150,5 +43,5 @@ At [Antler](https://antler.co), we identify and invest in exceptional people.
Were a global startup generator and early-stage VC firm that builds
groundbreaking technology companies.
[Apply now](https://www.antler.co/apply?utm_source=Firetable&utm_medium=website&utm_campaign=Thu%20Apr%2016%202020%2018:00:00%20GMT%2B0200%20(CEST)&utm_content=TechTracking) to be part of a global cohort of tech
founders.
[Apply now](<https://www.antler.co/apply?utm_source=Firetable&utm_medium=website&utm_campaign=Thu%20Apr%2016%202020%2018:00:00%20GMT%2B0200%20(CEST)&utm_content=TechTracking>)
to be part of a global cohort of tech founders.

View File

@@ -1,108 +0,0 @@
# Firetable Roadmap
## POC ✅
### Initial fields:
- checkbox(boolean) ✅
- simple text(string) ✅
- email(string) ✅
- phone(string) ✅
- url(string) ✅
- Number(number) ✅
- long text(string) ✅
### Functionality:
- Create Tables (Primary collections) ✅
- Create columns (fields) ✅
- Create rows(documents) ✅
- Edit cells ✅
- Authenticate ✅
- Delete rows ✅
## MVP ✅
### additional fields:
- single select(string) ✅
- Multiple select(array of strings) ✅
- date(Firebase timestamp) ✅
- time(Firebase timestamp) ✅
- file (single) ✅
- image (single) ✅
- single select reference(DocReference) ✅
- multi select reference(DocReference) ✅
- rating ✅
### Functionality:
- Delete columns✅
- Edit columns✅
- Fixed column ✅
- Hide/Show columns ✅
- resizable column ✅
- keyboard cell navigation ✅
- column / table Create/edit ✅
- import csv to table ✅
## V1
### additional fields:
- json ✅
- file (multi) ✅
- image (multi) ✅
- Percentage(number)
- Slider(number) ✅
- Table(Document[]) ✅
- Rich Text(html string)) ✅
- Callable buttons ✅
- meta fields:✅
- createdAt
- createdBy
- updatedAt
- updatedBy
### Functionality:
- Sort rows ✅
- reorder columns ✅
- Auto suggest columns based of existing docs ✅
- Locked columns ✅
- SubCollection tables ✅
- Permissions✅
- Duplicate columns
- Filter columns:✅
- equals to✅
- Starts with
- contains ✅
- Export tables to csv ✅
- Dialog View of a row(SideDrawer) ✅
- Import CSV by matching with primary unique key column
# V+
### Additional Fields:
- currency
- Derivative
- count(docs in collection)
- index(number)
- Duration (ss/hh/mm/dd)
### Functionality:
- Themes
- Table templates
- multi auth
- Table view only mode
- Make a toggle switch to allow single/multi
- Image
- File
- Reference
- Select
- Mark primary/unique columns
- Webhooks
- Firestore Rules automation

View File

@@ -1,85 +0,0 @@
# Firetable Rules
Firetable uses a Role based access control on top of
[firestore rules](https://firebase.google.com/docs/firestore/security/get-started).
## Firestore Rules Base
```
rules_version = '2'
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
// this is gives full rights to users with an admin role
allow read, write: if hasRole("ADMIN")
}
match /_FIRETABLE_/settings {
// specify the roles that have access firetable configuration
// this allows users to view tables and columns on firetable but without the ability to modify them
allow read: if hasAnyRole(["INTERNAL"])
match /{collection=**}/{tableName} {
allow read: if hasAnyRole(["INTERNAL"])
}
}
match /_FT_USERS/{docId} {
// allows to store firetable user customizations such as filters and favorite tables
allow get, update, create, write:if isOwner(docId)
}
// utility functions
function hasRole(role) {
return role in request.auth.token.roles
}
function hasAnyRole(roles) {
return request.auth.token.roles.hasAny(roles)
}
function isOwner(docId) {
// turns a boolean for if the authenticated user has the same uid as the resource document id
return request.auth.uid == resource.id || request.auth.uid == docId
}
}
}
```
## Custom claims
The firetable roles are stored in the users firebase auth token custom claims
[(firebase auth Docs)](https://firebase.google.com/docs/auth/admin/custom-claims)
### setting roles
You can use the CLI tool to set your roles
[here](https://github.com/AntlerVC/firetable/blob/master/cli/README.md#Setting-user-Roles)
It relays on this basic script. you can run this locally using the adm sdk or
implement it in your cloud functions
```js
import * as admin from "firebase-admin";
//set your project id
const projectId = "YOUR FIREBASE PROJECT ID HERE";
console.log(`Running on ${projectId}`);
// you can get the admin sdk service account key from the url bellow, remember to add your project Id
//https://console.firebase.google.com/u/0/project/_/settings/serviceaccounts/adminsdk
var serviceAccount = require(`./firebase-service-account.json`);
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: `https://${projectId}.firebaseio.com`,
});
// Initialize Auth
export const auth = admin.auth();
// sets the custom claims on an account to the claims object provided
const setClaims = async (email, claims) => {
const user = await auth.getUserByEmail(email);
auth.setCustomUserClaims(user.uid, claims);
};
setClaims("enter your email", {
roles: ["ADMIN"],
});
```